AsyncWebSerial: Simplify ESP32 debugging and logging with seamless browser-based serial communication.
- Browser-Based Serial Access: Log and debug ESP32 microcontrollers directly from a web browser using the Web Serial API.
- Real-Time Communication: Stream logs and data in real time, eliminating the need for traditional serial monitors.
- Asynchronous Operation: Leverages asynchronous processing for smooth and efficient communication.
- Cross-Platform Compatibility: Works on any browser that supports the Web Serial API, no additional software required.
- Customizable Integration: Easily integrates into ESP32 projects, enabling tailored debugging and logging workflows.
- User-Friendly Interface: Provides an intuitive way to monitor and interact with the ESP32 during development.
Install frontend dependencies:
yarn && yarn build
[env:esp32]
platform = espressif32
board = esp32dev
framework = arduino
monitor_speed = 115200
lib_deps =
circuitcode/AsyncWebSerial
#include <AsyncWebSerial.h>
AsyncWebServer server(80);
AsyncWebSerial webSerial;
void setup() {
webSerial.begin(&server);
server.begin();
}
void loop() {
webSerial.loop();
}
webSerial.println("Hello, World!");
webSerial.printf("Hello, %s!", "World");
You can use the onMessage
method to receive data from the AsyncWebSerial. The method accepts a callback function that will be called when data is received. The callback function can accept both const char *
and String
data types.
webSerial.onMessage([](const char *data, size_t len) {
Serial.write(data, len);
});
webSerial.onMessage([](const String &msg) {
Serial.println(msg);
});
Navigate to http://<device-ip>/webserial
to access the serial page.
This project is licensed under the MIT License - see the LICENSE file for details.