rpi-rf-gpiod
Modern 433 MHz RF library for Raspberry Pi using gpiod — works on Pi 3B, 4, and 5.
Drop-in replacement for rpi-rf with:
- ✅ Pi 5 support (RP1 chip,
/dev/gpiochip4) - ✅ Kernel 6.12+ compatible (gpiod edge detection works where lgpio/RPi.GPIO don't)
- ✅ Interrupt-based RX (kernel edge events with nanosecond timestamps, ~0% CPU idle)
- ✅ No GIL contention between TX and RX
- ✅ No daemon required (unlike pigpio)
Installation
pip install rpi-rf-gpiod
Prerequisites: gpiod Python bindings (usually pre-installed on Raspberry Pi OS Bookworm):
sudo apt install python3-libgpiod
Quick Start
Send a code
from rpi_rf_gpiod import RFTransmitter
with RFTransmitter(gpio=17) as tx:
tx.send(code=4539729, protocol=1, repeat=10)
Receive codes
from rpi_rf_gpiod import RFReceiver
def on_code(code, protocol, pulselength):
print(f"Received: {code} (proto={protocol}, pl={pulselength}µs)")
with RFReceiver(gpio=16, callback=on_code) as rx:
import time
while True:
time.sleep(1)
CLI Tools
# Send
rf_send 4539729 --gpio 17 --protocol 1 --repeat 10
# Receive
rf_receive --gpio 16
API Reference
RFTransmitter(gpio=17, chip=None)
| Method | Description |
|---|---|
enable() |
Open GPIO and claim pin as output |
disable() |
Release GPIO resources |
send(code, protocol=1, pulselength=None, repeat=10, length=24) |
Transmit an RF code |
RFReceiver(gpio=16, chip=None, callback=None)
| Method | Description |
|---|---|
enable() |
Start edge detection |
disable() |
Stop and release GPIO |
register_callback(cb) |
Add a (code, proto, pl) -> None callback |
unregister_callback(cb) |
Remove a callback |
set_tx_guard(duration=1.0) |
Ignore codes for N seconds (anti self-reception) |
clear_tx_guard(cooldown=0.5) |
Resume receiving after TX |
start_capture() |
Begin buffering codes (for learn mode) |
stop_capture() |
Stop and return buffered [(code, proto, pl), ...] |
get_capture_snapshot() |
Get buffer copy without stopping |
Supported Protocols
| # | Pulse (µs) | Typical Use |
|---|---|---|
| 1 | 350 | PT2262, most common outlets |
| 2 | 650 | — |
| 3 | 100 | — |
| 4 | 380 | — |
| 5 | 500 | — |
| 6 | 200 | HT6P20B |
Why not rpi-rf?
| Feature | rpi-rf | rpi-rf-gpiod |
|---|---|---|
| GPIO backend | RPi.GPIO (unmaintained) | gpiod (active, kernel-supported) |
| Pi 5 | ❌ | ✅ |
| RX method | GPIO.add_event_detect (broken 6.12+) | gpiod edge events (works on 6.12+) |
| CPU usage (RX idle) | ~15% (polling workaround) | ~0% |
| GIL contention | Yes (TX vs RX fight for GIL) | No (edge events are lightweight) |
Why gpiod over lgpio?
Both lgpio and RPi.GPIO edge detection are broken on kernel 6.12+. We tested all available GPIO libraries on a Pi 1B+ with kernel 6.12.47:
| Library | Edge Detection |
|---|---|
| lgpio 0.2.2 | ❌ Broken |
| RPi.GPIO | ❌ Broken |
| gpiod 2.2 | ✅ Works |
| gpiozero 2.0 | ✅ Works (uses gpiod internally) |
| pigpio | ✅ Works (requires daemon) |
Hardware
Connect a 433 MHz transmitter/receiver module:
TX Module: RX Module:
VCC → 5V VCC → 5V
GND → GND GND → GND
DATA → GPIO 17 DATA → GPIO 16
(+ antenna) (+ antenna)
License
BSD 3-Clause. Based on protocol definitions from rc-switch and rpi-rf.
Metadata
Release files for rpi-rf-gpiod2 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| rpi_rf_gpiod2-1.0.1.tar.gz | 11.2 kB | Without provenance | Details for rpi_rf_gpiod2-1.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| rpi_rf_gpiod2-1.0.1-py3-none-any.whl | Python 3 | none | any | Details for rpi_rf_gpiod2-1.0.1-py3-none-any.whl |
Total release size: 22.7 kB
Release files / rpi_rf_gpiod2-1.0.1.tar.gz
| Download URL | rpi_rf_gpiod2-1.0.1.tar.gz |
|---|---|
| Size | 11.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ba3576776e47f3f6e31b4228a4320398696fd53e69ddeb623054316cb00dbf41
|
|
BLAKE2b-256 checksum How to use checksums |
39d827ccd3839339ca3f74fa608ca955e8f882470eb668ddf805d0e72421d38d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.4
|
Release files / rpi_rf_gpiod2-1.0.1-py3-none-any.whl
| Download URL | rpi_rf_gpiod2-1.0.1-py3-none-any.whl |
|---|---|
| Size | 11.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
556fe662fb3cad93f3315a7e75160d75db6d9cb822db29c94227fa94a6785e9d
|
|
BLAKE2b-256 checksum How to use checksums |
367a3b66582c4705b96e9199af9f2f0a17f895920e8dfa310f267ba0e00406d9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.4
|
Security for rpi-rf-gpiod2 1.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.