Author Topic: nRF24L01+ / RF24 not working?  (Read 54120 times)

Dennis

  • Newbie
  • *
  • Posts: 15
Re: nRF24L01+ / RF24 not working?
« Reply #15 on: January 04, 2014, 02:03:50 am »
I have the latest DigiX add-on.  I loaded the GettingStarted sketch (IDE v1.5.5 beta) and fixed the code as per this thread and it ran, printing the "Now sending.." message with the time.  However, the only output I got is "failed".  The message was not received by the second node (when I had a second terminal connected to it, nothing printed past the setup message).  So basically, it did not work.

So I either a) Have bad nrf24L01 devices or b) the sketch and the libraries are NOT ready for prime time or c) I am missing something.

Any advice?

:)

I guess it's b! The library is not working pretty well.

Do you use the DigiX Serial Trick
Code: [Select]
//DigiX trick - since we are on serial over USB wait for character to be entered in serial terminal
  while(!Serial.available()){
    Serial.println("Enter any key to begin");
    delay(1000);
on both DigiX? Please consider that you have to "enter a key" on BOTH(!!!) DigiX, otherwise one device will stay in an infinite loop at "while(!Serial.available())"!

pkourany

  • Newbie
  • *
  • Posts: 25
Re: nRF24L01+ / RF24 not working?
« Reply #16 on: January 04, 2014, 09:03:40 am »
Dennis,

I did not use the Serial trick since I put a delay at the beginning of the sketch to allow me to open the console before the startup message.  Then I hit 'T' and enter to get the "ping" going.  The 'pong' side listens by default so I don't know what the issue is yet.  I may put a logic analyzer on the NRF24L01 pins to see if the SPI data is getting to it.

 :(

digistump

  • Administrator
  • Hero Member
  • *****
  • Posts: 1465
Re: nRF24L01+ / RF24 not working?
« Reply #17 on: January 05, 2014, 02:54:31 am »
This is all fixed in the newest release: http://digistump.com/wiki/digix/tutorials/software

pkourany

  • Newbie
  • *
  • Posts: 25
Re: nRF24L01+ / RF24 not working?
« Reply #18 on: January 05, 2014, 05:32:49 pm »
Yup, all working now.  Thanks!

xeno

  • Newbie
  • *
  • Posts: 4
Re: nRF24L01+ / RF24 not working?
« Reply #19 on: February 21, 2014, 11:40:08 am »
The 'GettingStarter' example is not working for me (tried with the latest version), i'm getting this at the serial monitor:

Code: [Select]
Enter any key to begin
Enter any key to begin


RF24/examples/GettingStarted/

ROLE: Pong back

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

STATUS = 0xff RX_DR=1 TX_DS=1 MAX_RT=1 RX_P_NO=7 TX_FULL=1
RX_ADDR_P0-1 0xffffffffff 0xffffffffff
RX_ADDR_P2-5 0xff 0xff 0xff 0xff
TX_ADDR = 0xffffffffff
RX_PW_P0-6 0xff 0xff 0xff 0xff 0xff 0xff
EN_AA = 0xff
EN_RXADDR 0xff
RF_CH = 0xff
RF_SETUP 0xff
CONFIG = 0xff
DYNPD/FEATURE 0xff 0xff
Data Rate = S
Model = S
CRC Length = S
PA Power = S

Got payload 4294967295...Sent response.
Got payload 4294967295...Sent response.
Got payload 4294967295...Sent response.
Got payload 4294967295...Sent response.
Got payload 4294967295...Sent response.
Got payload 4294967295...Sent response.
Got payload 4294967295...Sent response.
Got payload 4294967295...Sent response.
Got payload 4294967295...Sent response.
Got payload 4294967295...Sent response.
Got payload 4294967295...Sent response.
Got payload 4294967295...Sent response.

The number '4294967295' is the largers number 32 bits can hold (0xFFFFFFFF)

Code: [Select]
*** CHANGING TO TRANSMIT ROLE -- PRESS 'R' TO SWITCH BACK

Now sending 723773...ok...Got response 4294967295, round-trip delay: 723775
Now sending 724775...ok...Got response 4294967295, round-trip delay: 724776
Now sending 725776...ok...Got response 4294967295, round-trip delay: 725777
Now sending 726777...ok...Got response 4294967295, round-trip delay: 726778
Now sending 727778...ok...Got response 4294967295, round-trip delay: 727779
Now sending 728779...ok...Got response 4294967295, round-trip delay: 728780
Now sending 729780...ok...Got response 4294967295, round-trip delay: 729781
Now sending 730781...ok...Got response 4294967295, round-trip delay: 730782
Now sending 731782...ok...Got response 4294967295, round-trip delay: 731783
Now sending 732783...ok...Got response 4294967295, round-trip delay: 732784
Now sending 733784...ok...Got response 4294967295, round-trip delay: 733785

Any ideas?
« Last Edit: February 21, 2014, 11:44:36 am by xeno »

remcoder

  • Newbie
  • *
  • Posts: 1
Re: nRF24L01+ / RF24 not working?
« Reply #20 on: March 23, 2014, 12:43:03 pm »
I have exactly the same problem and output. Everything, is just 0xFF so I guess something is not properly initialized. Maybe an SPI issue? I'm using the 0.8 drivers and Arduino 1.5.6-r2.

digistump

  • Administrator
  • Hero Member
  • *****
  • Posts: 1465
Re: nRF24L01+ / RF24 not working?
« Reply #21 on: March 23, 2014, 11:12:03 pm »
I apologize for the obvious questions - but:

Did you plug the nRF module in oriented downward?
Is it securely plugged into the socket?
Are you using a nRF module from Digistump or form elsewhere?


Aerospacesmith

  • Newbie
  • *
  • Posts: 5
Re: nRF24L01+ / RF24 not working?
« Reply #22 on: April 05, 2014, 02:13:31 am »
No one has has commented in a while, but I am having a similar issue and may have found my problem. I am using the DigiX and the nRF module it came with. I am also testing the pingpair using an Arduino Nano and a cheap nRF module from China. I had the program running on both systems with the DigiX transmitting and the Nano pinging back, but the signal was never getting to the Nano. After looking in the code and looking at the Serial output I finally noticed there were differences in the radio.printDetails(); output. The digiX included module has
RF_SETUP    0x07
CONFIG       = 0x0f
DYNPD/FEATURE    0x00 0x00
Data Rate    = S
Model       = S
CRC Length    = S
PA Power    = S

and the China module has
RF__SETUP
CONFIG       = 0x0f
DYNPD/FEATURE    = 0x00 0x00
Data Rate    = 1MBPS
Model       = nRF24L01+
CRC Length    = 16 bits
PA Power    = PA_HIGH

So after scratching my head awhile, I tried replacing the nRF module in the DigiX with another China one and it WORKED! The two China modules started talking to each other.
So now does this mean the one included with the DigiX is defective or is there a configuration I'm missing to get it working with the China ones?


Also even after replacing the module in the DigiX, its printradiodetails still gives the same output as with the other modules.

stega

  • Newbie
  • *
  • Posts: 5
Re: nRF24L01+ / RF24 not working?
« Reply #23 on: May 01, 2014, 03:34:06 pm »
Hi

I just have tested a bunch of nRF24L01+ and a Arduino Uno, Arduino Yún and a DigiX, all with latest RF24 libraries and using the GettingStarted sketch as testbed. The Uno and the Yún are talking perfectly to each other, can switch their role... everything fine. With the DigiX, things look different. My DigiX likes more the receiving part of the game. For me it seems, that the DigiX can send and receive the payload, but - referring to the receiving part - somehow not the signal to acknowledge the transmission (maybe I' using the wrong words here, I'm still learning every day :)). In the SerialMonitor of Arduino IDE I see entries like this:

Transmitter role (DigiX):
"Now sending 83321...failed.
Failed, response timed out."

maybe in 1 out of 500 transmissions, I get
"Now sending 84594...ok...Got response 84594, round-trip delay: 80"

(not depending on distance, not depending on location, not depending on module, not depending on power)

Receiver role (Uno or Yún):
- nothing -

In the very rare case where something went through:
"Got payload 84594...Sent response."

---

Receiver role (DigiX):
"Got payload 1750384...Sent response."

Transmitter role (UNO or Yún):
"Now sending 12368...ok...Failed, response timed out."

---

[The same nRF24L01+ modules are working perfectly on the Arduinos at the same locations, same distances and so on.]

When starting the sketch on the DigiX (same modules/boards which are working very well on the Arduinos), I see the same values as Aerospacesmith has seen for the module from Digistump:
 

[...]

... there were differences in the radio.printDetails(); output. The digiX included module has

RF_SETUP    0x07
CONFIG       = 0x0f
DYNPD/FEATURE    0x00 0x00
Data Rate    = S
Model       = S
CRC Length    = S
PA Power    = S

[...]


My nRF24L01+ boards are from iTeadstudio.

For me, the "S" values are a bit suspicious. Could it be, that there is the problem (not being able to completely identify the configuration of these modules/boards)? Maybe Erik or someone with more knowledge in this area than me can elaborate?  ;)

(Remark: The same boards are showing correct values when they are used on the Arduinos -> no "S" values but values like "nRF24L01+"

If I can help finding and fixing this issue, I'm very willing to do other tests. Till now my extended tests consisted of the following actions:

- replace nRF24L01+ modules
- testing nRF24L01+ modules on Arduinos
- testing if module sits well in the socket of DigiX
- testing different locations
- testing different power options for DigiX (USB power from notebook vs. power from external power supply through barrel connector)
- testing different distances

All with the same results as written above.

Thanks in advance and kind regards,
Rolf
« Last Edit: May 01, 2014, 03:54:13 pm by stega »

stega

  • Newbie
  • *
  • Posts: 5
Re: nRF24L01+ / RF24 not working?
« Reply #24 on: May 27, 2014, 01:14:48 pm »
Ok, after some tests with original nRF24L01+ modules from Digistump it's clear for me, that you should use these original modules and no others with your DigiX, (even if other boards are also from a quality source).

=> I just ran some tests:

Hardware:
DigiX with nRF24L01+ module from Digistump
Arduino UNO (original) with nRF24L01+ module from iTeadStudio (VER.A0)

Sketches:
RF24: Getting started
RF24Network: helloworld_rx/tx

Till now, everything worked fine as expected, even when using a nRF24L01+ module from iTeadStudio on the side of the Arduino Uno.

I have some more modules at hand and will post some more experiences with other hardware when done with my projects :-)

It's great to have found the clue!  ;D

kd7eir

  • Newbie
  • *
  • Posts: 17
Re: nRF24L01+ / RF24 not working?
« Reply #25 on: May 30, 2014, 08:06:34 am »
Aerospacesmith had the opposite resolution to yours, so I think the problem is most likely NOT the source of the modules, but something in the way that the DigiX board is interacting with them.

torchris

  • Newbie
  • *
  • Posts: 17
Re: nRF24L01+ / RF24 not working?
« Reply #26 on: June 11, 2014, 05:58:24 pm »
Hi all,

Sorry, I have posted a couple of issues with nRF and then deleted them because I solved them, but this one has me stumped.

I have an Arduino Duelimanove with an nRF24L01+ radio and a OneWire 18S20 temp sensor and then I have my DigiX with its nRF radio. I modified the "GettingStarted" sketch so that the DigiX is always in "Pong Out" mode and the Duelimanove is always in "Ping Back" and instead of exchanging the timestamp info, the DigiX sends out a command character and the Duelimanove responds with the temperature from the OneWire. I also added some LEDs on both so I could see the activity. Works great and a good way to figure out the nRF. I would post the code, but it really is pretty much identical to the "GettingStarted" sketch.

Here is the problem...

1. I have the DigiX happily running my code.
2. Then I power down the DigiX then power it back up, my sketch just goes into "Failed. Response timed out" and the nRF on the Duelimanove receives nothing.
3.  If I then reload the original GettingStarted sketch, it works.
4.  I then reload my version of the sketch and it is back to getting the temp data just fine!!

What the heck?!?! It would certainly not be useable if every time I powered down my project I had to reload one sketch then reload another! I really have no idea why this would be happening and I cannot see any difference in the code between what I wrote and the original GettingStarted sketch - anyway, if the unit is powered down what difference would that make?

BTW, I found the best reliability I have gotten with these radios is to solder a 10 uF capacitor across pins 1 & 2 on the nRF (GND & VCC).

Thanks!!

SOLVED - OK, this time I won't delete my message in case anyone else runs into this.

In my haste to cut down the the GettingStarted, I had deleted two critical lines:

      radio.openWritingPipe(pipes[0]);
      radio.openReadingPipe(1,pipes[1]);

So, the read/write pipes never got properly configured. What I can't figure out is why it would not just fail 100% of the time. Why would running the original GettingStarted sketch make it work? I am assuming the actual nRF radio firmware was being modified and this carried through from one sketch load to another.



« Last Edit: June 12, 2014, 01:18:23 pm by torchris »

Fadi

  • Newbie
  • *
  • Posts: 4
Re: nRF24L01+ / RF24 not working?
« Reply #27 on: October 16, 2014, 04:12:34 pm »
Guys
It seems that this has been resolved but I just tried it and it is not working for me.
I actually tried manually installing Arduino and the add-ons for DigiX and then I decided to give the installer a try perhaps
i had something messed up when I did it manually.

In both cases, the output of my board is:

Enter any key to begin...
Enter any key to begin...


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    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    = S
Model       = S
CRC Length    = S
PA Power    = S
*** CHANGING TO TRANSMIT ROLE -- PRESS 'R' TO SWITCH BACK

Now sending 13015...failed.
Failed, response timed out.
Now sending 14288...failed.

I tried two modules already and the issue persists. (both modules worked fine on an Arduino Uno)

So my checklist at the moment is:
1- Running latest and greatest libraries, addons..etc
2- Tried multiple working modules.
3- Tried the suggestion of removing the writing/reading to pipe (which I don't think it makes sense, but for the heck of it I need to get it to work)

What do you guys suggest?

Thanks

torchris

  • Newbie
  • *
  • Posts: 17
Re: nRF24L01+ / RF24 not working?
« Reply #28 on: October 16, 2014, 04:24:34 pm »
Apart from the usual obvious stuff about wiring and connections etc etc, here are 2 things I suggest based on experience:

1. Solder a capacitor between the GND & PWR pins on the nRF radios you are using. I'm using 10 uF, but you can experiment with other values.

2. Try using the RadioHead nRF library found here - http://www.airspayce.com/mikem/arduino/RadioHead/. I find the library seems more reliable than the Maniacbug library that comes with the DigiX Arduino IDE extensions. Bear in mind some caveats from another thread of nRF discussion I had - http://digistump.com/board/index.php/topic,1515.0.html.

Good luck!

Fadi

  • Newbie
  • *
  • Posts: 4
Re: nRF24L01+ / RF24 not working?
« Reply #29 on: October 16, 2014, 05:57:52 pm »
Much appreciated torchris!
I'll check that out.
client/server limitations are not an issue for me now, I am just testing, but I must admit I am let down by this.

The DigiX was the Arduino-ish Arduino to rule them all for me. I hope DigiStump can get back on track and get this
baby working 100% for their community.

Thanks
Fadi