Wireless Trace for Debug
Display on a webpage a serial debug trace send by Wifi. Use an ESP32 with small olded to generate the webpage when a distant is connected
In my case, I always use a serial link, 9600 bds, to send messages to outside and later to debug and found the software issues.
My problem is to always have a connected computer to the device to record and analyze later.
Here, a simple proposal, using an ESP32 with small oled (in this case, a Wemos version).
The software is, at this moment quite simple:
- Open the serial link to predefine speed: 9600 bds
- Connect to wifi network, home network
- Initiale server with a port, eiher standard 80, or random one like 6200...
- The main loop is reading all characters from serial link
- Record all of them in a table of 65000 dimension
- When a distant is connected, create a webpage and send all the table content to the webpage, with just transforming the CR/LF by
- The table is rolling index management. If the writing index is at the end, it is restarting from beginning
The beauty of this is that with a correct port forward in the router, it is possible to see the trace from outside home (it is the reason of random port).
The hardware is very simple, just a pullup 10k on the Rx line and a diod, 4148, with the anod on the RX and cathod to the Tx of the device. This is to accept 5V power device.
The software can be improved with using WifiManager to avoid Wifi in hard in the code, enter some parameters such as server port, or even change some color of the log regarding some special string.
In the join SW, I have 2 Wifi connection, in case the first one fail, it will try on the second one
I develop a simple casing, files joined.
So far, I use this for some time and help me to debug some old bugs on a Nixie clock...
Laurent
Build This Project
Bring this design to life with the Elektor PCB Service, powered by Eurocircuits. Upload the project files and order professionally manufactured PCBs or assembled boards through a proven European production platform.
Supporting KiCad, Eagle, Gerber, and ODB++ formats, the service is suitable for everything from prototypes and validation builds to series production and volume manufacturing.
Made in Europe. Fast. Reliable. Professional.

Discussion (1 comment)