nRF24L01+ - LED Remote sketch not working

Hi all,

Second time posting about this issue. I have two arduinos set up with the RF24 library. When I run the pingpair sketch, I get 21-23 ms response every single time, no issues.

But whenever I try led_remote, it doesn't work 99/100 times. I am using the sketch right out of the example, the only thing I change is the button_pins and led_pins (both to "3,6", with corresponding connections to leds or buttons).

If I am lucky, right after I upload the sketch, or after i switch ports to the remote arduino and run the serial monitor, I get 1 button press to change the appropriate LED. Then it just keeps failing to send over and over. Even the above trick with uploading the sketch new, or switching the serial monitor doesn't always get me that one signal.

I have tried multiple pairs of modules, I have tried the cap between GND and VCC. Nothing seems to fix it. I have moved the arduinos very close together and far apart (15+ feet).

Serial Monitor Data - Remote:

RF24/examples/led_remote/

ROLE: Remote

STATUS		 = 0x0e RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=7 TX_FULL=0
RX_ADDR_P0-1	 = 0xe8e8f0f0e1 0xf0f0f0f0e1
RX_ADDR_P2-5	 = 0xc3 0xc4 0xc5 0xc6
TX_ADDR		 = 0xe8e8f0f0e1
RX_PW_P0-6	 = 0x20 0x08 0x00 0x00 0x00 0x00
EN_AA		 = 0x3f
EN_RXADDR	 = 0x03
RF_CH		 = 0x4c
RF_SETUP	         = 0x07
CONFIG               = 0X0C
DYNPD/FEATURE   = 0X00 0X00
Data Rate            = 1MBPS
Model                  = nRF24L01+
CRC Length          = 16 bits
PA Power             = PA_HIGH

Serial Monitor Data - Receiver:

RF24/examples/led_remote/

ROLE: LED Board

STATUS		  = 0x0e RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=7 TX_FULL=0
RX_ADDR_P0-1	  = 0f0f0f0f0e1 0xe8e8f0f0e1
RX_ADDR_P2-5	  = 0xc3 0xc4 0xc5 0xc6
TX_ADDR		  = 0xf0f0f0f0e1
RX_PW_P0-6	  = 0x08 0x20 0x00 0x00 0x00 0x00
EN_AA		  = 0x3f
EN_RXADDR	  = 0x03
RF_CH		  = 0x4c
RF_SETUP	          = 0x07
CONFIG                = 0X0f
DYNPD/FEATURE    = 0X00 0X00
Data Rate             = 1MBPS
Model                  = nRF24L01+
CRC Length           =16 bits
PA Power              = PA_HIGH

Any help at all would be greatly appreciated!

Hi
Which terminal software do you use, this worked straight out the box for me but if memory serves me correctly i had to adjust the CR setup.

Essef 8)

Ps i use BRAYS terminal

In looking over your previous post, I would maybe suggest a combination of things:

  1. Use a larger cap (100-220uF or even a bit larger)
  2. Use another, smaller ceramic cap in-line with the first (100nf or so)
  3. Set the pa power to the minimum: radio.setPALevel(RF24_PA_MIN);
  4. Try at 250kbps and 2mbps: radio.setDataRate(RF24_250KBPS); or radio.setDataRate(RF24_2MBPS);
  5. Power the radio separately with batteries (2AA will work), and connect the GND of the battery to the arduino GND - if this fails, its usually not a power supply issue, but something else like some bad modules, interference, wiring, something something...

Also, 22ms response times suggests either something is wrong, or you are using the original library.

TMRh20:
3. Set the pa power to the minimum: radio.setPALevel(RF24_PA_MIN);

Do I do this in the void setup section? same question for setting the data rate.

TMRh20:
Also, 22ms response times suggests either something is wrong, or you are using the original library.

I probably do have the original, but how would I know for certain? Where would I find the most updated version?

ESSEF:
Hi
Which terminal software do you use

Not sure what you mean re: terminal. I am using the Arduino IDE to do the sketches. Does that answer your question?

TMRh20:
Also, 22ms response times suggests either something is wrong, or you are using the original library.

What should I be looking to get?

The led_remote sketch uses a terminal so you can view/debug what your input/output is doing, compile/upload and when done run the inbuilt serial monitor (terminal) at 57600 baud (speed) to view the data exchanges.

Essef 8)

ESSEF:
The led_remote sketch uses a terminal so you can view/debug what your input/output is doing, compile/upload and when done run the inbuilt serial monitor (terminal) at 57600 baud (speed) to view the data exchanges.

Essef 8)

So that would be the Arduino IDE, correct?

You can use any terminal software really but i find Brays to my liking and very configurable the one you can invoke from the Arduino ide is basic but functional.

Essef :slight_smile:

heres a link

For future reference
The serial window is a great insight into your micro and even if you dont have any serial data exchanges taking place you can place serial print commands at various points in your software in order to ensure your program is running and executing where its meant to or to find faults .(debugging)

Another method is jtag, with this toolset you can watch your code execute including pin changes /register updates etc etc.

Essef :8)

martinwuff:
Do I do this in the void setup section? same question for setting the data rate.

I probably do have the original, but how would I know for certain? Where would I find the most updated version?

Yeah, call this stuff after radio.begin() in the setup section.

Well, I would say the ‘most updated’ version is my fork at https://github.com/TMRh20/RF24/archive/master.zip in which the master branch should always be considered stable, and any issues reported via the github tracking system. Some of the previous RF24 contributors like S.Seow and G.Copeland have also indicated they are using my fork (which is based on their work), as well as the folks over at MySensors.org so that should tell you something.

Response times with the getting started sketch should generally be a couple of milliseconds, and ack-payloads are usually delivered in less than a millisecond. See Testing New RF24 Arduino Library Fork: Comparative Data Transfers - YouTube for examples of transfer rates with radio modules that are working optimally.

TMRh20:
Yeah, call this stuff after radio.begin() in the setup section.

Well, I would say the ‘most updated’ version is my fork at

Sorry for the delay. I finally got a chance to download your fork, but now there is a new issue. Yours doesn’t have the led_remote sketch. So what I did was pull that one out of the maniacbug version and put it into yours, but now I can’t upload the sketch because validation calls out:

done = radio.read( button_states, num_button_pins );

as being “void value not ignored as it ought to be”.

Hi

Edit this line >>>>> done = radio.read( button_states, num_button_pins );
To this >>>>> radio.read( button_states, num_button_pins );

Compiles ok.

Essef :8)