This project is a Serial Monitor for esp-idf that can be accessed remotely via a web browser.
Webpage are stored in program memory of ESP32.
I referred to this.
ESP-IDF V4.4/V5.0.
ESP-IDF V5.0 is required when using ESP32-C2.
- Write this sketch on Arduino Uno.
You can use any AtMega328 microcontroller.
unsigned long lastMillis = 0;
void setup() {
Serial.begin(115200);
}
void loop() {
while (Serial.available()) {
String command = Serial.readStringUntil('\n');
Serial.println(command);
}
if(lastMillis + 1000 <= millis()){
Serial.print("Hello World ");
Serial.println(millis());
lastMillis += 1000;
}
delay(1);
}
- Install websocket component
I used this component.
This component can communicate directly with the browser.
It's a great job.
git clone https://github.com/nopnop2002/esp-idf-web-serial
cd esp-idf-web-serial/
git clone https://github.com/Molorius/esp32-websocket components/websocket
- Configuration of esp-idf
idf.py set-target {esp32/esp32s2/esp32s3/esp32c2/esp32c3}
idf.py menuconfig
Set the information of your access point.
Set the information of your time zone.
Set GPIO to use with UART.
- Connect ESP32 and AtMega328 using wire cable
AtMega328 | ESP32 | ESP32-S2/S3 | ESP32-C2/C3 | |
---|---|---|---|---|
TX | -- | GPIO16 | GPIO34 | GPIO0 |
RX | -- | GPIO17 | GPIO35 | GPIO1 |
GND | -- | GND | GND | GND |
You can change it to any pin using menuconfig.
- Flash firmware
idf.py flash monitor
- Launch a web browser
Enter the following in the address bar of your web browser.
http:://{IP of ESP32}/
or
http://esp32-server.local/
- You can communicate to Arduino-UNO
WEB Pages are stored in the html folder.
You cam change root.html as you like.