I am using 2 Arduino nanos and 2 NRF24L01+PA+LNA modules. I have mostly been following this tutorial, and I have verified everything is connected to the correct pins. I have also tried directly powering the nRF2401 modules with 2 AA batteries, as I heard the onboard 3.3v isn't always enough.
Transmitter:
#include <SPI.h>
#include <RF24.h>
#include "printf.h"
RF24 radio(7, 8); // CE, CSN
const uint64_t pAddress = 0xB00B1E5000LL;
#define DHT11_PIN 2
void setup(){
Serial.begin(9600);
printf_begin();
if (!radio.begin()) {
Serial.println(F("radio hardware is not responding!!"));
while (1) {} // hold in infinite loop
}
radio.setPALevel(RF24_PA_LOW);
radio.setChannel(25);
radio.openWritingPipe(pAddress);
radio.stopListening();
radio.printDetails();
radio.printPrettyDetails();
Serial.print("channel = ");
Serial.println(radio.getChannel());
}
void loop(){
const char text[] = "Hello World";
bool status = radio.write(&text, sizeof(text));
Serial.print("Transmission Status: ");
Serial.println(status);
delay(1000);
}
Transmitter output:
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 = 0xb00b1e5000 0xc2c2c2c2c2
RX_ADDR_P2-5 = 0xc3 0xc4 0xc5 0xc6
TX_ADDR = 0xb00b1e5000
RX_PW_P0-6 = 0x20 0x20 0x20 0x20 0x20 0x20
EN_AA = 0x3f
EN_RXADDR = 0x03
RF_CH = 0x19
RF_SETUP = 0x03
CONFIG = 0x0e
DYNPD/FEATURE = 0x00 0x00
Data Rate = 1 MBPS
Model = nRF24L01+
CRC Length = 16 bits
PA Power = PA_LOW
ARC = 15
SPI Frequency = 10 Mhz
Channel = 25 (~ 2425 MHz)
RF Data Rate = 1 MBPS
RF Power Amplifier = PA_LOW
RF Low Noise Amplifier = Enabled
CRC Length = 16 bits
Address Length = 5 bytes
Static Payload Length = 32 bytes
Auto Retry Delay = 1500 microseconds
Auto Retry Attempts = 15 maximum
Packets lost on
current channel = 0
Retry attempts made for
last transmission = 15
Multicast = Disabled
Custom ACK Payload = Disabled
Dynamic Payloads = Disabled
Auto Acknowledgment = Enabled
Primary Mode = TX
TX address = 0xb00b1e5000
pipe 0 ( open ) bound = 0xb00b1e5000
pipe 1 ( open ) bound = 0xc2c2c2c2c2
pipe 2 (closed) bound = 0xc3
pipe 3 (closed) bound = 0xc4
pipe 4 (closed) bound = 0xc5
pipe 5 (closed) bound = 0xc6
channel = 25
Transmission Status: 0
Transmission Status: 0
Transmission Status: 0
...
Reciever
#include <SPI.h>
#include <RF24.h>
#include "printf.h"
RF24 radio(7, 8); // CE, CSN
const uint64_t pAddress = 0xB00B1E5000LL;
void setup() {
Serial.begin(9600);
radio.begin();
radio.setPALevel(RF24_PA_LOW);
radio.setChannel(25);
radio.openReadingPipe(1, pAddress);
radio.startListening();
printf_begin();
radio.printDetails();
radio.printPrettyDetails();
Serial.print("channel = ");
Serial.println(radio.getChannel());
}
void loop() {
if (radio.available()) {
char text[32] = "";
radio.read(&text, sizeof(text));
Serial.println(text);
}
}
Reviever Output:
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 0xb00b1e5000
RX_ADDR_P2-5 = 0xc3 0xc4 0xc5 0xc6
TX_ADDR = 0xe7e7e7e7e7
RX_PW_P0-6 = 0x20 0x20 0x20 0x20 0x20 0x20
EN_AA = 0x3f
EN_RXADDR = 0x02
RF_CH = 0x19
RF_SETUP = 0x03
CONFIG = 0x0f
DYNPD/FEATURE = 0x00 0x00
Data Rate = 1 MBPS
Model = nRF24L01+
CRC Length = 16 bits
PA Power = PA_LOW
ARC = 0
SPI Frequency = 10 Mhz
Channel = 25 (~ 2425 MHz)
RF Data Rate = 1 MBPS
RF Power Amplifier = PA_LOW
RF Low Noise Amplifier = Enabled
CRC Length = 16 bits
Address Length = 5 bytes
Static Payload Length = 32 bytes
Auto Retry Delay = 1500 microseconds
Auto Retry Attempts = 15 maximum
Packets lost on
current channel = 0
Retry attempts made for
last transmission = 0
Multicast = Disabled
Custom ACK Payload = Disabled
Dynamic Payloads = Disabled
Auto Acknowledgment = Enabled
Primary Mode = RX
TX address = 0xe7e7e7e7e7
pipe 0 (closed) bound = 0xe7e7e7e7e7
pipe 1 ( open ) bound = 0xb00b1e5000
pipe 2 (closed) bound = 0xc3
pipe 3 (closed) bound = 0xc4
pipe 4 (closed) bound = 0xc5
pipe 5 (closed) bound = 0xc6
channel = 25