Pages: [1]   Go Down
Author Topic: Can't get nRF24L01 working  (Read 4344 times)
0 Members and 1 Guest are viewing this topic.
Cheshire UK
Offline Offline
Jr. Member
**
Karma: 0
Posts: 79
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Logged

Cheshire UK
Offline Offline
Jr. Member
**
Karma: 0
Posts: 79
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Netherlands
Offline Offline
God Member
*****
Karma: 7
Posts: 650
A naughty mind is a joy forever.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.


Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 13
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Code:
// 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:
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:
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
Logged

Offline Offline
Full Member
***
Karma: 5
Posts: 219
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Portugal
Offline Offline
Full Member
***
Karma: 0
Posts: 113
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Offline Offline
Full Member
***
Karma: 0
Posts: 101
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
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:
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?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
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:
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.
Logged

Offline Offline
Newbie
*
Karma: 1
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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!
« Last Edit: November 30, 2013, 11:34:51 am by AcmeUK » Logged

Cologne
Offline Offline
God Member
*****
Karma: 11
Posts: 506
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Cologne
Offline Offline
God Member
*****
Karma: 11
Posts: 506
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,
you have to uncomment this section
Code:
  //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:
  if ( role == role_ping_out )
  {
    radio.openWritingPipe(pipes[0]);
    radio.openReadingPipe(1,pipes[1]);
  }
  else
  {
    radio.openWritingPipe(pipes[1]);
    radio.openReadingPipe(1,pipes[0]);
  }
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,
you have to uncomment this section
Code:
  //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:
  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
« Last Edit: August 13, 2014, 01:53:36 am by Fujikatoma » Logged

Pages: [1]   Go Up
Jump to: