All Projects → metachris → raspberrypi-utils

metachris / raspberrypi-utils

Licence: MIT license
Collection of utilities for the Raspberry Pi

Programming Languages

python
139335 projects - #7 most used programming language
shell
77523 projects

Python tools to simplify working with the Raspberry Pi and it's GPIO port. All source code in this repository is released under the MIT license.

RPIO

Extension of RPi.GPIO which can handle interrupts. Works with Python 2.x and 3.x. The easiest way to install RPIO is via pip or easy_install:

sudo easy_install -U RPIO

This project has a new home: https://github.com/metachris/RPIO

gpiodaemon.py

Socket daemon which can handle scheduled task management (run a command in seconds, eg. to turn something off after a certain amount of time), and accepts user defined commands (eg. led on instead of set 17 HIGH). Custom commands and pin setup are defined in config.yaml. The deamon listens on port 9101. Requires the tornado and pyyaml.

rpi_detect_model.py

Detects a Raspberry's model and manufacturer, and makes the attributes easily accessible.

sdbackup.sh

Backup boot and root partition of a linux SD card into .tar files.

Interrupts

Interrupts can be used to receive notifications from the kernel when GPIO state changes occur. This has the advantages of requiring almost zero cpu consumption and very fast notification times, as well as allowing to easily monitor specific transitions via edge='rising|falling|both'. Here is an example:

import RPIO

def do_something(gpio_id, value):
    print("New value for GPIO %s: %s" % (gpio_id, value))

RPIO.add_interrupt_callback(17, do_something, edge='rising')
RPIO.add_interrupt_callback(18, do_something, edge='falling')
RPIO.add_interrupt_callback(19, do_something, edge='both')
RPIO.wait_for_interrupts()

Links

Feedback

Chris Hager ([email protected])

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].