An example of my output on my receiver nano is below. Above the last line symbols are just '\n' due to println. Most of the time the receiver is printing just '\n'.
B�!BB�
I am not sure what the problem is as I am followed many tutorials just like this to no avail. Any recommendations would be greatly appreciated.
What happens if you run the examples in Robin2's tutorial? Those are known to work. I use that code as the basis of many rf24 projects.
How are you powering the radios? The Nano 3.3V regulator will not provide the necessary current. Use a better external 3.3V supply. A 2 AA cell battery pack (3V) is said to work. I use homemade power adapters like below with good success. You can try the 10uF to 100uF cap across the 3.3V supply to bolster the 3.3V supply, but that probably will not help in the Nano case.
I tried your posted code on my 2 Uno boards with RF24 modules that I use for development. Those units have the external 3.3V supply in post # 2. The code works fine on my boards. The receiver prints "Hello World" every second.
That suggests a power or wiring problem. The solution to the power problem has been addressed. Run the checkConnection program (reply #30 in the tutorial) to check the wiring between the processor and the radio module. Post the results from serial monitor.
It is often helpful if you can post a schematic and photos of your wiring.
Some other tips:
If using the high powered radios make sure to separate them by a few meters. They may not work too close together. Try the lower power settings.
Reset the radios by cycling power to them after uploading new code. I have found that to help. They do not reset with the Arduino.
Switch to 1MB data rate to catch the not so well cloned clones.
radio.setDataRate( RF24_1MBPS );
Also for some clones, change TMRh20's RF24.cpp line 44
_SPI.setClockDivider(SPI_CLOCK_DIV2);
Into
_SPI.setClockDivider(SPI_CLOCK_DIV4);
Pipe addresses are 5 bytes long, SS01 is just a senseless waste of RAM,
and it could bring someone to believe "ADDREF*CK"would be a different pipe.
If 32 bytes without the trailing zero are transmitted,
nobody can tell how much would be printed.
It does not matter for the simple example,
but a 33 byte buffer would always terminate the printing.
If all you see is “Data received” repeating much more quickly than data is being sent, then there is a problem - most likely the Arduino is not communicating properly with its nRF24. Run the CheckConnection.ino sketch and copy and post the serial monitor output. That will verify the wiring.
Hello and thank you for the speedy response. Running CheckConnection.ino yields the output below.
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
SPI Speedz = 10 Mhz
STATUS = 0xff RX_DR=1 TX_DS=1 MAX_RT=1 RX_P_NO=7 TX_FULL=1
RX_ADDR_P0-1 = 0xffffffffff 0xffffffffff
RX_ADDR_P2-5 = 0xff 0xff 0xff 0xff
TX_ADDR = 0xffffffffff
RX_PW_P0-6 = 0xff 0xff 0xff 0xff 0xff 0xff
EN_AA = 0xff
EN_RXADDR = 0xff
RF_CH = 0xff
RF_SETUP = 0xff
CONFIG = 0xff
DYNPD/FEATURE = 0xff 0xff
Data Rate = 1 MBPS
Model = nRF24L01+
CRC Length = 16 bits
PA Power = PA_MAX
ARC = 15
AND NOW WITH ADDRESS AAAxR 0x41 41 41 78 52 ON P1
and 250KBPS data rate
SPI Speedz = 10 Mhz
STATUS = 0xff RX_DR=1 TX_DS=1 MAX_RT=1 RX_P_NO=7 TX_FULL=1
RX_ADDR_P0-1 = 0xffffffffff 0xffffffffff
RX_ADDR_P2-5 = 0xff 0xff 0xff 0xff
TX_ADDR = 0xffffffffff
RX_PW_P0-6 = 0xff 0xff 0xff 0xff 0xff 0xff
EN_AA = 0xff
EN_RXADDR = 0xff
RF_CH = 0xff
RF_SETUP = 0xff
CONFIG = 0xff
DYNPD/FEATURE = 0xff 0xff
Data Rate = 1 MBPS
Model = nRF24L01+
CRC Length = 16 bits
PA Power = PA_MAX
ARC = 15
It appears the Arduino is not communicating with the NRF module. How would I go about fixing this problem? What sources of information should I use to trouble shoot the NRF24L01 module for future reference? Thanks again!
Wires are about 8" long. I switched the second Arduino to an uno to check if my nanos were faulty. Both Nano and Uno give the same output when running CheckConnection.ino .
I can't tell from the photos, is the 3.3V rf24 module's power supply ground (-) connected to the Arduino ground as well as the rf24 module ground? They must be.
Yes, power supply ground is connected to both Arduino microcontroller grounds and both RF24 modules.
I am not sure what else to troubleshoot. I went through the common problems page and it did not help my specific problem. I am very confused as what this could be.
It seems like this library I am using isn't working correctly with my Arduino and RF24 module. What do you recommend?
The RF24 library and the code in Robin2's tutorial have been proven good over and over. That is what I used to get my radio modules to work and what I use as the basis for all of my rf24 projects.
There are bad modules out there. I bought some myself a while back (from EBay). We have seen others that could not get them to work, but as soon as they got some from a more reputable dealer the radios worked. From where did you buy them?
An alternative to the RF24 modules are the HC12 433MHz modules. Similar range and arguably easier to use (fewer pins). I bought a pair but have not had time or reason to experiment with them.
I solved at least one issue. Turns out one of the wires on the Dupont connector was faulty. I am buying some adapter boards to mitigate this problem. Check connection now yields the below. Does this look correct?
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
SPI Speedz = 10 Mhz
STATUS = 0x0e RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=7 TX_FULL=0
RX_ADDR_P0-1 = 0xe7e7e7e7e7 0x0000000000
RX_ADDR_P2-5 = 0xc3 0xc4 0x1c 0x38
TX_ADDR = 0x0000000000
RX_PW_P0-6 = 0x06 0x00 0x00 0x00 0x00 0x00
EN_AA = 0x3d
EN_RXADDR = 0x03
RF_CH = 0x02
RF_SETUP = 0x07
CONFIG = 0x02
DYNPD/FEATURE = 0x00 0x00
Data Rate = 1 MBPS
Model = nRF24L01+
CRC Length = Disabled
PA Power = PA_MAX
ARC = 0
AND NOW WITH ADDRESS AAAxR 0x41 41 41 78 52 ON P1
and 250KBPS data rate
SPI Speedz = 10 Mhz
STATUS = 0x0e RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=7 TX_FULL=0
RX_ADDR_P0-1 = 0xe7e7e7e7e7 0x000000000e
RX_ADDR_P2-5 = 0x00 0xc4 0xc0 0x1c
TX_ADDR = 0x000000000c
RX_PW_P0-6 = 0x00 0x38 0x00 0x70 0x04 0x00
EN_AA = 0x00
EN_RXADDR = 0x03
RF_CH = 0x0e
RF_SETUP = 0x27
CONFIG = 0x02
DYNPD/FEATURE = 0x00 0x00
Data Rate = 250 KBPS
Model = nRF24L01+
CRC Length = 8 bits
PA Power = PA_MAX
ARC = 0