ESP32 Remote Serial Monitor

Ever wanted to monitor your ESP32 logs from your PC or smartphone? Even outside your local network?

Then look no further, here's the solution!

#1 Install the WebTerminal library

Arduino WebTerminal library https://github.com/eloquentarduino/arduino-WebTerminal

WebTerminal library also requires you install https://github.com/256dpi/arduino-mqtt (search for lwmqtt in the Library Manager)

#2 Get the sketch

The following sketch has been autogenerated to contain a unique CLIENT_ID that identifies your ESP32.

You will use the usual ESP_LOGx functions to print log messages and they will be automatically forwarded remotely.

Filename: WebTerminalExample.ino

/**
 * Inspect logs from remote Serial Monitor
 *
 * Be sure to set "TOOLS > CORE DEBUG LEVEL = INFO"
 * to turn on debug messages
 *
 * Be sure to replace your WiFi credentials!
 */
#include <WebTerminal.h>

#define WIFI_SSID "SSID"
#define WIFI_PASS "PASSWORD"
#define CLIENT_ID "01J3JQT3FQJ4S84S8PZHKSNJNN"

/**
 *
 */
void setup() {
    delay(3000);
    Serial.begin(115200);
    Serial.println("___WEB TERMINAL EXAMPLE___");

    // connect to WiFi and remote terminal
    while (!WebTerminal.begin(WIFI_SSID, WIFI_PASS, CLIENT_ID)) {
      Serial.println("Can't connect to web terminal");
    }

    Serial.println("Connected to web terminal");
    Serial.print("Log messages will be visible online at ");
    Serial.print("http://mqtt.eloquentarduino.com/");
    Serial.print("arduino-web-serial-monitor/");
    Serial.println(CLIENT_ID);
}

/**
 *
 */
void loop() {
    ESP_LOGI("APP", "This is a INFO message");
    ESP_LOGW("APP", "This is a WARN message");
    ESP_LOGE("APP", "This is a ERROR message");
    raw_log_i("This message will not be forwarded online");
    delay(3000);
}
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45

#3 Watch the logs

After you flashed the sketch above, click on the button below to see the magic happen!

Open Web Serial Monitor

Due to implementation details, the log viewer page is served over HTTP, so your browser will warn you. Click "Proceed to mqtt.eloquentarduino.com" in the Advanced settings.

Here's a quick demo of the log page

WebTerminal demo

Limitations

This is a free service for hobbyst makers. There's no limit to the number of logs you can receive, but your CLIENT_ID is valid for 1 hour. After that, you will be disconnected and log messages will be rejected.
Also, you cannot send messages back to your board.

Go Pro

If you want to remove the limit of 1 hour or send messages back to your board, drop me an email at

Subscribe to my newsletter

Join 1023 businesses and hobbysts skyrocketing their Arduino + ESP32 skills twice a month