Sytone's Ramblings

The occasional posts of a guy who plays with technology.

Setting up a Pi with a NRF24L01+ Radio

2015-10-25 2 min read General

I’m using my PI as the central hub running OpenHAB, a MQTT broker and other services for home automation. On the Pi I am using a NRF24L01+pa+lna SMA Antenna Wireless Transceiver, this provide more range (1000m) from my main unit. All the nodes in the network will be running on Arduino chips and using a Mesh network so the house should have good coverage. First, wiring in the NRF24L01 to the Pi.Using Female-to-Female dupont cables use the following table to connect the units, the NRF24L01 is ~3-3.6V.

Raspberry PI 1 - B+ to NRF24L01 Mapping Table

Raspberry PI 1 - B+

NRF24L01+

 Ground (20)

 GND

 3v3 (17)

 V+

 BCM 8 /CE0 (24)

 CSN

 BCM 22 (15)

 CE

BCM 10 / MOSI (19)

 MOSI

BCM 11 / SCLK (23)

 SCK

 IRQ

BCM 9 / MISO (21)

 MISO

I recommend checking the connections twice. A good Pi Layout can be found here: Raspberry Pi GPIO Layout Worksheet Now we have the wiring in place time to get the pi working. This assume you have followed guides on this site or other site and you are running rasberian. As I am using the awesome work by TMRh20 we are installing the bits in his github repo. Connect to the pi using SSH and run the following commands.

wget http://tmrh20.github.io/RF24Installer/RPi/install.sh chmod +x install.sh ./install.sh for D in *; do echo “Building and Installing $D”; cd “$D”; sudo make install; cd ..; done

After you run the installer.sh file it will prompt you to install components. Go ahead and select yes for all of them. If you ever need to do a update of the libraries in the future you will need to delete all the folders under rf24libs. Now the pi is ready to go with the RF unit and needed libraries.