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?