Platform independent driver for the NRF24L01(+) complient with ANSI C99. Tested on the ESP32 using ESP-IDF release/v4.3
Driver documentation generated by Doxygen is available here
Documentation health is updated on commit:
To my knowledge, a platform-independent driver for the NRF24L01(+) is not available although there are plenty of samples on Arduino. Based on code provided at https://github.com/elmot/nrf24l01-lib and https://github.com/LonelyWolf/stm32/tree/master/nrf24l01
Install all the vsCode extensions specified in the .vscode/extensions.json
file
Install CppCheck
- Windows: Use Chocolatey by running
choco install cppcheck
To successfully run the build script the runner needs 'build-essential' installed. Since this dependency cannot be installed from the action due to the lack of root permissions, run following command from SSH: sudo apt-get install build-essential -y
Additionally, the GPIO controller is not available from userspace
By default on the Raspberry Pi the SPI and GPIO controllers are not available from userspace.
The author of the bcm2835 library recommends using LibCap
if the program needs to run without root. See the section called
Running as root
within the Documentation.
Unfortunately this method will not persist across rebuilds and the project needed to be completely rebuilt on each invokation of the CI pipeline.
- Create a new group for SPI access
sudo groupadd spi
- Identify the name of the spi controllers
ls /dev | grep spi
- Transfer ownership of the SPI controllers to the new spi group
sudo chown :spi /dev/spidev0.0 sudo chown :spi /dev/spidev0.1
- Add read/write permissions to the SPI controllers
sudo chmod g+rw /dev/spidev0.0 sudo chmod g+rw /dev/spidev0.1
- Add the user which owns the github runner process to the spi group
sudo usermod -aG spi jared
- Create a new group for GPIO access
sudo groupadd gpio
- Transfer ownership of the GPIO controller to the new gpio group
sudo chown :gpio /dev/gpiomem
- Add read/write permissions to the GPIO controller
sudo chmod g+rw /dev/gpiomem
- Add the user which owns the github runner process to the gpio group
sudo usermod -aG gpio <username>
Likely the above changes will not persist a reboot. The solution is to create additional udev
rules which will run on boot.
- Change to the
udev
rules directorycd /etc/udev/rules.d
- Create a new file
vi local.rules
- Add the rules
ACTION=="add", KERNEL=="gpio*", MODE="0660", OWNER="root", GROUP="gpio" ACTION=="add", KERNEL=="mem", MODE="0660", OWNER="root", GROUP="gpio" ACTION=="add", KERNEL=="spidev0.0", MODE="0660", OWNER="root", GROUP="spi" ACTION=="add", KERNEL=="spidev0.1", MODE="0660", OWNER="root", GROUP="spi"