RF24 not working on ESP32-S3

I'm working on a drone for my school project. :grinning_face:
I used a NRF24L01+ with PA and LNA.
In my code,RF24 cannot transmit anything on my esp32-s3 boards.
The TX board kept printing 'send failed' and the RX board was quiet.
However,the "GettingStarted" demo could run smoothly,but fails to send anything after changing role.
Here are my codes.
TX

#include<RF24.h>
#include<SPI.h>
#define RF_CE 48
#define RF_CSN 47
#define SCK 21
#define RF_MOSI 37
#define RF_MISO 36
const uint8_t ADDRESS[6]={"12345"};
RF24 radio;
void setup() {
  Serial.begin(115200);
  SPI.begin(SCK,RF_MISO,RF_MOSI,RF_CSN);
  if (!radio.begin(&SPI,RF_CE,RF_CSN)) {
      Serial.println("rf init failed");
      while(true);
  }
  radio.setDataRate(RF24_250KBPS);
  radio.setPALevel(RF24_PA_MAX);
  radio.setChannel(100);
  radio.openWritingPipe(ADDRESS);
  radio.stopListening();
}
uint8_t data=0;
void loop() {
  data++;
  if(!radio.write(&data,sizeof(data)))
  {
    Serial.println("send failed");
  }
  else {
  Serial.println("send success");
  }
}

RX

#include "RF24.h"
#include<SPI.h>
#define RF_CE 48
#define RF_CSN 47
#define SCK 21
#define RF_MOSI 20
#define RF_MISO 19
const uint8_t ADDRESS[6]={"12345"};
RF24 radio;
void setup() {
  Serial.begin(115200);
  SPI.begin(SCK,RF_MISO,RF_MOSI,RF_CSN);
  if (!radio.begin(&SPI,RF_CE,RF_CSN)) {
           Serial.println("rf init failed");
           while(1);
  }
  radio.setDataRate(RF24_250KBPS);
  radio.setPALevel(RF24_PA_MAX);
  radio.setChannel(100);
  radio.openReadingPipe(1,ADDRESS);
  radio.startListening();
}

void loop() {
  if(radio.available()){
        uint8_t data;
        radio.read(&data,sizeof(data));
        Serial.print(data);
    }
}

IT'S DRIVING ME CRAZY,A WHOLE DAY WITHOUT ANY PROGRESS.
Please help!

I think you have a hardware problem, please post an annotated schematic showing exactly how you have wired it. Be sure to show all connections, power, ground, and power sources.
Here, this may help you:
Gil's Crispy Critter Rules for Processor Hardware:

  1. Rule #1: An Arduino is NOT a Power Supply!
  2. Rule #2: Never connect anything inductive (motors, speakers) directly to an Arduino!
  3. Rule #3: Avoid connecting or disconnecting wires while the power is on.
  4. Rule #4: Do not apply power to any pin unless you are certain of what you're doing.
  5. Rule #5: Do not exceed the maximum voltage ratings.
  6. Rule #6: Many Arduinos cannot power transmitters directly.
  7. Rule #7: Before powering your project, take a break and double-check the wiring.

LaryD’s Corollaries:

  1. Coro #1: When starting out, add a 220Ω resistor in series with both input and output pins to protect against shorts.
  2. Coro #2: Invest in a Digital Multi-Meter (DMM) to measure voltages, currents, and resistance.

Note: Violating these rules can turn your Arduinos into crispy critters. For optimal performance, keep your wires under 25 cm (10 inches).

Additional Tips:

  • The L293 motor driver, though common, is inefficient as it can lose around 3V as heat when driving both legs of a motor. Consider using a motor driver with MOSFET outputs to reduce heat loss and conserve battery power.
  • The nRF24 radios do not work very well when powered with an Arduino even if the 5V adapter is used.
  • For more on powering Arduino boards, explore this guide: Powering Alternatives for Arduino Boards.

I used an additional 5V1A USB wire to power the module,but it still can only work with RF24_PA_MIN.The doc said that NRF24L01P only needs ~500ma to work(That's not true :sweat_smile:).
Now I know the problem.
So how much power does it need exactly?

@noname-114514 If you look closely at the chip on the modules, do they actually say nRF24L01 or do they say something like SI24R1 on them?

Correctly labelled RF24 chips tend to do better with power supply issues than the cheap clones, and many of the PA+LNA modules are using clone chips which don't work well at high power.

You can also apply some ghetto shielding, which may help the situation. Scroll down at

You can also play around with the settings like calling radio.setPALevel(RF24_PA_HIGH,0); where the 0 toggles the LNA off, one is on.

It's actually a RF module produced by ebyte(click to get module info)

The power issue was solved.
But there comes a new problem.

If I called stopListening() right after the begin() function,the module can only send without receiving even if I called startListening().
If I called startListening() after begin(),the module would not turn to send mode even if I called stopListening().
It became an one-way transmission. :sweat_smile:
But I would like to send the eular angle and battery voltage back to display on a TFT.

Have you tested with the official gettingstarted examples? I would bet that problem is in the code.

The official gettingstarted examples can work only if I don't change the role of the module.
When I input R on the TX module and input T on the RX module,the two modules cannot transmit to each other anymore,even if I switch their role back.

You can get just wild guesses if you don't post your code.
Did you try to put small delay after start/stop listening?

Just use the original gettingstarted example.
I tried delay(500),no use at all.
Hopefully,the ackpayload demo could run successfully,so I may use that to send data back.

I meant something like delay(5) :wink:

Well,now I have rewrited my code with ackpayload to send data back. :grinning_face:
Maybe the ebyte module can only keep in one mode each time.
Luckily the ackpayload was able to use.