I just programmed two 433MHz RF transmitters and a launcher on a single ESP32 for my project. However, it only prints the debug messages inside the setup() function. Once setup() finishes, it prints the following:
After that, it seems to restart and go through setup() again, never actually reaching the loop() function. Here's the code I have in the setup() function:
void setup() {
Serial.begin(115200);
delay(4000);
Serial.println("ESP32 433MHz receiver");
if (RH_PLATFORM == RH_PLATFORM_ESP32)
Serial.println("RH_PLATFORM_ESP32");
delay(5000);
Serial.println("Receiver: rf_driver initialising");
if (!rf_driver.init()) {
Serial.println("init failed");
while (1) delay(1000);
}
Serial.println("Receiver: rf_driver initialised");
Serial.println("ESP8266 433MHz transmitter");
if (!rf_driver.init()) {
Serial.println("init failed");
while (1) delay(10000);
}
Serial.println("Transmitter: rf_driver initialised");
}
No, it isn't. Post complete code that compiles, runs and demonstrates the problem.
For a transmitter and a receiver, most people use two ESP32s, a TX and RX module, and two sets of code. I doubt that one ESP32 can transmit a radio message to itself.
When starting with RadioHead, get the library examples (ask_transmitter.ino, ask_receiver.ino) working first with two ESP32s, one TX and one RX module. Then try other ideas.