NRF24L01

Hi, i have a problem with NRF24L01. Yesterday everything worked, but today i cant send any messages. I tried program from yesterday and it doesnt work. Also i controlled wires and everything seems fine.

One of leds at arduino board doesnt light , when i upload code. It seems that "radio.begin()" is problematic line of code.. When i delete it , the led turn on and lights.

radio.printDetails message :
STATUS = 0x0e RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=7 TX_FULL=0
RX_ADDR_P0-1 = 0x0000000100 0xc2c2c2c2c2
RX_ADDR_P2-5 = 0xc3 0xc4 0xc5 0xc6
TX_ADDR = 0xe7e7e7e7e7
RX_PW_P0-6 = 0x20 0x00 0x00 0x00 0x00 0x00
EN_AA = 0x3f
EN_RXADDR = 0x03
RF_CH = 0x4c
RF_SETUP = 0x07
CONFIG = 0x0e
DYNPD/FEATURE = 0x00 0x00
Data Rate = 1MBPS
Model = nRF24L01+
CRC Length = 16 bits
PA Power = PA_MAX

Can be problem in arduino board or some HW?

Thanks

Hi, see this page for suggestions:

http://arduino-info.wikispaces.com/Nrf24L01-2.4GHz-HowTo

I looked everything , but it still does not work

This Simple nRF24L01+ Tutorial may help.

If your system used to work and now does not then something must have changed - what?

...R

I dont know. I tried your example with SimpleTx.ino and SimpleRx.ino. But i got from receiver message: Data received .. and from transmiter : Data Sent Message 0 Tx failed...

Where can be problem?

marek130:
I dont know. I tried your example with SimpleTx.ino and SimpleRx.ino. But i got from receiver message: Data received .. and from transmiter : Data Sent Message 0 Tx failed...

Where can be problem?

Is the "Data received" message repeating very quickly? It should only repeat once per second.

If it is repeating very quickly there is probably a wiring fault and the Arduino thinks something has been received even when it has not.

Do you have some spare nRF24 modules that you could use to check if one of them is faulty.

Post the code that YOU uploaded to your two Arduinos and make a simple pencil drawing showing how everything is connected on YOUR two Arduinos and post a photo of the drawing.

...R

Yes, very quickly. I tried another nRF24 but the same result. But when i upload code receiver to transmiter and transmiter to receiver , it will print just SimpleRx Starting. WTF??

Code receiver:

// SimpleRx - the slave or the receiver

#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>

#define CE_PIN 9
#define CSN_PIN 10

const byte thisSlaveAddress[5] = {'R','x','A','A','A'};

RF24 radio(CE_PIN, CSN_PIN);

char dataReceived[10]; // this must match dataToSend in the TX
bool newData = false;

//===========

void setup() {

Serial.begin(9600);

Serial.println("SimpleRx Starting");
radio.begin();
radio.setDataRate( RF24_250KBPS );
radio.openReadingPipe(1, thisSlaveAddress);
radio.startListening();
}

//=============

void loop() {
getData();
showData();
}

//==============

void getData() {
if ( radio.available() ) {
radio.read( &dataReceived, sizeof(dataReceived) );
newData = true;
}
}

void showData() {
if (newData == true) {
Serial.print("Data received ");
Serial.println(dataReceived);
newData = false;
}
}

Code transmiter:

// SimpleTx - the master or the transmitter

#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>

#define CE_PIN 9
#define CSN_PIN 10

const byte slaveAddress[5] = {'R','x','A','A','A'};

RF24 radio(CE_PIN, CSN_PIN); // Create a Radio

char dataToSend[10] = "Message 0";
char txNum = '0';

unsigned long currentMillis;
unsigned long prevMillis;
unsigned long txIntervalMillis = 1000; // send once per second

void setup() {

Serial.begin(9600);

radio.begin();
radio.openWritingPipe(slaveAddress);
radio.stopListening();
}

//====================

void loop() {

}

//====================

void send() {

bool rslt;
rslt = radio.write( &dataToSend, sizeof(dataToSend) );
// Always use sizeof() as it gives the size as the number of bytes.
// For example if dataToSend was an int sizeof() would correctly return 2

Serial.print("Data Sent ");
Serial.print(dataToSend);
if (rslt) {
Serial.println(" Acknowledge received");
updateMessage();
}
else {
Serial.println(" Tx failed");
}
}

//================

void updateMessage() {
// so you can see that new data is being sent
txNum += 1;
if (txNum > '9') {
txNum = '0';
}
dataToSend[8] = txNum;
}

Connected is like this: Simple nRF24L01+ 2.4GHz transceiver demo - Exhibition / Gallery - Arduino Forum

Can be problem in Arduino board?

To make it easy for people to help you please modify your post and use the code button </> so your code looks like this and is easy to copy to a text editor. See How to use the Forum

Your TX code is not the same as mine.

Assume that your Arduinos are working perfectly.

The point about asking you to make a drawing of your own connections is that it requires you to examine everything carefully and logically - and you may spot a mistake. Is it possible there is a bad connection somewhere?

...R