Dual port serial terminal
I’d like to share a little tool that I made while debugging communication between Arduino and ESP8266. It’s a serial terminal, but not the classic one – it connects to two serial ports at the same time.
The task is simple. I want to the spy serial communication at both lines at the same time. The hardware is simple too – I connected both serial lines to Rx pins of two serial-USB converters. To have more flexibility, I made special cable with switch to change modes between spy (two receivers) and communication (Rx and Tx connected to one converter).
With help of one resistor, I can use the same serial port of Arduino Pro Mini to program it from PC and communicate (with spying) with ESP8266.
OK, that’s for hardware. But what about software? Of course, I can use two serial terminals at the same time, but then I can’t see the correlation between both streams. I need something to display data from two ports in one window. Quick search on the Internet hasn’t returned anything useful. So i decided to make something on my own. It took under an hour to come up with this simple program. It uses two serial ports and displays data from them in two colors, red and blue. That’s all.
The program can be downloaded from my GitHub:
The source code is in the same place: