Intro
For a couple of months I have been investigating mechanisms for connecting remotely to ESP32 SBCs. My interest was stimulated by the Breezybox terminal, which can be accessed through SSH.
I previously looked at SSH and Telnet remote connections and have now investigated remote serial console connectivity.
Local Console Connections
Arduino and IDF IDEs have a Serial Monitor for viewing ESP32 output and entering commands.
There are many alternatives to an IDE monitor; Putty and TeraTerm are my most used PC applications.
Recently I found a simple but useful web page console called web serial terminal. It comprises a single HTML file and doesn't have many features but is easy and accomodating. It works on PC COM ports so can be used for ESP32 or other devices with a serial port.

Plink is a simple terminal, integrated with Putty, which runs on the WSL command line. An add on called Simply Serial allows you to integrate serial terminal options into Windows terminal alongside, Command Line, Powershell, WSL etc.
We now have a wider range of local serial console options. However they do depend on ESP32 being attached to PC via a USB serial cable. I expect that my practical ESP32 systems do not usually need to be situated near or attached to a PC.
WebSerial
WebSerial is a popular choice for a Remote Serial Console. It is propriety code but has free and paid versions. I installed the free version and ran their demo example. Once you have added the library header to a sketch you simply replace any "Serial" function calls with "WebSerial".
The library uses ESPAsyncWebserver to provide HTTP and websocket communication. ESPAsyncWebServer appears to be a solid and widely-used library which is non-blocking so shouldn't interfere with your own code.
WebSerial command input and console output work well and provide a practical solution. The downside is that you need to alter all "Serial" statements in your sketch to "WebSerial". This isn't a problem for your own code but may not be possible when integrating other libraries / code with the remote console.
Duplicate Serial Console Output
I spent some time trying to re-route Serial output to a different destination so that I can direct it to telnet or a web console. Eventually I found it is not possible to re-route Serial from the UART but a reddit post pointed out that you can connect the TX pin on one UART as RX on another, which provides the potential to copy Serial output.Solution
1) Set USB-CDC disabled.
4) Set UART2 (TX=3, RX=4) as mySerial2 (you have to define these pins).
For simplicaity I attach an FTDI serial cable to Serial1. Now any character appearing on Serial Monitor is duplicated on a TeraTerm terminal attached to Serial1. Alternatively, it could be redirected to a Telnet or WebSerial session.
Duplicate Input
It is not possible to share UART0 RX in the same way. If characters were typed on two terminal sessions simultaneously and received on a single RX pin they could corrupt each other.
Triplicate Serial Console
Whereas all Serial I/O can be duplicated with Serial1 we must wait for wifi and webserver/websocket communication to be established before seeing Serial Monitor output on WebSerial and being able to enter commands, as if they are on the console.














































