Go Down

Topic: Can't get nRF24L01 working (Read 4 times) previous topic - next topic

CyberBob

Hi

I need help please. I have just bought a couple of nRF24L01 (compatable) transceivers and have installed all the various libraries that are suggested on various sites. I have tried the usual tests (Poor Mans' Scanner, amongst many others) but I still get meaningless data on the serial monitor.

I followed the pinout at http://arduino-info.wikispaces.com/Nrf24L01-Poor+Man%27s+2.4+GHz+Scanner but all I get is output like this -
K°¾*ø0p

I'm using an Uno so the wiring shouldn't be a problem, though I suspect the problem might be with the modules themselves.

Any pointers would be appreciated

Thanks


CyberBob

Sorry for putting this in the Storage section, it should have gone into Networking

Simpson_Jr

Do you, at least, get these lines on your monitor ?

"Starting Poor Man's Wireless 2.4GHz Scanner ..." and
">      1 2  3 4  5  6 7 8  9 10 11 12 13  14                     <"

If not, check the baud-rate you're using, it should be 57600 baud.
The wiring of the pins did cause some problems over here by the way.
I don't remember whether it was this scanner-sketch or another, every
channel checked showed  intensive transmissions while only a few people in my
neighbourhood use WIFI.

Some of the sketches of different nRF24L01-programmers also use
different arduino-pins for the signals CE and SS, you may have to adjust those
on your arduino or in the sketches used.



matchy

Try the library:
http://maniacbug.wordpress.com/2011/11/02/getting-started-rf24/

Code: [Select]

// nRF24L01+ Active Test
#include <SPI.h>
#include <RF24.h>
#include "printf.h"
#define RF_CS 9
#define RF_CSN 7
RF24 radio(RF_CS, RF_CSN);
void setup() {
Serial.begin(9600);
printf_begin();
radio.begin();
radio.printDetails();
}
void loop() {

}


Positive sample output:
Code: [Select]

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


Negative sample output:
Code: [Select]

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


JohnHoward

I hope you observed the fact the nRF24L01 is a 3.3v device and powered it off the 3v3  pin!

The pingpair example is a good one to start with.  Easy to set up and get it going. 

I second the other poster that the serial port speed would seem to be set wrong.  If the nRF24L01 is not working right, you'll still typically see all zeros or all ones from the .printDetails() when it is called.

The first one I ever tried to wire up, I got mixed up about which way the pins were designated vis a vis the diagram I was referring to.  Be sure you recheck that carefully.

On the plus side, I actually applied power to the wrong pins a couple times at the outset and the little buggers survived.

Maks

I dont know if you still have that problem, but when i tried the NRF modules for the first time that happened, the solution it to check the baud on serial monitor

rclymer

I'm getting a positive response but I can't get the two communicating. I am using the RF24 library and running the GettingStarted sketch. I never have a successful transfer.

My best guess is that the pipe address could be wrong, but I just dont know.

Here is the info for each sensor

Code: [Select]

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


Code: [Select]

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 = 1MBPS
Model = nRF24L01+
CRC Length = 16 bits
PA Power = PA_HIGH


Any suggestions?

Nman120

hello, I seem to be having the same trouble as stated above . I recently bought 6 nrf24l01+ and have been experimenting with communication between my arduino Uno board and and Uno equivalent on a bread board. heres the transmiters information when I run the gettingStarted code
on the Uno
Code: [Select]

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 = 0x00
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 1922...ok...Failed, response timed out.

Now sending 3126...ok...Failed, response timed out.

Now sending 4328...ok...Failed, response timed out.

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


on the bread board
Code: [Select]

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 3778...failed.

Failed, response timed out.

Now sending 5054...failed.

Failed, response timed out.

Now sending 6329...failed.

Failed, response timed out.

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

I don't know if this is the problem but I've noticed that the RX_ADDR_P0-1 addresses tend to change randomly without reason without changing code and when you do change the address in the code the printDeetails doesn't show any change. the weird thing is that I know they work because I had them transmitting and getting back a response so I have a fealling that I haven't fixed my wiring yet.

any input is greatly appreciated thanks.

AcmeUK

#8
Nov 23, 2013, 08:23 pm Last Edit: Nov 30, 2013, 05:34 pm by AcmeUK Reason: 1
Hi

I have the GettingStarted sketch running on 2 Nanos.

The problem I have is that the receiving node (pong node) will not work unless I first put it into TRANSMIT mode and then switch it back to receive mode.

Does this work for anyone else?

Anyone know how to fix this so that the pong node works correctly on startup?

Further Info: The pingpair sketch works fine, so why the problem with the GettingStarted sketch I know not!

erni-berni

Hi,
I had the same problem and searched hours to find the reason. I was sure that the electrical connection was correct, because I got the modules running with the Mirf library.
Finally with this
Quote

The problem I have is that the receiving node (pong node) will not work unless I first put it into TRANSMIT mode and then switch it back to receive mode.

I got the modules running with the RF24 library.
Who knows why ?

Thanks
Reinhard

erni-berni

Hi,
you have to uncomment this section
Code: [Select]
  //if ( role == role_ping_out )
  {
    //radio.openWritingPipe(pipes[0]);
    radio.openReadingPipe(1,pipes[1]);
  }
  //else
  {
    //radio.openWritingPipe(pipes[1]);
    //radio.openReadingPipe(1,pipes[0]);
  }

to
Code: [Select]
  if ( role == role_ping_out )
  {
    radio.openWritingPipe(pipes[0]);
    radio.openReadingPipe(1,pipes[1]);
  }
  else
  {
    radio.openWritingPipe(pipes[1]);
    radio.openReadingPipe(1,pipes[0]);
  }

Fujikatoma

#11
Aug 12, 2014, 08:13 am Last Edit: Aug 13, 2014, 08:53 am by Fujikatoma Reason: 1

Hi,
you have to uncomment this section
Code: [Select]
  //if ( role == role_ping_out )
  {
    //radio.openWritingPipe(pipes[0]);
    radio.openReadingPipe(1,pipes[1]);
  }
  //else
  {
    //radio.openWritingPipe(pipes[1]);
    //radio.openReadingPipe(1,pipes[0]);
  }

to
Code: [Select]
  if ( role == role_ping_out )
  {
    radio.openWritingPipe(pipes[0]);
    radio.openReadingPipe(1,pipes[1]);
  }
  else
  {
    radio.openWritingPipe(pipes[1]);
    radio.openReadingPipe(1,pipes[0]);
  }



I've tried this but it didn't worked.
Somone else have an idea ?

Both Arduinos gave me the positiv log

leon77

#12
Sep 04, 2014, 09:06 pm Last Edit: Sep 04, 2014, 10:02 pm by leon77 Reason: 1

Hi,
you have to uncomment this section
Code: [Select]
 //if ( role == role_ping_out )
 {
   //radio.openWritingPipe(pipes[0]);
   radio.openReadingPipe(1,pipes[1]);
 }
 //else
 {
   //radio.openWritingPipe(pipes[1]);
   //radio.openReadingPipe(1,pipes[0]);
 }

to
Code: [Select]
 if ( role == role_ping_out )
 {
   radio.openWritingPipe(pipes[0]);
   radio.openReadingPipe(1,pipes[1]);
 }
 else
 {
   radio.openWritingPipe(pipes[1]);
   radio.openReadingPipe(1,pipes[0]);
 }



This worked for me, thanx!  :)
And also: use a separate 3.3V power supply! I've tried to connect the nRF24L01 directly to the 3.3v outputs of my Nano's but that did not work. It's also good to add a 3.3uF capacitor from gnd to 3.3v on the module.

Go Up