Hello fellow makers and coders, I'm new here. and need some extra help.
I have been working on getting an Arduino Nano RP2040 Connect with NRF24 to connect with an Arduino Uno or Arduino Nano with matching NRF24. Ive tried the Radiohead, RF24, RF24Network and RF24_G. Ive only just gotten RF24_G to work with the Nano RP2040. I have combined some of the example codes in attempt to get a transceiver working.
For problem solving purposes: I'm using a windows 11 gaming laptop, Arduino IDE 2.0, and all libraries on their latest updates as of 4/7/2025. All hardware, assume connections are all correct. I'm using jumper wires and breadboard (for the nano). power through usb. I have 2 18650x2 battery packs with buck converters dialed down to 5v that I can use.
#include <rf24g.h>
struct controls {
int ch1;
int ch2;
};
RF24_G* radio = nullptr;
void setup() {
Serial.begin(9600);
while (!Serial);
Serial.println("Starting");
delay(100);
static RF24_G _radio(0, 7, 8);
radio = &_radio;
radio->setChannel(120);
}
void loop() {
controls data = {12, 220};
packet send;
send.setAddress(2); // Destination = 2
send.addPayload(&data, sizeof(data));
Serial.print("Sending to address: ");
Serial.println(send.getAddress());
Serial.print("ch1: ");
Serial.print(data.ch1);
Serial.print(" ch2: ");
Serial.println(data.ch2);
bool success = radio->write(&send); // ✅ Proper write
if (success) {
Serial.println("Data sent");
} else {
Serial.println("Send Failed!!");
}
delay(1000);
}
In the serial monitor I get:
Sending to address: 2
11:07:38.691 -> ch1: 12 ch2: 220
11:07:38.691 -> writing to this address: 14
11:07:38.861 -> Send Failed!!
On the Arduino Uno I have set up as receiver I have the code:
#include <rf24g.h>
struct controls {
int ch1;
int ch2;
};
RF24_G* radio = nullptr;
void setup() {
Serial.begin(9600);
while (!Serial);
Serial.println("Starting");
delay(100);
static RF24_G _radio(2, 7, 8);
radio = &_radio;
radio->setChannel(120);
}
void loop() {
controls data;
packet getdata;
if (radio->available()) {
Serial.println("packet recieved");
radio->read(&getdata);
getdata.readPayload(&data, sizeof(data));
// data = {12, 220}; // test data variable
Serial.print("ch1: ");
Serial.println(data.ch1);
Serial.print("ch2: ");
Serial.println(data.ch2);
Serial.println(sizeof(data));
delay(1000);
}else{
Serial.println("Failed to recieve");
delay(1000);
}
// Serial.println(radio->available());
}
In serial monitor I get:
11:07:30.751 -> reading from to this address: 14
11:07:30.786 -> reading from to this address: 15
11:07:30.819 -> reading from to this address: 17
11:07:30.851 -> reading from to this address: 18
11:07:30.884 -> reading from to this address: 19
11:07:30.917 -> Failed to recieve
11:07:31.860 -> Failed to recieve (this continues looping)
xxxxxxxxxxx
According to chatgtp, there may be an error in the rf24-g library where the write to and read from addresses are calculated. I'm not sure how to contact the person who made the library to ask so I'm asking the community.
My next steps to the project is to connect a couple joysticks to the Tx along with a few switches to make at least a 6 channel remote control. I plan to connect a screen of some sort and have some info printed to it such as battery voltage, time running, low battery alarm and things like that. on the Rx side I want to get an adafruit 16 servo pwm board to work for a quadruped robot project.
Thank you all in advance!