nRF24L01+ Troubleshooting Notes

Viewed 29 times

I have recently bought two nRF24L01+ radio chips for communication between my Raspberry Pi and Arduino. I will be solely using this from Raspberry towards Arduino. The tutorial I followed: https://circuitdigest.com/microcontroller-projects/wireless-rf-communication-between-arduino-and-raspberry-pi-using-nrf24l01

My problem is: I don’t receive anything. The Raspberry seems to send everything properly (i.e. “H”, “i”, “0”, … etc) Serial output is listed below. Can someone please help me?

The code I am using for Raspberry:

import RPi.GPIO as GPIO
import time
import spidev
from lib_nrf24 import NRF24


pipes = [[0xE0, 0xE0, 0xF1, 0xF1, 0xE0], [0xF1, 0xF1, 0xF0, 0xF0, 0xE0]]

radio = NRF24(GPIO, spidev.SpiDev())




sendMessage = list(" Hi")
while len(sendMessage) < 8:

while True:
    start = time.time()
    print("Sent the message: {}".format(sendMessage))

    while not radio.available(0):
        if time.time() - start > 2:
            print("Timed out.")


The code for my Arduino:

#include<SPI.h>                   // spi library for connecting nrf
#include<RF24.h>                  // nrf library

RF24 radio(9, 10) ;  // ce, csn pins    
void setup() {
  Serial.begin(9600) ;     // start serial monitor baud rate
  Serial.println("Starting.. Setting Up.. Radio on..") ; // debug message
  radio.begin();        // start radio at ce csn pin 9 and 10
  radio.setPALevel(RF24_PA_MIN) ;   // set power level
  radio.setChannel(0x76) ;            // set chanel at 76
  const uint64_t pipe = 0xE0E0F1F1E0LL ;    // pipe address same as sender i.e. raspberry pi
  radio.openReadingPipe(1, pipe) ;        // start reading pipe 
  radio.enableDynamicPayloads() ;
  radio.powerUp() ;          

void loop() {

  radio.startListening() ;        // start listening forever
  char receivedMessage[8] = {0} ;   // set incmng message for 32 bytes
  if (radio.available()) {       // check if message is coming
    radio.read(receivedMessage, sizeof(receivedMessage));    // read the message and save
    Serial.println(receivedMessage) ;    // print message on serial monitor 
    Serial.println("Turning off the radio.") ;   // print message on serial monitor
    radio.stopListening() ;   // stop listening radio
    String stringMessage(receivedMessage) ;     // change char to string
    delay(1000);    // delay of 1 second 
    Serial.print(stringMessage);   // print received mesage

Output: just a loop of

Turning off the radio.

Turning off the radio.

Turning off the radio.

I have checked my wiring three times over…

  • Figured my Arduino gives that output even while the Raspberry is turned off… – StevenCellist yesterday
  • Also figured that my wireless mouse and keyboard might be interfering but unplugging and turning off those didn’t make any difference – StevenCellist yesterday
  • Hi @StevenCellist, Welcome and nice to meet you. Ah, let me see. If Arduino gives same output even Rpi is turned off, then Arduino is not receiving anything or just rubbish from Rpi, and so the problem is perhaps on the Rpi side. Let us start doing troubleshooting the Rpi side: (1) Make sure the SPI software and hardware wiring is OK, by doing SPI loop back. (2) Make sure nRF24L01 is working, by pinging, ie, read config register 0x00 should read 0x80. Of course you can skip (1) and just do (2) If you read 0x80 from nRF24L01’s register 0x00, then SPI is OK. / to continue, … – tlfong01 19 hours ago
  • (3) Read the tutorial “Wireless RF Communication using nRF24L01 Module -Abhiemanyu Pandit 2019aug01, circuitdigest.com/microcontroller-projects/…, (4) Run the tutorial’s python program for Rpi. The statement “radio.printDetails()” should print the “details” does it? – tlfong01 19 hours ago
  • References: (1) nrf24l01 Features – components101 components101.com/wireless/nrf24l01-pinout-features-datasheet (2) nRF24L01+ Single Chip 2.4GHz Transceiver Product Specification v1.0 – Nordic 2008 components101.com/sites/default/files/component_datasheet/… – tlfong01 19 hours ago
  • Ref (1) says the following: “The nRF24L01 module is a bit tricky to use especially since there are many cloned versions in the market. If you are having any problem with getting it work, try adding a 10uF and 0.1uF capacitor in parallel to the Vcc and Ground pins. Also make sure the 3.3V supply is clean and does not have any noise coupled in it.” – tlfong01 19 hours ago
  • Then read the GitHub for the bad news: only for “virtual GPIO”, no longer supported. nRF24L01 Python Library – BLavery/lib_nrf24 2018 may V0.3 beta, no longer being maintained by the original author github.com/BLavery/lib_nrf24 For Raspberry Pi and virtual-GPIO. NRF24: strictly 3.3V supply!! Although logic pins are 5V tolerant. – tlfong01 19 hours ago
  • Docs says the following: “This is BETA only so far. Everything has worked earlier, send, receive, including two RF24 on one host, and including RPI, virtual-GPIO and regular arduino sketch, all talking to each other. But recent testing has been only LIBRARY plus “example-nrf24-pair.py” on virtual-GPIO, so other parts are yet to be re-verified.” – tlfong01 19 hours ago
  • # StevenCellist, So are you using “Virtual GPIO”? Have you found any updated program NOT using virtual GPIO? The Rpi python program looks not that hard. Perhaps you can rewrite it not using virtual GPIO. PS – I NEVER heard of “virtual GPIO”, so I asked. – tlfong01 19 hours ago
  • I visited GiHub and found it was 5 years old, tweaked from the BegaBone program. So I don’t think it worth your time playing with a Non rpi hardware compatible, tweaked program and NO LONGER supported. Find an updated Rpi program and let me know. Thanks and cheers. – tlfong01 19 hours ago
  • Just now I searched this forum for “nRF24L01” and found 100+ posts. I skimmed and found the follow best for troubleshooting: “Major trouble with nRF24L01+ controllers and the RF24 library – Asked 5 years ago Viewed 8k times” (1) raspberrypi.stackexchange.com/questions/23441/…. Many of the 100+ posts above had not answers, but this very good one by @jhallard summarized the causes of trouble and also gave a good recommendation for testing. – tlfong01 1 hour ago
  • As I said earlier, I have done the following last evening: (1) Used SPI loop back test to make sure that SPI wiring is working, (2) Use a one line python statement to read the nRF24L01’s config register at address 0x00 and read successfully the default POR contents of 0x80. Next step is to try any tutorial but NOT your recommended one, for the reasons I gave above. In case you read the the above post @jhallardand and wish to try another tutorial recommend there, and still have problem,s I am happy to reproduce your setup, and see if I overlooked any other causes of trouble. Cheers. – tlfong01 1 hour ago
  • If you read the 100+ old posts on nRF25L01, you might find there a couple of traps for newbies, including the following: (1) If you started your project with 5V Arduino and any Arduino compatible nRF24 modules, you might forget that Rpi is 3V3 only and power for Rpi is indeed 5V, but be WARNED that the nRF24 module for Rpi (but not for Arduino) might not have any 5V to 3V3 step down regulator, so you MUST use 3V3 power for the module, otherwise your nRF24 might FRY IMMEDIATELY! – tlfong01 30 mins ago
  • (This is the reason I suggest you to loopback test SPI and ping (read nRF24 config register to make sure your nRF24 is not fried). (2) As pointed out earlier, there are quite a lot of different nRF25 modules on the market, some have 8 Bit connector, some 12 bit, mine tested OK for Rpi4B has 9 pins, including the antenna pin!, So you to very carefully compare and contrast the version you have to make sure you have wired correctly, beside using 0.1uF, 1/10uF to bypass the power supply fi your nRF is a low quality one without any regulator or bypass/decoupling caps. – tlfong01 26 mins ago
  • Your module, if cheapy module from eBay might not have the necessary pull up resistors on module. For example, the interrupt pin or select module send/or receive mode, if no default pull up/downs, left floating, might be wrongly set to receive mode, instead of send mode which is what you want. Otherwise your nRF might not send, even your program is correct. (3) Some modules have confusing labels CEn, CSn, selectCE etc which might be Arduino friendly, but mislead you to wrongly use the hardwired nrF sen/receive mode pin for the SPI chip slect pin. – tlfong01 20 mins ago
  • You might like to show us a picture of you module showing the SPI and send/receive mode pin and interrupt pin wiring, and I can compare your wiring with mine ( pin version) which has been tested OK. Cheers. – tlfong01 18 mins ago
  • One more thing. I noticed that your question says you are using the “Plus Model” (nrf24L01+, with the “+’ at the end. If you are using the following + model, then you need to be very careful: “NRF24L01+ 2.4G ATMEGA48 wireless data transmission module + NRF24L01 arduino compatible US$3.50” fr.aliexpress.com/item/1976744557.html. ANOTHER WARNING: The module power supply is 5V, but there is NO wrong polarity protection, meaning that if you supply power with the wrong polarity, the module will get very hot and might fry the module in a minute. – tlfong01 1 min ago   Edit

Categories: Uncategorized

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: