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).

Serial spy cable schematic

Serial spy cable schematic

Photo of spy cable

Photo of spy cable

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.

Connection from Arduino Pro Mini to ESP8266

Connection from Arduino Pro Mini to 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.

Dual serial port terminal

Dual serial port terminal

The program can be downloaded from my GitHub:

https://github.com/NiceCircuits/DualTerminal/raw/master/DualTerminal/bin/Release/DualTerminal.exe

The source code is in the same place:

You may also like...

8 Responses

  1. sorin says:

    Thank you for sharing
    Very useful
    Maybe you can add also the time for each communication.

  2. Scott says:

    Which USB-serial converters did you use?

    • piotr says:

      I used cheap CH340G converters from China. FT232 should work as good as that. But I think the best choice would be dual UART converter like FT2232. It may preserve timings between signals better.

  3. Dirk says:

    Very usefull,
    what also may be nice te add :
    1. hex codes (0x10; 0x13; …)
    2. bind 2 ports virtually in the software, instead of cable. Like : adruino pc esp8266; but u will have to add direction markers like “>” incoming and “<" outgoing
    3. some small terminal te send data; decimal and hex.
    Thx forr sharing

    • piotr says:

      1, 3 – it may be usefull, I will think about it.
      2 – there are some programs that do that. And the straight and simple solution to bind them in C# may be to slow to be practical. Maybe I will check that in the future ;)

  4. Alper says:

    I am very lucky for finding that page. That will be very useful for my next week task at work. :)

  1. May 6, 2015

    […] [Piotr] was working on a recent Arduino project when he ran into a problem. He was having trouble getting his Arduino Pro Mini to communicate with an ESP8266 module. He needed a way to snoop on the back and forth serial communications. Since he didn’t have a specialized tool for this task, [Piotr] ended up building his own. […]

Leave a Reply

Your email address will not be published. Required fields are marked *