Python script lets you monitor multiple serial devices at once

Not knowing what’s going on inside of your electronics projects can make it quite difficult to get the bugs out. [John] was bumping up against this problem when working on wireless communications between several devices. At just about the same time his friend came up with a script with lets you monitor multiple serial devices in one terminal window.

We’re used to using minicom, a Linux package that does the job when working with serial connections of all kinds. But [John] is right, we’re pretty sure you can only connect to one device per minicom instance. But [Jim’s] Python serial terminal (available in this git repository) allows you to specify multiple devices as command line arguments. You can even use wildcards to monitor every USB connection. The script then automatically chooses a different color for each device.

The image above is from [John’s] wireless project. Even without any other background this shows how easy it is to debug this way rather than tab back and forth between windows which gets confusing very quickly.

15 thoughts on “Python script lets you monitor multiple serial devices at once

    1. Sure, this should work on Windows. It should be platform independent. All you need is python with the pySerial module. We’ve tested it on Linux and OS X.

  1. ?? Wouldn’t GPG’s “less” command have worked just as well?

    It’ll display multiple files and show the last line(s) updated (EOF). Not 100% sure it’d work on raw devices though, and it doesn’t display things in color.

    Just a thought.

    1. And [John] shared the (already working) code-fu, and a pointer to the library used.

      I haven’t played with Lua – so if you care to share *your* code-fu, I might read it. Myself, I’d probably go with C, C++, or lisp ’cause I like simplicity. Although putting together a hardware serial aggregator would also be cool, so you could just hook up all the wires to one board, and screen would handle it all.

      But those are all *vapor*. [John] is sharing non-vapor. Which is awesome when it’s three AM and you just want to see if the hardware bits are properly cooked before stopping to have dinner.

  2. Isn’t this a first-year CS homework assignment? To monitor serial data?
    Call the function twice, pass in a new port, blam. Done.

    1. Sure, it could be a first-year CS homework assignment.
      But you know what; some of us haven’t taken CS, or don’t even have the option.
      I’m delighted to have available a steady stream of /interesting/ hacks, regardless as to their triviality or simplicity.
      This delights me so because I stand to learn from them all, even if I’ve seen or learned similar before.
      Trivializing attitudes on the other hand, often make me question why I even bother reading the comments on this website.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s