I have two modules of nrf24l01 and an Arduino MEGA & ESP32S. Mega is the transmitter and ESP32S is the receiver.
Issue:
I'm transmitting a simple message. Receiver is getting radio.available() but when printing the message, it's empty. I suspect that it's radio noise or something. I have been trying other solutions and it didn't work, so I reverted back to the extremly basic implementation.
Actual:
No actual communication, radio is empty despite having radio.available()
Expected:
Hello World showing up.
Code - Transmitter:
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
RF24 radio(7, 8); // CE, CSN
const byte address[6] = "00001";
void setup() {
radio.begin();
radio.openWritingPipe(address);
radio.setPALevel(RF24_PA_MIN);
radio.stopListening();
}
void loop() {
const char text[] = "Hello World";
radio.write(&text, sizeof(text));
delay(1000);
}
Code - Receiver:
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
RF24 radio(4, 5); // CE, CSN
const byte address[6] = "00001";
void setup() {
Serial.begin(115200);
radio.begin();
radio.openReadingPipe(0, address);
radio.setPALevel(RF24_PA_MIN);
radio.startListening();
}
void loop() {
if (radio.available()) {
char text[32] = "s";
radio.read(&text, sizeof(text));
Serial.println(text);
}
}
The NRF24l01 have the following pins
Mega connection:
GND => GNDVCC => 3.3VCE => PIN 7CSN => PIN 8SCK => PIN 52MOSI => PIN 51MISO => PIN 50IRQ - NOT CONNECTED
ESP32S connection:
GND => GNDVCC => 3.3VCE => PIN D4CSN => PIN D5SCK => PIN D18MOSI => PIN D32MISO => PIN D19IRQ - NOT CONNECTED


