This is the official home of the python wrappers for the RF24 stack. It is meant for Linux-based SoC boards like the Raspberry Pi.
Warning
This repo is currently under construction and does not provide any actual working code yet.
The nRF24L01's CE and IRQ pins can be connected to other GPIO pins on the SoC. The MISO, MOSI, SCK are limited to the corresponding counterparts on the SoC's SPI bus. The CSN pin is limited to the chosen SPI bus's "Chip Select" options (Also labeled as "CE" pins on many Raspberry Pi pinout diagrams). The following table shows the default pins used in all the examples for this package.
nRF24L01 | Raspberry Pi |
---|---|
GND | GND |
VCC | 3V |
CE | GPIO22 |
CSN | GPIO8 (CE0) |
SCK | GPIO11 (SCK) |
MOSI | GPIO10 (MOSI) |
MISO | GPIO9 (MISO) |
IRQ | GPIO12 |
The IRQ pin is not typically connected, and it is only used in the interrupt_configure example.
Warning
If connecting a nRF24L01+PA+LNA module to the Raspberry Pi, you MUST use a external 3V power supply because the Raspberry Pi (all models) do not provide enough power for the nRF24L01+PA+LNA modules.
Important
It is highly recommended that the nRF24L01's VCC and GND pins have a parallel capacitor to stablize the power supply. Usually 100 microfarad is enough, but the capacitance ultimately depends on the nature of your power supply's stability.
To build this python package locally, you need to have boost.python installed.
sudo apt install libboost-python-dev
Make sure that the following dependencies are also installed (sometimes the OS comes with these included). Notice that RPi.GPIO (for python) is used to manage the GPIO pins on the Raspberry Pi.
sudo apt install python3-dev python3-setuptools python3-rpi.gpio
Before submitting contributions, you should make sure that any documentation changes builds successfully. This can be done locally.
This package's documentation is built with the python package Sphinx and the readthedocs theme for sphinx.
pip3 install Sphinx sphinx-rtd-theme
Important
If pip outputs a warning about your path/to/Python/Python3x/Scripts
folder not
added to your OS environment variable PATH
, then you will likely get an error message like
sphinx-build command not found
when building the documentation. For more information on
installing sphinx, see the
official Sphinx install instructions.
To build the documentation locally:
cd docs
sphinx-build -E -W . _build
The docs/_build
folder should now contain the html files that would be hosted on deployment.
Direct your internet browser to the html files in this folder to make sure your changes have been
rendered correctly.
Note
The flags -E
and -W
will ensure the docs fail to build on any error or warning
(just like it does when deploying the docs online).