NRF24L01 Module Not Responding - No Output on PrintDetails() or Serial Monitor

Hello Arduino Community,

I’m working on a project involving two Arduino Nanos with nRF24L01 modules for wireless communication. Unfortunately, I’m encountering an issue where the modules aren't responding as expected, and I need some guidance to troubleshoot.

Problem:

Messages I send using the example code from the RF24 library are not being received by the receiver.

Most concerning, when I run the code to print the module details (radio.printDetails()), I get no output at all on the serial monitor. It seems like the module isn’t being initialized properly or there’s a communication issue. Here's what I see on the serial monitor when running the following code:

#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>

#define CE_PIN 9
#define CSN_PIN 10

RF24 radio(CE_PIN, CSN_PIN);

void setup() {
  Serial.begin(115200);
  while (!Serial);

  // Initialize the NRF24L01 module
  if (!radio.begin()) {
    Serial.println("NRF24L01 module initialization failed.");
    while (1); // Stay here forever if initialization fails
  }

  Serial.println("NRF24L01 module initialized successfully.");

  // Use printDetails() to print module configuration
  Serial.println("Module configuration details:");
  radio.printDetails();
}

void loop() {

}
NRF24L01 module initialized successfully.
Module configuration details:

I don't see any additional information after this message, which makes me believe that the module isn’t responding to SPI or there's a hardware-related issue.

What I've Tried:

  • Double and triple-checked the code and wiring.
  • Replaced the RF24 modules.
  • Bought adapters for the modules to rule out power issues and checked the power output of the adapters (stable 3.3V).
  • Reinstalled the RF24 library.

Unfortunately, none of these have resolved the issue.

here is a picture of my setup if that helps:


Has anyone encountered this problem before? Or does anyone have suggestions for further diagnostics? My best guess is that the issue may be hardware-related with the Arduino Nano (it’s a non-original board).

Thanks in advance for your help!

At that point I would create a local copy of the library cpp file and throw in some serial.println statements (or equivalent cout) in order to see where it breaks. Does the radio.printDetails() have a return code?

Thanks, I have added a lot of print statements and found that the printDetails() function gets called and no error occurs, but it uses printf_P(), which doesn't work. With some help from ChatGPT, I think I found the problem: the buffer that printf_P() uses is broken. This is probably because the SPI communication with the cheap Arduino Nano boards i use doesn't work correctly. I am going to buy better boards and hopefully it works.

Try this code, it is a modified version of yours, my changes are flagged with RCA.


#include <SPI.h>
//RCA #include <nRF24L01.h>
#include <RF24.h>
#include <printf.h> //RCA

#define CE_PIN 9
#define CSN_PIN 10

RF24 radio(CE_PIN, CSN_PIN);

void setup() {
  Serial.begin(115200);
  while (!Serial)
    ;

  // Initialize the NRF24L01 module
  if (!radio.begin()) {
    Serial.println("NRF24L01 module initialization failed.");
    while (1)
      ;  // Stay here forever if initialization fails
  }

  printf_begin();   //RCA

  Serial.println("NRF24L01 module initialized successfully.");

  // Use printDetails() to print module configuration
  Serial.println("Module configuration details:");
  radio.printDetails();
}

void loop() {
}
1 Like

Interesting blaming the unknown! Which Nano are you using? The term "Nano" now often refers to a form factor rather than the specific processor it contains.

Regarding SPI, what mode are you using? There are four SPI modes, origionally specified by Motorola and defined by two parameters:

  • Clock Polarity (CPOL): Determines the idle state of the clock (high or low).
  • Clock Phase (CPHA): Determines when data is sampled (leading or trailing edge).

These two parameters combine to create the following four modes:

  • Mode 0: CPOL = 0, CPHA = 0
  • Mode 1: CPOL = 0, CPHA = 1
  • Mode 2: CPOL = 1, CPHA = 0
  • Mode 3: CPOL = 1, CPHA = 1

The correct mode to use depends on the specific SPI device you are communicating with. Always refer to the device’s datasheet to ensure the settings match its requirements.

Power Stability Issues with RF24 Radio Modules

As described in the RF24 Common Issues Guide, radio modules, especially the PA+LNA versions, are highly reliant on a stable power source. The 3.3V output from Arduino is not stable enough for these modules in many applications. While they may work with an inadequate power supply, you may experience lost packets or reduced reception compared to modules powered by a more stable source.

Symptoms of Power Issues:

  • Radio module performance may improve when touched, indicating power stability issues.
  • These issues are often caused by the absence of a capacitor, a common cost-saving omission by some manufacturers.

Temporary Patch :

  • Add Capacitors: Place capacitors close to the VCC and GND pins of the radio module. A 10uF capacitor is usually sufficient, but the exact value can depend on your circuit layout.
  • Use Low ESR Capacitors: Capacitors with low Equivalent Series Resistance (ESR) are recommended, as they provide better power stability and performance.

Adding the appropriate capacitors can greatly improve the reliability of your RF24 module by ensuring a stable power supply, thus minimizing packet loss and enhancing overall performance. A separate power supply for the radios is the best solution.

There is no link to the part being used so I took a SWAG:
nRF24L01 Features
2.4GHz RF transceiver Module
Operating Voltage: 3.3V
Nominal current: 50mA
Range : 50 – 200 feet
Operating current: 250mA (maximum)
Communication Protocol: SPI
Baud Rate: 250 kbps - 2 Mbps.
Channel Range: 125
Maximum Pipelines/node : 6
Low cost wireless solution:

It's not the board directly, show me what board you have selected in the IDE.

I think the code that follows is a clue. Certain settings have to be set so that the Serial port is used as there is no stdio in arduino land. This is a small screengrab, there are many more. We need to know how the board presents itself.

Here is the included troubleshooting advice.
COMMON_ISSUES.txt (10.8 KB)

Hi, @sim6656
Welcome to the forum.

Thanks for using code tags. :+1:
Thanks for the image;

I see you are using the plus version of the module.
These have a higher power than the usual smaller modules.

One problem apart from power supply, is that they are too close to each other, and may be overloading each receiver when the other transmits.

The fact that although they are not electrically connected, but share the same protoboard could also produce some problems.

Try placing them about 1m or more apart.

Tom.. :smiley: :+1: :coffee: :australia:

1 Like

Hello sim6656

Welcome to the world's best Arduino forum ever.

I have been following the topic of using this type of wireless module and the associated software functions for some time now.

For wireless projects, I recommend using the HC12 module.

What are the advantages:

  1. no external functions from a library are needed.
  2. the development of a communication protocol is in your hands
  3. the necessary development steps can be programmed and tested without using the wireless module
  4. the radio module can be easily configured for the project requirements
  5. both transmitter and receiver are contained in one radio module.

hth

Have a nice day and enjoy coding in C++.


Your modified version worked!
I added printf_begin(); before calling printDetails and it works now,
this is the output I get for both modules:

NRF24L01 module initialized successfully.

Module configuration details:

SPI Speedz = 10 Mhz

STATUS = 0x0e RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=7 TX_FULL=0

RX_ADDR_P0-1 = 0x3130303030 0xc2c2c2c2c2

RX_ADDR_P2-5 = 0xc3 0xc4 0xc5 0xc6

TX_ADDR = 0x3130303030

RX_PW_P0-6 = 0x20 0x20 0x20 0x20 0x20 0x20

EN_AA = 0x3f

EN_RXADDR = 0x03

RF_CH = 0x4c

RF_SETUP = 0x03

CONFIG = 0x0e

DYNPD/FEATURE = 0x00 0x00

Data Rate = 1 MBPS

Model = nRF24L01+

CRC Length = 16 bits

PA Power = PA_LOW

ARC = 15

Does this output look normal, or does it help identify the problem?

i have a board like this with CH340 Chip and USB-C Connector,
i selected Arduino Nano in the IDE.

Be sure to mark my post #4 re printf as the solution then so others will know.

ok but the communication doesnt work jet does the output look normal?

@sim6656 ,

Your other topic on the same subject deleted.

Please do not duplicate your questions as doing so wastes the time and effort of the volunteers trying to help you as they are then answering the same thing in different places.

Please create one topic only for your question and choose the forum category carefully. If you have multiple questions about the same project then please ask your questions in the one topic as the answers to one question provide useful context for the others, and also you won’t have to keep explaining your project repeatedly.

Repeated duplicate posting could result in a temporary or permanent ban from the forum.

Could you take a few moments to Learn How To Use The Forum

It will help you get the best out of the forum in the future.

Thank you.

Thank you for the clarification. I completely understand the reasoning behind maintaining a single topic for a project.

I considered the previous topic to be "resolved" since the issue with the printDetails function was successfully addressed, and since that was the main focus of my original question I marked it as solved, but I believed the two issues were related and fixing printDetails would help solve the communication problem. Unfortunately, that turned out not to be the case, and the output from printDetails did not provide the insight I was hoping for.

I also wasn’t sure if anyone would revisit the old topic to help me further, as it was marked resolved. That’s why I decided to create a new topic specifically about the communication issue. I now understand the forum rules better and will keep everything in one topic moving forward.

What should I do now to get further help with the communication issue? Should I add a new post to the original topic to explain the current status of my problem?

Thank you for your guidance.

Add your new questions here. At least one of the people who has already helped you is still watching, well, I assume they are as they flagged the duplicate.

If you really think a separate topic is needed then at least start it with a reference and a link to this one and some thanks for the help you have already had.