Connecting ESP32-CAM with ESP8266 via UART

I currently have project to send serial command from ESP8266 to turn on flash on ESP32-CAM. below is my basic test function

ESP8266 Code as Sender:

void setup() {
  Serial.begin(115200); // Initialize Serial communication
}

void loop() {
  // Send command to turn on the flash
  Serial.println("FLASH_ON");

  delay(10000); // Wait for 10 seconds

  // Send command to turn off the flash
  Serial.println("FLASH_OFF");

  delay(10000); // Wait for 10 seconds
}

and here's ESP32-CAM as Receiver

#define FLASH_PIN 4  // The flash LED is usually connected to GPIO 4

void setup() {
  pinMode(FLASH_PIN, OUTPUT);
  Serial.begin(115200);  // Initialize Serial communication
}

void loop() {
  if (Serial.available() > 0) {
    String command = Serial.readStringUntil('\n');

    if (command == "FLASH_ON") {
      digitalWrite(FLASH_PIN, HIGH);  // Turn on the flash
    } else if (command == "FLASH_OFF") {
      digitalWrite(FLASH_PIN, LOW);  // Turn off the flash
    }
  }
}

for the pinout connection I've manage to connect:
ESP8266 3.3V --> 3.3V ESP32-Cam
ESP8266 RX0 --> UOT ESP32-Cam
ESP8266 TX0 --> UOR ESP32-Cam
ESP8266 GND --> GND ESP32-Cam

but somehow while the ESP8266 printing to the serial monitor already successful, the ESP32-Cam doesn't seems to do anything about it, not responding to the printed command on the serial Monitor

anybody know how to work on this?

Are you talking about the Camera flash, or the generic esp32 blink led.

I moved your topic to a more appropriate forum category @zhln_uno.

The Nano ESP32 category you chose is only used for discussions directly related to the Arduino Nano ESP32 board.

In the future, please take the time to pick the forum category that best suits the subject of your question. There is an "About the _____ category" topic at the top of each category that explains its purpose.

Thanks in advance for your cooperation.

I might be wrong, but I thought it was an ESP32-CAM board, NOT a NANO ESP32

Correct:

That is why the topic is not appropriate for the Nano ESP32 category that @zhln_uno chose when they created the topic, as I explained in my previous reply. This is the reason why I had to change the category to the more appropriate Networking, Protocols, and Devices.

Timing is everything :grinning: