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.

17 thoughts on “Python Script Lets You Monitor Multiple Serial Devices At Once

  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.

    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 to LordNothingCancel reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.