The Remote Serial Debugging Nightmare

The Remote Serial Debugging Nightmare

Everybody playing around with hardware that has a serial port and is not located close to the desk will sooner or later run into the problem, that the wire simply gets to long for a serial connection, especially with non EIA-232/RS-232, known as serial-TTL-UART.

Especially for debugging such hardware protocols, it is nice to have a terminal program, that also shows hex output and can understand hex input. Hterm is one of my favorite programs, when it comes to debugging serial stuff from a microcontroller.

Unfortunately, hterm is neither open source, nor does it support TCP-serial-bridges directly. And also many other tools lack some stuff. While Putty can simply use it’s telnet protocol, it is missing a hex dump and input.

If you still want to use hterm, you have mostly three options (the latter two are mostly the same but differ in price):

  • Using a virtual COM port software (e.g. com2tcp, has an unsigned driver 🙁 )
  • Buying a professional/dedicated seriel2ethernet server (like in the picture of the post)
  • Use another ESP32/ESP8266 to create your own serial2ethernet server (quick hint: disable logging with baud: 0 setting to use the USB serial port for this)

Both solutions are not the best choice in my opinion, because with ESPhome StreamServer Component (using telnet as transport), you already have a serial port over TCP available. To why not connect directly using telnet.

Tera Term – Not best in class, but all you need

If you install e.g. StreamServer (yes, it is f*** easy to deploy) on your ESP32 or you use ESP-Link for ESP8266, you have the serial port you want. Now you need the appropriate terminal program to connect to it.

It perfectly works with putty, if you only want to send and receive ASCII text, just select telnet and enter the IP and port of your ESP.

But when it comes to hex (like in my Buderus KM271 post), you are simply lost with putty and you also can not easily connect hterm to it, without using a nasty com2tcp tool, running long wires or using the mentioned helper-ESP.

After configuring tera term appropriately, it seems to work quite well. Not as good as hterm, but better than the other options:

themole

2 Kommentare

Intensive Underground Metering – An RJ45 Breakout for Connecting Your Meters Through Ethernet Cabling – MolesBlog Veröffentlicht am17:17 - 11. Februar 2024

[…] To evaluate the functionality of the board, I connected a standard USB-RS485-converter to the same bus, where my breakout and a WAGO Energy Meter (MID) 879-3000, configured (using Bluetooth) to have the Bus ID 100 and a ModBus rate of 115200 Baud. For remotely accessing the USB-RS485-converter, I installed ser2net on a linux PC and made the serial interface available on a TCP port. As the terminal to access it, I used CoolTerm, since it is one of the few, that support connecting to a TCP serial without nasty Virtual COM port drivers (see my post about serial debugging over network). […]

Reverse Engineering the Buderus KM271 – And Making It WiFi-Flying on ESPhome and Home Assistant – MolesBlog Veröffentlicht am16:37 - 26. November 2022

[…] See my blog post to get to know how to access serial data over ethernet on windows: The Remote Serial Debugging Nightmare […]

Schreibe einen Kommentar