@tableofcontents
Generic Linux devices are supported via SPIDEV, PiGPIO, MRAA, RPi native via BCM2835, or using LittleWire.
@note The SPIDEV option should work with most Linux systems supporting spi userspace device.
Using CMake: (See the instructions using CMake for more information and options)
-
Download the install.sh file from https://github.com/nRF24/.github/blob/main/installer/install.sh
wget https://raw.githubusercontent.com/nRF24/.github/main/installer/install.sh
-
Make it executable
chmod +x install.sh
-
Run it and choose your options
./install.sh
@warning
SPIDEV
is now always selected as the default driver because all other Linux drivers are being removed in the future. See RF24 issue #971 for rationale.It will also ask to install a python package named pyRF24. This is not the same as the traditionally provided python wrappers as the pyRF24 package can be used independent of the C++ installed libraries. For more information on this newer python package, please check out the pyRF24 documentation.
-
Try an example from one of the libraries
cd ~/rf24libs/RF24/examples_linux
Edit the gettingstarted example, to set your pin configuration
nano gettingstarted.cpp
Build the examples. Remember to set the
RF24_DRIVER
option according to the one that was selected during the scripted install.mkdir build && cd build cmake .. -D RF24_DRIVER=SPIDEV make
Run the example
sudo ./gettingstarted
See the instructions using CMake for more information and options
Designed & Tested on RPi - Defaults to SPIDEV on devices supporting it
-
Install prerequisites if there are any (pigpio, MRAA, LittleWire libraries, setup SPI device etc)
-
Download the install.sh file from http://tmrh20.github.io/RF24Installer/RPi/install.sh
wget http://tmrh20.github.io/RF24Installer/RPi/install.sh
-
Make it executable
chmod +x install.sh
-
Run it and choose your options
./install.sh
@warning
SPIDEV
is now always selected as the default driver because all other Linux drivers are being removed in the future. See RF24 issue #971 for rationale. -
Run an example from one of the libraries
cd rf24libs/RF24/examples_linux
Edit the gettingstarted example, to set your pin configuration
nano gettingstarted.cpp make sudo ./gettingstarted
-
Install prerequisites if there are any (pigpio, MRAA, LittleWire libraries, setup SPI device etc) @note See the MRAA documentation for more info on installing MRAA
-
Make a directory to contain the RF24 and possibly RF24Network lib and enter it
mkdir ~/rf24libs cd ~/rf24libs
-
Clone the RF24 repo
git clone https://github.com/tmrh20/RF24.git RF24
-
Change to the new RF24 directory
cd RF24
-
Configure build environment using the command:
./configure
It automatically detects device and build environment.
@warning
SPIDEV
is now always selected as the default driver because all other Linux drivers are being removed in the future. See RF24 issue #971 for rationale.For overriding automatic detections, use command-line arguments, see
./configure --help
for description.
-
Build the library, and run an example file
make sudo make install
cd examples_linux
Edit the gettingstarted example, to set your pin configuration
ano gettingstarted.cpp make sudo ./gettingstarted
- Make sure that spi device support is enabled and /dev/spidev<a>.<b> is present
- Manual Install using SPIDEV:
./configure --driver=SPIDEV make sudo make install
- See the gettingstarted example for an example of pin configuration