[SOLVED] Problem with NRF24L01+

Hello,

I'm trying to comunicate an Arduino UNO and an Arduino pro mini with two NRF24L01+ modules using the RF24 library GitHub - maniacbug/RF24: Arduino driver for nRF24L01 and the GetingStarted example RF24: GettingStarted.pde.

The connexions I'm using in both arduinos are:

RF24 Arduino
GND GND
3V3 3V3
CE 9
CSN 10
SCK 13
MOSI 11
MISO 12

When I load the sketch in the arduino pro mini I get at serial monitor:

RF24/examples/GettingStarted/

ROLE: Pong back

*** PRESS 'T' to begin transmitting to the other node

STATUS = 0x0e RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=7 TX_FULL=0
RX_ADDR_P0-1 = 0xf0f0f0f0e1 0xf0f0f0f0d2
RX_ADDR_P2-5 = 0xc3 0xc4 0xc5 0xc6
TX_ADDR = 0xf0f0f0f0e1
RX_PW_P0-6 = 0x20 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

And as follows from the Arduino UNO:

STATUS = 0x0e RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=7 TX_FULL=0
RX_ADDR_P0-1 = 0xe7e7e7e7e7 0xf0f0f0f0d2
RX_ADDR_P2-5 = 0xc3 0xc4 0xc5 0xc6
TX_ADDR = 0xe7e7e7e7e7
RX_PW_P0-6 = 0x00 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

When I start transmiting from one of the nodes only shows:

Now sending 269445...failed.

Failed, response timed out.

Now sending 270718...failed.

Failed, response timed out.

Now sending 271991...failed.

Failed, response timed out.

Now sending 273264...failed.

So I'm not being able to make it work, does anyone know what could I be doing wrong?

Many thanks!!

I remember reading the getting started stuff, it self, had an issue or two. I don't recall the details. I believe you did discover one of them, which was the addresses are not correct.

I would encourage you to start with RF24/examples/pingpair.pde. The example has a "role pin", which is pin 7. Verify the pin in the code you have there. On one of the two units, simply ground that pin.

As a side note, I'm encouraging RF24 users to use my fork of the library. It fixes a couple of issues and adds new features. I also have some articles on my blog on how to maximize your RF24 experience, regardless of which fork you use. If you're interested in my fork, you can find a blog post and link on my blog.

Hello gerg,

Many thanks for your answer, I changed de addresses but still not working.

I followed your advice and I'm trying the pingpair example (I also downloaded the RF24 library refered ir your blog) and from one serial I'm geting as follows:

Now sending 52402...Failed, response timed out.

Timeout duration: 23

Now sending 53428...Failed, response timed out.

Timeout duration: 23

Now sending 54454...Failed, response timed out.

Timeout duration: 23

And from the other one:

Sent response 0

Sent response 0

Sent response 87

Sent response 0

The addresses seem to be ok this time, I don't know what can I be doing wrong, any suggestions?

Thanks again!

Please provide the printDetails() output.

Normally when things don't work, its a wiring issue. Valid printDetails output is usually a good indicator the wiring is correct. Also, the output allows us to verify the configurations are the same.

Sure! Here it is what I've got from the serial:

RF24/examples/pingpair/
ROLE: Ping out
STATUS = 0x0e RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=7 TX_FULL=0
RX_ADDR_P0-1 = 0xf0f0f0f0e1 0xf0f0f0f0d2
RX_ADDR_P2-5 = 0xc3 0xc4 0xc5 0xc6
TX_ADDR = 0xf0f0f0f0e1
RX_PW_P0-6 = 0x20 0x20 0x00 0x00 0x00 0x00
EN_AA = 0x3f
EN_RXADDR = 0x03
RF_CH = 0x4c
RF_SETUP = 0x07
CONFIG = 0x0f
DYNPD/FEATURE = 0x3f 0x04
Data Rate = 1MBPS
Model = nRF24L01+
CRC Length = 16 bits
PA Power = PA_MAX

RF24/examples/pingpair/
ROLE: Pong back
STATUS = 0x0e RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=7 TX_FULL=0
RX_ADDR_P0-1 = 0xf0f0f0f0d2 0xf0f0f0f0e1
RX_ADDR_P2-5 = 0xc3 0xc4 0xc5 0xc6
TX_ADDR = 0xf0f0f0f0d2
RX_PW_P0-6 = 0x20 0x20 0x00 0x00 0x00 0x00
EN_AA = 0x3f
EN_RXADDR = 0x03
RF_CH = 0x4c
RF_SETUP = 0x07
CONFIG = 0x0f
DYNPD/FEATURE = 0x3f 0x04
Data Rate = 1MBPS
Model = nRF24L01+
CRC Length = 16 bits
PA Power = PA_MAX

I think connexions are right, maybe too long wires can cause its malfunction?

Thanks!

Hmmm... Same channels. Opposite pipe addresses. Same AA and setup. Ping and pong roles look okay. That all looks good.

By any chance, are these the long range radios? If, I've encountered problems with two LR radios in use. The fix was to turn down the PA setting on both radios.

If this still fails, try the scanner application. It will allow you to check for a clear channel and confirm the RX side of things can actually detect signal. Not to mention, it confirms bidirectional communication...though I believe the printDetails already gives a thumbs up there.

Hello,

I'm not using long range radios, anyway I've checked the PA setting and was down.

I tried the scanner and have got the following response from de pro mini:

008 (2408Mhz): 05 - *****
009 (2409Mhz): 05 - *****
010 (2410Mhz): 10 - **********
011 (2411Mhz): 03 - ***
012 (2412Mhz): 03 - ***
013 (2413Mhz): 03 - ***
038 (2438Mhz): 03 - ***
039 (2439Mhz): 02 - **
042 (2442Mhz): 05 - *****
043 (2443Mhz): 08 - ********
044 (2444Mhz): 09 - *********
045 (2445Mhz): 16 - ****************
046 (2446Mhz): 03 - ***
051 (2451Mhz): 05 - *****
054 (2454Mhz): 04 - ****
062 (2462Mhz): 05 - *****
063 (2463Mhz): 06 - ******
064 (2464Mhz): 04 - ****
066 (2466Mhz): 02 - **
068 (2468Mhz): 12 - ************
069 (2469Mhz): 13 - *************

And from the UNO:

034 (2434Mhz): 06 - ******
035 (2435Mhz): 10 - **********
036 (2436Mhz): 06 - ******
044 (2444Mhz): 05 - *****
046 (2446Mhz): 03 - ***
054 (2454Mhz): 02 - **
056 (2456Mhz): 03 - ***
057 (2457Mhz): 03 - ***
058 (2458Mhz): 10 - **********
059 (2459Mhz): 08 - ********
060 (2460Mhz): 05 - *****
064 (2464Mhz): 03 - ***

Yesterday I tried the scanner and was showing much more channels, anyway something weird happens when I switch which board is ping and which one is pong:

When the pro mini is at ping mode, reading the pong from the arduino UNO serial shows "Sent response 0 constantly, sometimes Sent respone and a bunch of numbers" which as far as I understand the code, means that the UNO is getting something at the RX and it's giving an answer. But when UNO is as ping mode, it doesn't show that response from the pro mini serial working as pong, it actually only shows the configuration and there it stops. Is perhaps a problem with the Arduino UNO TX?

Thanks! I feel like it's getting close to find out whats wrong :slight_smile:

That looks like you should be able to receive. The next thing I would try is a small electrolytic capacitor on your 3v3 source. Say something along the lines of 10uF - 47uF; between vcc and gnd. I know some mega2560s require this because the 3v3 regulator stinks. Especially if using a LR radio. Mine requires this. Without it, TX is unreliable on the SR units and almost impossible with a LR radio. For paranoia's sake, you might also consider a 10pF decoupling capacitor.

Thanks!! That solved it :slight_smile:

Just with 2 10uF between Vcc and GND of each board and everything is working perfectly.

Sent response 12442
Sent response 13565
Sent response 14689
Sent response 15811
Sent response 16934
Sent response 18058
Sent response 19180
Sent response 20302
Sent response 21426
Sent response 22548
Sent response 23670
Sent response 24794
Sent response 25917
Sent response 27039
Sent response 28163
Sent response 29286
Sent response 30408
Sent response 31532
Sent response 32655
Sent response 33777

Now sending 329170...Got response 329170, round-trip delay: 7
Now sending 330177...Got response 330177, round-trip delay: 5
Now sending 331184...Got response 331184, round-trip delay: 5
Now sending 332189...Got response 332189, round-trip delay: 6
Nos sending 333196...Got response 333196, round-trip delay: 6
Now sending 334202...Got response 334202, round-trip delay: 7
Now sending 335209...Got response 335209, round-trip delay: 5
Now sending 336216...Got response 336216, round-trip delay: 5
Now sending 337221...Got response 337221, round-trip delay: 6
Now sending 338228...Got response 338228, round-trip delay: 6
Now sending 339234...Got response 339234, round-trip delay: 6

Many thanks again Greg, I really appreciate your help!

Good news! Appreciate the update.

Since that did make such a big difference, I encourage you to add some additional caps to filter your power. If not on the breadboard, definitely for your project.

Just with 2 10uF between Vcc and GND of each board and everything is working perfectly.

I notice many people had this issue too...

I had many different types of nRF24L01+ radio and never once had this issue ...
perhaps I shd wire a 10nF into my breadboard nRF adapter ...

Of coz most of my 3V3 power supply source are from the UNO and regulated power supply...

Some voltage regulators are noisier than others.

If you read some of the older threads on this issue, you'll find a common theme is a reminder for proper engineering principles. Many of us hobbyists tend to take this for granted, especially since things tend to work for us on a breadboard. But that doesn't mean spurious issues won't occur. Worse, many blame, for example, the radio module when the problem is squarely between the keyboard and chair.

Proper engineering requires filtering of of the source and proper use of decoupling capacitors. Filtering may or may not be required depending on the quality of source. But decoupling caps should always be used, as close as possible to the component in question. Traces and wires are great for picking up noise, especially when there is an RF source nearby.

If you don't have a scope to actually see what your power looks like, the best thing to do is to simply filter. Its usually just an extra couple of caps. As an added benefit, with something like these radios which are transient sinks during TX, having some spare juice in a cap helps the entire circuit. And with something like a radio, the cleaner the power, the more reliable both RX and TX will be. The only down side is a couple of cheap caps. So why not?

Just came across this thread while debugging my test setup (one on a breadboarded arduino with a proper 3.3v regulator and one on my ancient diecimila). Saved me a fair bit of additional angst by simply cleaning the supply on the diecimila with a 10uf cap. The surprising thing was that I did try at one point hooking up the supply rail of the nrf24 board to an external 3.3v supply(from a converted atx psu) but this didn't help either!

Thanks!

Hello....

thanks for pointing me to the right drivers here... that fixed part of my problems... I now have a strange issue... when i run the ping test the round-trip delay times differ a lot. But when I touch the (insulated) cable that leads to my nrf module - the round-trip delay drops to around 3 or 4 ms (italics in the log) ... Any idea what could cause this? see a serial monitor log below..

I already have two capacitors in parallel (10uf & 470uf) between 3.3v and gnd. for some noise cancellation

thanks,

geoffrey

Now sending 200059...Got response 0, round-trip delay: 200069
Now sending 201069...Got response 201069, round-trip delay: 3
Now sending 202073...Got response 0, round-trip delay: 202083
Now sending 203083...Got response 1499027801, round-trip delay: 2796142589
Now sending 204094...Got response 204094, round-trip delay: 10
Now sending 205105...Got response 0, round-trip delay: 205115
Now sending 206115...Got response 825307441, round-trip delay: 3469865980
Now sending 207126...Got response 207126, round-trip delay: 3
Now sending 208130...Got response 0, round-trip delay: 208139
Now sending 209140...Got response 33686018, round-trip delay: 4261490427
Now sending 210150...Got response 4109694196, round-trip delay: 185483259
Now sending 211161...Got response 3873892070, round-trip delay: 421286397
Now sending 212171...Got response 3654932953, round-trip delay: 640246523
Now sending 213181...Got response 3419130827, round-trip delay: 876049660
Now sending 214193...Got response 3183328701, round-trip delay: 1111852796
[i]
Now sending 215202...Got response 215202, round-trip delay: 3
Now sending 216206...Got response 216206, round-trip delay: 3
Now sending 217210...Got response 217210, round-trip delay: 3
Now sending 218214...Got response 218214, round-trip delay: 3
Now sending 219217...Got response 219217, round-trip delay: 5
Now sending 220222...Got response 220222, round-trip delay: 3
Now sending 221225...Got response 221225, round-trip delay: 4
Now sending 222229...Got response 222229, round-trip delay: 3
Now sending 223234...Got response 223234, round-trip delay: 3
Now sending 224237...Got response 224237, round-trip delay: 3
Now sending 225241...Got response 225241, round-trip delay: 4
Now sending 226245...Got response 226245, round-trip delay: 3[/i]

Solved my problem too, thanks a lot

I am using nrf24L01+, prototype shield, arduino duemilanove
Testing using RF24Network, helloworld_rx.pde with helloworld_tx.pde
Tx side was reporting 'failed' about 50% of packets but most of these where actually received on Rx side with 2-5 re-transmits

Adding 100uF cap between 3v3 and gnd resolved the problem

thanks again
Peter

I know this topic is a bit old, but I'm having the darnest time trying to get these radio modules to work properly.

My setup is using the suggested capacitors (2x100uF between Vcc and GND) on each breadboard. I'm using an UNO on one side and a Micro on the other side.

My results are so sporadic that I don't know what to make of them.

Attached is a picture of my setups.

Here's a sample output:

Uno:

RF24/examples/GettingStarted/

ROLE: Pong back

*** PRESS 'T' to begin transmitting to the other node

STATUS.. = 0x0e RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=7 TX_FULL=0
RX_ADDR_P0-1.. = 0xf0f0f0f0d2 0xf0f0f0f0d2
RX_ADDR_P2-5.. = 0xc3 0xc4 0xc5 0xc6
TX_ADDR.. = 0xf0f0f0f0d2
RX_PW_P0-6.. = 0x20 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
*** CHANGING TO TRANSMIT ROLE -- PRESS 'R' TO SWITCH BACK

Now sending 4093...failed.

Failed, response timed out.

Now sending 5367...failed.

Failed, response timed out.

Now sending 6640...failed.

Failed, response timed out.

*** CHANGING TO RECEIVE ROLE -- PRESS 'T' TO SWITCH BACK

Got payload 8886...Sent response.

Got payload 9910...Sent response.

Got payload 10934...Sent response.

Got payload 11958...Sent response.

Got payload 12982...Sent response.

Got payload 14006...Sent response.

*** CHANGING TO TRANSMIT ROLE -- PRESS 'R' TO SWITCH BACK

Now sending 15801...ok...Got response 15801, round-trip delay: 24

Now sending 16826...ok...Got response 16826, round-trip delay: 22

Now sending 17850...ok...Got response 17850, round-trip delay: 22

Now sending 18873...ok...Got response 18873, round-trip delay: 23

*** CHANGING TO RECEIVE ROLE -- PRESS 'T' TO SWITCH BACK

Micro:

RF24/examples/GettingStarted/

ROLE: Pong back

*** PRESS 'T' to begin transmitting to the other node

STATUS.. = 0x0e RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=7 TX_FULL=0
RX_ADDR_P0-1.. = 0xf0f0f0f0d2 0xf0f0f0f0d2
RX_ADDR_P2-5.. = 0xc3 0xc4 0xc5 0xc6
TX_ADDR.. = 0xf0f0f0f0d2
RX_PW_P0-6.. = 0x20 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
*** CHANGING TO TRANSMIT ROLE -- PRESS 'R' TO SWITCH BACK

Now sending 8886...ok...Got response 8886, round-trip delay: 22

Now sending 9910...ok...Got response 9910, round-trip delay: 22

Now sending 10934...ok...Got response 10934, round-trip delay: 22

Now sending 11958...ok...Got response 11958, round-trip delay: 22

Now sending 12982...ok...Got response 12982, round-trip delay: 22

Now sending 14006...ok...Got response 14006, round-trip delay: 22

*** CHANGING TO RECEIVE ROLE -- PRESS 'T' TO SWITCH BACK

Got payload 15801...Sent response.

Got payload 16826...Sent response.

Got payload 17850...Sent response.

Got payload 18873...Sent response.

The weirdest thing is that, when I sometimes try to send packets one won't respond, I try sending packets with the other, then the failing one responds and after that both will send packets correctly until I restart them.

The LED buttons example also fails to work more than once every full moon...It will work for a single button press and will fail forever after that, until I reset everything a few times.

Any help is greatly appreciated. I have 4 of these modules and I've tried every permutation possible, same results.

I had some trouble too, failures sometimes, timeouts often, with Arduino nano on one side and Arduino Uno and rf 24 (all cheap chines products) on the other...

So what I found out in my case:

  1. My Nano needs a capictor (100yF), the Uno does not like.
  2. The Uno needs yery short cable to Ground.
  3. Define datarate and paLevel in your scripts, mut be same data in both:

on top add:

...
#define dataRate RF24_2MBPS //could be lower for more distance
#define paLevel RF24_PA_MAX // could be Lower as well
...

in setup add:
...
radio.begin();
radio.setDataRate(dataRate);
radio.setPALevel(paLevel);
...

So, since I changed it like this, stuff workes properly in my surounding...
But maybe this depends on each case.

Best regards.

hi, i know this is "solved" but i can explain to you what the real problem is...

bypass capacitors need to be very physically close to the sensitive device, eg. the NRF24L01. you'll have variable results otherwise. also, you should have two capacitors -- an electrolytic and a ceramic, usually 0.1uF.

this is long-standard practice around anything that is capable of fast transient loads; nearly anything "digital". in reality nothing is "digital", nothing changes in zero time, voltage regulators take milliseconds to respond to load changes, etc. plus there are transmission line issues that most hobbyists are utterly unaware of.

the rules-of-thumb for all bypass caps is simple, and will solve 99% of transient/glitch issues without having to understand the physics:

  • SHORTEST POSSIBLE LEADS. wire has inductance and resistance. not much, but at nanosecond/picosecond speeds, significant. bypass caps 4 - 6" away might as well not exist, for fast transients.

  • electrolytic "big enough" to carry the load for the duration, until the voltage regulator can respond. 10uF, 47uF, 100uF, etc for most stuff is adequate. GOOD: compact, low-cost bulk energy storage for transient loads. BAD: high internal inductance and resistance means they have poor high-frequency response.

  • a ceramic cap, 0.1uF in nearly all cases. GOOD: very low inductance and near-zero internal resistance, great for very fast (nS, pS) transients. BAD: low capacity, even 1uF ceramics get very expensive and very large.

it's not 100uF + 0.1uF, it's two caps doing two different jobs.

now go look at schematics for the Arduino boards, and most other fast digital stuff, and you'll see the two caps.... often there's one electrolytic per board, and one ceramic per chip.

hello, i want to communicate due arduino, arduino nano, with RF24Network class, so I connect more than 6 devices.
The problem is that, I not found a brunch that runs on both boards, and different realese are not compatible between each they.

if somebody have the cure, please give us!!
thanks

Boards 'NANO' 'DUE'
RF rf24l01 Nordic

i am using nRF24l01+ and arduino uno. i use the libraries downloaded from GitHub - maniacbug/RF24: Arduino driver for nRF24L01.

i have connected nRF24l01+ and arduino as follows
GND to GND
Vcc to 3V3( i even tried connecting 3V3 on rpi2 module)
CE to 9
CSN to 10
SCK to 13
MOSI to 11
MISO to 12

Whenever i am working with the examples given with the libraries i am only getting a lot of ZEROES on the serial monitor(output of radio.printDetails()).

If I run the script I get this in the serial monitor

RF24/examples/GettingStarted/

ROLE: Pong back

*** PRESS 'T' to begin transmitting to the other node

STATUS = 0x00 RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=0 TX_FULL=0
RX_ADDR_P0-1 = 0x0000000000 0x0000000000
RX_ADDR_P2-5 = 0x00 0x00 0x00 0x00
TX_ADDR = 0x0000000000
RX_PW_P0-6 = 0x00 0x00 0x00 0x00 0x00 0x00
EN_AA = 0x00
EN_RXADDR = 0x00
RF_CH = 0x00
RF_SETUP = 0x00
CONFIG = 0x00
DYNPD/FEATURE = 0x00 0x00
Data Rate = 1MBPS
Model = nrf24l01
CRC Length = Disabled
PA Power = PA_Min

Can anyone please tell me why i am always getting the above output?

Should we intialise the registers by some methods before using the module?

(i am using a 10uF electrolytic capacitor between 1 and 2 pins of nRF24l01+ module)