Hello everyone, I had a doubt. How can I connect ESP32 camera with a normal ESP32 , such that the esp32 camera clicks pictures and send it to the normal esp32, over wired connection ?
The connection between the esp32 camera and the normal esp32 should be wired connection.
The preferred connection for my project is UART. Can someone please share the pin connections too ?
// ESP32-CAM Serial1 test
// for loopback test connect pins 14 and 15
#define RXD1 14
#define TXD1 15
void setup() {
// initialize both serial ports:
Serial.begin(115200);
Serial1.begin(115200, SERIAL_8N1, RXD1, TXD1);
Serial.println();
Serial.println("serial1 test Rx pin 14 Tx pin 15");
}
void loop() {
// read from port 1, send to port 0:
if (Serial1.available()) {
int inByte = Serial1.read();
Serial.write(inByte);
}
// read from port 0, send to port 1:
if (Serial.available()) {
int inByte = Serial.read();
//Serial.write(inByte);
Serial1.write(inByte);
}
}
run program - connect pin 14 to 15 to form a loopback test
text entered on serial monitor should echo back to screen
the code of post 4 was what I used on a ESP32-CAM using pins 14 and 15
on an ESP32 I tend to use pins 16 and 17, e.g.
// ESP32 Serial1 test - for loopback test connect pins 16 and 17
#define RXD1 16
#define TXD1 17
void setup() {
// initialize both serial ports:
Serial.begin(115200);
Serial1.begin(115200, SERIAL_8N1, RXD1, TXD1);
Serial.println();
Serial.println("\n\nESP32 serial1 test Rx pin 16 Tx pin 17");
Serial.write(" for loopback test connect pin 16 to pin 17\n");
}
void loop() {
// read from port 1, send to port 0:
if (Serial1.available()) {
int inByte = Serial1.read();
Serial.write(inByte);
}
// read from port 0, send to port 1:
if (Serial.available()) {
int inByte = Serial.read();
//Serial.write(inByte);
Serial1.write(inByte);
}
}
however, pins 14 and 15 also work OK - I am using a 38pin ESP32 dev module
Referring to the above diagram by @GolamMostafa , are you talking about the IO#14 & IO#15 pins as RXD1 and TXD1 of your code , or are you talking about the IO#3(U0RXD) and IO#1(U0TXD) ?
what board did you use - I Select Board "AI Thinker ESP32-CAM"
are you sure you have the correct COM port?
if you run the Device Manager does COM port appear/disappear as plug/unplug the microcontroller?
disconnect everything (sensors, motors, etc) from the ESP device
try a different USB port
try a different USB cable (some are charge only)
Proceed in a systematic way. 1. Upload a sketch into ESP32-CAM to blink the onboard LED at 1-sec interval and send the message "Forum" to the ESP32 over UART1 also at 1-sec interval. Check that the onBoard LED blinks.
2. Connect ESP32-CAM and ESP32 using UART1 Port.
3. Uplaod a sketch into ESP32 to acquire signal from its UART1 Port and shows on its Serial Monitor.
4. Check that the onboard LED of ESP32-CAM blinks and the Serial Monitor of ESP32 shows Forum at 1-sec interval.