Skip to main content

RPi.GPIO2

PyPI version

Summary:

This project implements a compatibility layer between RPi.GPIO syntax and libgpiod semantics.

Problem:

RPi.GPIO requires non-standard kernel patches that expose the GPIO registers to userspace via a character device /dev/gpiomem. As this is not supported by the mainline Linux kernel, any distribution targeting Raspberry Pi devices running the mainline kernel will not be compatible with the RPi.GPIO library. As a large number of tutorials, especially those targeted at beginners, demonstrate use of the RPi's GPIO pins by including RPi.GPIO syntax, this incompatibility limits users to distributions build on a special downstream kernel maintained by the Rapberry Pi foundation. We would like to enable beginners on any Linux distribution by allowing them to follow easily available tutorials.

Solution:

Using the provided module, one will be able to write python code to use the Raspberry Pi's GPIO pins as if they were using the API implemented by RPi.GPIO, but instead using libgpiod's python bindings. libgpiod provides a straightforward interface for interacting with GPIO pins on supported devices via the mainline Linux kernel interface.

For more detailed information on the design and implementation of this library, please refer to the functional and technical specification.

Notes:

Do not install RPI.GPIO via pip3 as that will attempt to install the raspbian-only library that motivated this project in the first place. If that package is installed alonside this one, attempts to import RPi.GPIO will cause an error as python will attempt to import the wrong package.

To install the python development dependencies, run pip install -r requirements.txt.

Use of a virtual env is recomended for a development setup. This will allow local installation of the library via pip install -e . in the repository root.

The libgpiod python bindings must be installed and accessible from the development environment. This package is not available via pip install and must be installed using the system package manager.

To enable access non-root access to the gpio pins, use the provided non_root_permission.sh script. Upon successful execution, any user in Linux user group 'gpio' will be able to access the gpio pins via this library.

To view the locations and surrounding lines of all TODOs, FIXMEs, and NOTEs in the codebase, use the notes.sh script included with this project.

This project is free software, please refer to our LICENSE for further detail.

Metadata

Release files for RPi.GPIO2 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for RPi.GPIO2 0.4.0
File Size Uploaded
RPi.GPIO2-0.4.0.linux-aarch64.tar.gz 45.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for RPi.GPIO2 0.4.0
File Interpreter ABI Platform
RPi.GPIO2-0.4.0-py3.10.egg Legacy Egg format - - Details

Total release size: 102.6 kB

Release files / RPi.GPIO2-0.4.0.linux-aarch64.tar.gz

Download URL RPi.GPIO2-0.4.0.linux-aarch64.tar.gz
Size 45.6 kB
Tags Source
SHA-256 checksum
How to use checksums
17ec277b0834e402b4174da94d39993aca73f585f497ee07e06db2472b8fdd8f
BLAKE2b-256 checksum
How to use checksums
58e7967bb1259048d7e39b661643b73e50dccdd4cf9229364471be962915e398
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.6

Release files / RPi.GPIO2-0.4.0-py3.10.egg

Download URL RPi.GPIO2-0.4.0-py3.10.egg
Size 57.0 kB
Tags Egg
SHA-256 checksum
How to use checksums
2ca0ae0c03607507c46e3f1ff5028a40cf29b6e56aea5f47c1f225117c563907
BLAKE2b-256 checksum
How to use checksums
3b252028f1caf03d55d852aef6fa6c444c4608be9f7ee6f7159c778f7b2a3cbd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.6

Release history Release notifications | RSS feed

This release

0.4.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page