Go Down

Topic: Problems getting nRF24L01P+ to work (Read 204 times) previous topic - next topic

yuriynefedov

Hi everyone!

I've been having troubles with the nRF24L01 module with an external antenna. I'm using Arduino Uno and the nRF24L01 module adapter so that I can simply power it with 5V. I'm also using the ManiacBug's RF24 library.

Here's how the connections between Uno and the adapter look like:

Uno  -  Adapter
GND -  GND
5V    -  VCC
D9    -  CE
D10  -  CSN
D11  -  MO
D12  -  MI
D13  -  SCK


So, here's the thing: when I upload the GettingStarted sketch to the board this is what I see in printDetails:


Code: [Select]

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



Obviously, all attempts to transmit data failed.
I find it pretty interesting that when I completely disconnect the transceiver from the adapter (so that Arduino is only connected to the adapter and nothing else), the printDetails' numbers change to this:

Code: [Select]

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


Here's what I get when I set it (without the nRFL01 connected) to the transmitting mode:

Code: [Select]

Got payload 4294967295...Sent response.

Got payload 4294967295...Sent response.

Got payload 4294967295...Sent response.


I managed to get the same result a couple of times (without any stability) with the nRF24L01 connected, but now I'm not even sure if it means the connection was actually better or worse.

I've checked my wiring a lot of times really, and I also bought a few more nRF24L01 modules in case the ones I tried to connect didn't work properly, but this never helped me.

I've been having this problem for quite a while now and I have no idea what am I doing wrong. Really looking forward to your advice!

Whandall

Your printDetails point to a wiring hardware/software configuration error.

Until you see reasonable values in printDetails, any other testing is futile.
Ah, this is obviously some strange usage of the word 'safe' that I wasn't previously aware of. (D.Adams)

Robin2

Two or three hours spent thinking and reading documentation solves most programming problems.

yuriynefedov

Have a look at this Simple nRF24L01+ Tutorial.

...R
Thank you very much for the tutorial! It helped me realize the problem was not about my software or wiring. Apparently, the pinout printed on the module turned out to be incorrect and so the wrong connection caused its damage. I managed to replace the module and connected it properly.

Now in printDetails I get this:

Code: [Select]

STATUS = 0xff RX_DR=1 TX_DS=1 MAX_RT=1 RX_P_NO=7 TX_FULL=1
RX_ADDR_P0-1   = 0x0000000000 0x0000000000
RX_ADDR_P2-5   = 0x00 0x00 0xff 0xff
TX_ADDR        = 0xffffffffff
RX_PW_P0-6     = 0x00 0x00 0x00 0x00 0x00 0x00
EN_AA          = 0x00
EN_RXADDR      = 0x7f
RF_CH          = 0xff
RF_SETUP       = 0xff
CONFIG         = 0x00
DYNPD/FEATURE  = 0x00 0x00
Data Rate      = 1MBPS
Model          = nRF24L01
CRC Length     = 16 bits
PA Power       = PA_HIGH



I'm not really sure if it means the connection is proper.

 From the SimpleTx sketch I get this

Code: [Select]

Data sent 0    Acknowledge received
Data sent 1    Acknowledge received
Data sent 2    Acknowledge received
Data sent 3    Acknowledge received
Data sent 4    Acknowledge received
Data sent 5    Acknowledge received


and so on. Seems to be a good thing, but when I upload the SimpleRx sketch to second Arduino, here's what I get:

Code: [Select]

Data received
Data received
Data received
Data received
Data received
Data received
Data received
Data received
Data received


I just get a lot of this messages a second with almost no delay.

What would you recommend me to do to fix this?

Robin2

I just get a lot of this messages a second with almost no delay.

What would you recommend me to do to fix this?
That usually means the Arduino is not communicating properly with the nRF24 it is attached to.

Try the connection test program in my tutorial.

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

Whandall

Code: [Select]
STATUS = 0xff RX_DR=1 TX_DS=1 MAX_RT=1 RX_P_NO=7 TX_FULL=1
The highest bit of the status register is reserved and is always 0.

Your communication with the NRF is still broken.
Ah, this is obviously some strange usage of the word 'safe' that I wasn't previously aware of. (D.Adams)

Whandall

On an UNO clone, using the same type of adapter one gets

Code: [Select]
#include <RF24.h>
#include <printf.h>

RF24 radio(9, 10);

void setup() {
  Serial.begin(250000);
  printf_begin();
  radio.begin();
  radio.printDetails();
}
void loop() {}
Code: [Select]
STATUS = 0x0e RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=7 TX_FULL=0
RX_ADDR_P0-1 = 0x3030303032 0xc2c2c2c2c2
RX_ADDR_P2-5 = 0xc3 0xc4 0xc5 0xc6
TX_ADDR = 0x3030303032
RX_PW_P0-6 = 0x20 0x00 0x00 0x00 0x00 0x00
EN_AA = 0x3f
EN_RXADDR = 0x03
RF_CH = 0x4c
RF_SETUP = 0x01
CONFIG = 0x0e
DYNPD/FEATURE = 0x00 0x00
Data Rate = 1MBPS
Model = nRF24L01+
CRC Length = 16 bits
PA Power = PA_MIN
Ah, this is obviously some strange usage of the word 'safe' that I wasn't previously aware of. (D.Adams)

yuriynefedov

Good news - the problem has been solved! I managed to get the printDetails output similar to this.

On an UNO clone, using the same type of adapter one gets

Code: [Select]

RX_ADDR_P0-1 = 0x3030303032 0xc2c2c2c2c2
RX_ADDR_P2-5 = 0xc3 0xc4 0xc5 0xc6
TX_ADDR = 0x3030303032
RX_PW_P0-6 = 0x20 0x00 0x00 0x00 0x00 0x00
EN_AA = 0x3f
EN_RXADDR = 0x03
RF_CH = 0x4c
RF_SETUP = 0x01
CONFIG = 0x0e
DYNPD/FEATURE = 0x00 0x00
Data Rate = 1MBPS
Model = nRF24L01+
CRC Length = 16 bits
PA Power = PA_MIN

Apparently, Arduino jumpers don't provide the connection good enough to use this modules, but soldering really got it done in my case. Big thanks for all your help!

Whandall

#8
Jul 21, 2018, 03:42 pm Last Edit: Jul 21, 2018, 08:14 pm by Whandall
Glad to hear you have it working.

Soldered connections work better, breadboards are only usable for prototypes or proof of concept tests IMHO.

Now that you can talk to the chips, you can start using them.
Design your code unblocking and don't wait for something.

The NRF24L01+ is very flexible which can be a little confusing in the beginning.
Try to understand all of the datasheet, which takes a couple of rounds in my experience.

For prototypes with NRF24L01+ I like to use a Nano IO Shield Expansion Board
Ah, this is obviously some strange usage of the word 'safe' that I wasn't previously aware of. (D.Adams)

Go Up