I am trying to get wireless communication going between two Arduino Nano's using the nRF24L01 tranceivers. I have tried every sample program out there, but the radio.Write() function always fails. I started with this hardware: Amazon.com.
I have checked my wiring over and over.
I have added a capacitor across the power to the module
I have tried every sample program I could find.
I have purchased two more tranceiver modules and swapped them out.
So far, nothing has worked.
The only thing I can think of is that the 5v line out of the Nano cannot power the transceiver module and power adapter. Could this be? It appears to be powered up and when I am able to communicate with the radio.
A common problem with nRF24 modules is insufficient 3.3v current from the Arduino 3.3v pin. This seems to be a particular problem with the nano. The high-power nRF24s (with the external antenna) will definitely need an external power supply. At least for testing try powering the nRF24 with a pair of AA alkaline cells (3v) with the battery GND connected to the Arduino GND.
Wireless problems can be very difficult to debug so get the wireless part working on its own before you start adding any other features.
The examples are as simple as I could make them and they have worked for other Forum members. If you get stuck it will be easier to help with code that I am familiar with. Start by getting the first example to work
There is also a connection test program to check that the Arduino can talk to the nRF24 it is connected to. If the first example does not work be sure to try the connection test for both of your Arduinos. Nothing will work if the connection test fails.
If you are using the high-power nRF24s (with the external antenna) it may help to have a distance of about 3 metres between the two nRF24s so that the signal does not overwhelm the receiver. However someone on the Forum has had them working without that separation - I don't have any personal experience with them. If you are new to nRF24s it may be better to start with a pair of low power modules with the pcb antenna.
Thanks for the info.
I am using the high power modules with an antenna. They also have a power supply board that runs on 5v from the Arduino Nano.
In order for the write to work, do you need a working receiver running? I'm wondering if it fails because it does not receive an acknowledgement. Maybe the problem is with the receiver??
I'll start with your examples and see what happens from there.
sgomon:
In order for the write to work, do you need a working receiver running? I'm wondering if it fails because it does not receive an acknowledgement. Maybe the problem is with the receiver??
Until you can successfully receive data there is no way to know whether the fault is with the receiver or the transmitter. And if you can receive data you only know that both are working.
I'll start with your examples and see what happens from there.
Before that, start with the connection test program.
I ran the connection test program on the transmitter and got this:
CheckConnection Starting
FIRST WITH THE DEFAULT ADDRESSES after power on
Note that RF24 does NOT reset when Arduino resets - only when power is removed
If the numbers are mostly 0x00 or 0xff it means that the Arduino is not
communicating with the nRF24
This is the output of the first transmitter program in your tutorial:
SimpleTx Starting
Data Sent Message 0 Tx failed
Data Sent Message 0 Tx failed
Data Sent Message 0 Tx failed
Data Sent Message 0 Tx failed
Does a receiver have to be running at the same time or could it be failing because I was not running the receiver. Also if running both and it fails, how do you know whether it is the transmitter or receiver that is failing?
sgomon:
I ran the connection test program on the transmitter and got this:
That suggests that the Tx Arduino is talking to its nRF24. But you also need to do that test for the Rx Arduino
Does a receiver have to be running at the same time or could it be failing because I was not running the receiver. Also if running both and it fails, how do you know whether it is the transmitter or receiver that is failing?
Sorry, here is the output from the test run on the receiver:
CheckConnection Starting
FIRST WITH THE DEFAULT ADDRESSES after power on
Note that RF24 does NOT reset when Arduino resets - only when power is removed
If the numbers are mostly 0x00 or 0xff it means that the Arduino is not
communicating with the nRF24
I did get something to kind of work. I am running the GettingStarted_HandlingData example from RF24. If I set one unit up as radioNumber = 1 and role = 1, and the other as radioNumber=0 and role = 0, data is transmitted. The transmitting unit still gets a return value of 0 when doing a radio.write(), but the data is getting picked up by the receiver. If I swap the radio numbers and roles, between the two units, nothing works.