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.

Comments

  1. cevat candar says:

    very useful. does it any standalone windows program exist for this?

  2. Glenn says:

    Nice, thanks for sharing!

  3. Me says:

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

  4. LordNothing says:

    meh, i do the same thing with lua. all you need is some kinda serial library and some code-fu.

    • rallen says:

      Right… and all it takes to build an Indy race car is some tires and an engine.

    • logical says:

      In linux you can open a serial port and read and write to it just like a file.In any laguage.

    • BBotany says:

      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.

  5. giacomo says:

    @gert Time…

  6. M4CGYV3R says:

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

    • Az says:

      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.

  7. fosafdsadf says:

    Just use screen and be happy ;)

  8. ARF says:

    Looks similar to jpnevulator.

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

Follow

Get every new post delivered to your Inbox.

Join 96,670 other followers