How do we get messages sent to the serial on an external display? e.g.
20:42:23.442 -> [2890] Connecting to WiFi: MYWIFICONN
20:42:26.872 -> [6341] Using Dynamic IP: 192.168.1.116
20:42:26.952 -> [6341] CONNECTING_NET => CONNECTING_CLOUD
The purpose is to have some of the init messages to guide a user to connect… or to debug when the device is unable to connect to network without having to plug in a serial cable.
The approach I’ve used in the past is to bridge the Rx and Tx pins on the board and run a sketch like this one…
The send_serial function captures the serial output to a variable, which in this case was sent to the terminal widget.
You have to remove the Rx Tx jumper before uploading new code via the USB port, but not for OTA updates.
Also, this line of code: Serial.setRxBufferSize(1024);
is needed to ensure that you have a large enough buffer. Without it you can lose some of the serial output.