This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

Gadgets provides a way to control physical devices with python on a Beaglebone or a Raspberry PI (Raspberry Pi only has gpio and spi switch functionality for now). It provides an easy way to create a system that:

  • Controls devices with the gpio, pwm, adc, and 1-wire interfaces
  • Has an easy to use User Interface
  • Can be distributed across many devices
  • Uses RCL (Robot Command Language)
  • Can run methods (a sequece of RCL commands)

Gadgets provides several classes that are useful for controlling various devices. They are:

  • Switch
  • Valve
  • Heater
  • Cooler
  • Motor

The simplest one is Switch. Here is an example of how to set up a gadgets system that uses Switch to control multiple devices.

The first thing to do is define the switches you are going to use with a dictionary

>>> from gadgets.pins.beaglebone import pins
>>> from gadgets import get_gadgets
>>> arguments = {
...     "locations": {
...         "living room": {
...             "light": {
...             "type": "switch",
...             "pin": pins["gpio"][8][3]
...             },
...         "back yard": {
...             "sprinklers": {
...             "type": "switch",
...             "pin": pins["gpio"][8][11],
...             },
...         },
...     },
... }
>>> gadgets = get_gadgets(arguments)
>>> gadgets.start()

The above definition assumes you have connected some switch (perhaps a transistor or a relay) to port 8, pin 3 on the Beaglebone, and perhaps a transistor connected to port 8, pin 11. The transistor would then be connected to the solenoid valve that turns on the sprinklers (you will probably not be able to connect the solenoid directly to your Beaglebone because it would draw too much current and probably uses 24V AC).

One way you can turn on the light that you defined above is to open another terminal and start a python prompt.

>>> from gadgets import Sockets
>>> s = Sockets()
>>> s.send("turn on living room light")

The light you have connected to the Beaglebone should now turn on.

>>> s.send("turn off living room light")

This, of course, turns the light off. These two commands are examples of RCL (Robot Command Language).

To turn on the sprinklers in the back yard for 15 minutes, you would send this command:

>>> s.send("turn on back yard sprinklers for 15 minutes")

You can also control the gadgets by using the built in curses based user-interface. See gadgets.ui for more details.

CHANGES

0.3.1, 7/25/2013 -
added a request-response mechanism so the status of the system can be requested. Added a reference to the iphone interface to the docs.
0.3.0, 7/18/2013 -
improved the ‘command mode’ of the ui improved the note taking dialog of the ui changed the greenhouse example to reflect my current greenhouse setup
0.2.3, 5/28/2013 -
added ‘–commad’ to the gadgets console script fixed a few bugs added an example for watering the grass
0.2.2, 4/24/2013 -
fixed a bug in the shift register switch
0.2.1, 4/24/2013 -
fixed the curses user interface
0.2.0, 4/23/2013 -
added support for raspberry pi gpio
0.1.1, 3/6/2013 -

added a momentary option for switch, so that it only turns on for a small amount of time

changed README.md to README.txt so it will show up on pypi

added gadgets.devices.Button. It monitors a gpio input pin and pushes a status update when it changes

0.1.0, 2/26/2013 -

changed the way thermometer works and how it is configured for get_gadgets

added XBee IO for Switch

0.0.2, 2/16/2013 -
added a shift register switch

0.0.1, 2/12/2013 - first version

Release History

Release History

0.3.1

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.2.2

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.2.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.2.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.2dev

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1dev

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
gadgets-0.3.1.tar.gz (44.6 kB) Copy SHA256 Checksum SHA256 Source Jul 25, 2013

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting