Hello,
I have posted this before too I guess.
I am having trouble in order to establish communication between Arduino Uno R3 and ESP32-Wroom-32D. I have connected the Rx pin of Arduino to the Tx pin of Esp32 and the Tx of Arduino to Rx pin of Esp32 via a voltage divider circuit, using 3 10 K ohm resistors.
I have checked the voltage drop across the resistors which is exactly 3.3V as required by Esp32.
The problem is when I upload the code to Esp32 it gives me the following error: Arduino: 1.8.13 (Windows Store 1.8.42.0) (Windows 10), Board: "ESP32 Dev Module, Disabled, Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS), 240MHz (WiFi/BT), QIO, 80MHz, 4MB (32Mb), 115200, None"
Sketch uses 204570 bytes (15%) of program storage space. Maximum is 1310720 bytes.
Global variables use 13416 bytes (4%) of dynamic memory, leaving 314264 bytes for local variables. Maximum is 327680 bytes.
esptool.py v3.0-dev
Serial port COM5
Connecting......................................_____
A fatal error occurred: Failed to connect to ESP32: Timed out waiting for packet header
A fatal error occurred: Failed to connect to ESP32: Timed out waiting for packet header
I tried holding down the 'BOOT' button when uploading the sktech to Esp32 but I found no luck in that, also held the EN button or both but it did not work at all.
Further, I removed the Rx pin of Arduino connected to Tx pin of Esp32 and it worked but it only showed me the 'Serialprint' argument in the serial monitor.
I will publish my both codes here:
For Arduino:
// the setup function runs once when you press reset or power the board
#include <HardwareSerial.h>
void setup() {
// initialize digital pin LED_BUILTIN as an output.
Serial.begin(9600);
}
// the loop function runs over and over again forever
void loop() {
Serial.println("100");
delay(1500);
}
For Esp32:
#include <HardwareSerial.h>
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
}
void loop() {
Serial.print("Data Received: ");
Serial.readStringUntil('/r');
delay(200);
// put your main code here, to run repeatedly:
}
I hope someone can help me or tell me what or where I am going wrong in it?
I just want to establish a simple communication between the two microcontrollers where the Arduino sends data and Esp32 receives it and Esp32 just gives a feedback to arduino that the data has been received, thats why I am using both Tx and Rx pins on the two microcontrollers.
Thanks