Failing to troubleshoot nrf24L01 issue

I have tried everything so far to get the Transmitter and Receiver to work, but I am not having any luck. The Rx is simply not picking the message I am sending with the Tx. I reduced my code to extremely simple examples I found on guides to rule out any possibility that is a code issue. I tried swapping out the Tx and Rx for new ones. I reinstalled the library. Reinstalled Arduino. The radio.printDetails() does not print anything in the Serial monitor so that is kind of weird. I am using an Arduino UNO and a ELEGO Uno.
If anyone has any advice on where I should start troubleshooting next I would appreciate it.
Here is my TX code:

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

RF24 radio(7, 8); // CE, CSN

const byte address[6] = "00001";

void setup() {
  Serial.begin(9600);
  radio.begin();
  radio.openWritingPipe(address);
  radio.setPALevel(RF24_PA_MIN);
  radio.stopListening();
}

void loop() {
  const char text[] = "Hello World";
  radio.write(&text, sizeof(text));
  delay(1000);
  Serial.print(text);
  radio.printDetails();
  delay(1000);
}

Here is my Rx code:

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

RF24 radio(7, 8); // CE, CSN

const byte address[6] = "00001";

void setup() {
  Serial.begin(9600);
  radio.begin();
  radio.openReadingPipe(0, address);
  radio.setPALevel(RF24_PA_MIN);
  radio.startListening();
}

void loop() {
  if (radio.available()) {
    char text[32] = "";
    radio.read(&text, sizeof(text));
    Serial.println(text);
    Serial.println("radio available");
    radio.printDetails();
    radio.isChipConnected();
  }
}

Post a link to the NRF24L01 modules you are using.
For some boards and some modules, the standard 10MHz SPI bus speed is too high giving symptoms similar to those you have reported.
I guess @groundfungus will be along shortly with some suggestions to reduce this.
Having said that, insufficient power is usually the cause of the majority of NRF24L01 problems.

Here is the link to the modules:
https://www.amazon.com/gp/product/B00O9O868G/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1

Also I am using a breadboard power supply where a 9V battery is connected and the 3.3V outputs go to the Tx/Rx modules.

This already starts to sound like the typical inadequate power supply problem. Smoke detector type batteries don't supply enough peak power. Can't you use USB as the power source to be reduced to the 3.3 volts necessary for these NRF24L01 modules.
Maybe you also find something in this thread: nRF24L01+ not even getting printDetails();

Here I am with the tips that I have gathered.

If you read and, closely, follow Robin2's simple rf24 tutorial you should be able to get them working. That tutorial sure helped me. The code in the examples has been proven to work many many times. If it does not work for you, there is likely a hardware problem.

Run the CheckConnection.ino (look in reply #30 in the tutorial) to verify the physical wiring between the radio module and its processor (Arduino).

Make sure the rf24 power supply can provide enough current. This is especially true for the high power (external antenna) modules. I use homemade adapters like these. They are powered by 5V and have a 3.3V regulator on the board. Robin2 also has suggested trying with a 2 AA cell battery pack.

If using the high powered radios make sure to separate them by a few meters. They may not work too close together. Try the lower power settings.

Reset the radios by cycling power to them after uploading new code. I have found that to help. They do not reset with the Arduino.

Switch to 1MB data rate to catch the not so cloned clones.
radio.setDataRate( RF24_1MBPS );

This is the change suggested by @6v6gt
Also for some clones, change TMRh20's RF24.cpp line 44
_SPI.setClockDivider(SPI_CLOCK_DIV2);
Into
_SPI.setClockDivider(SPI_CLOCK_DIV4);

Have a look at the common problems page.

Just tried with the USB and nothing has changed. Will look into the thread thank you

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.