I´m trying to communicate between two ESP32´s using NRF24L01 PA/LNA. I only managed to transmit text which the maximum I got. The problem is that the module was only able to transmit the text right after reseting my esp32 and then always goes silent. I tried also the simplest code from Robin2´s simple tutorial but it was even worse and I didn´t get data transmitted. I also noticed when I upload codes in opposite(to my desired transmitter I upload receiver code and vice versa) it doesnt work at all. I use capacitor between 3.3V and GND.
You will only transmit the descriptor (length, start, ) and not the data.
Likewise, the receiver will receive a bogus pointer, which could even crash the ESP.
I tried to modify both transmitter and receiver code but its not working. Also the posted code stopped working. The nrf24 modules should be fine I also bought new one but it didnt fix the issue.
I also modified your code slightly, you just need to set the correct CE and CS pins in RF24 radio()
#include <SPI.h>
#include <RF24.h>
RF24 radio(7,8); // CE, CSN
void setup() {
radio.begin();
radio.setAutoAck(true); // CRC has to be enabled if AA is enabled
radio.setDataRate(RF24_250KBPS);
radio.openWritingPipe(0xCCCECCCECCLL); // Radio uses 5-byte address space
radio.setPALevel(RF24_PA_MIN,0); // Set PA level to min and disable LNA
radio.stopListening();
}
void loop() {
char text[] = "bgfjds";
radio.write(&text, sizeof(text));
delay(1000);
}
#include <SPI.h>
#include <RF24.h>
RF24 radio(7,8); // CE, CSN
void setup() {
Serial.begin(115200);
radio.begin();
radio.setAutoAck(true); // CRC has to be enabled if AA is enabled
radio.setDataRate(RF24_250KBPS);
radio.openReadingPipe(1, 0xCCCECCCECCLL); //Radio uses 5-byte address space
radio.setPALevel(RF24_PA_MIN,0); // Set PA level to min and disable LNA
radio.startListening();
}
void loop() {
if (radio.available()) {
char text[32];
radio.read(&text, sizeof(text));
Serial.println(text);
}
}
The code works fine, so if you are still not having any luck with this, I would suggest power supply issues per the common issues doc.
Using pins 7 and 8 causes esp32 to crash(because they are connected to flash memory) but i tried many different pins so i´ll have to try using external power supply