Monitoring Batch Jobs The Cylon Way With Python And A Parallel Port


If you happen to do a lot of video encoding, you know that your computer can really drag while the process is carried out. Our own [Mike Szczys] transcodes videos at home fairly often, and because the process is automated, he doesn’t always know if a conversion is taking place in the background.

He has been tinkering with Larson Scanners recently and thought he could put everything he’s learned along the way to good use by using the scanner as a “busy” indicator for his PC. He hooked the scanner up to the computer’s parallel port, and took a few minutes to bang out some Python code that would alert him when his PC was busy.

He set his notifier script to launch along with FFMPEG, whenever his MythTV setup had something ready to convert. The Python script drives a pin on the parallel port high, triggering the Larson Scanner’s animation. Every minute, the script checks the status of FFMPEG and continues to hold the pin high until the application exits. Once the conversion is done, the scanner goes back to sleep, letting [Mike] know that the coast is clear.

Check out the video below the break to see his parallel port trigger in action.

14 thoughts on “Monitoring Batch Jobs The Cylon Way With Python And A Parallel Port

    1. You can add parallel ports to the latest and greatest machines (there are even PCI Express cards for that purpose). I added a 2x serial and 1x parallel port PCI card to my PC to support my collection of programmers, and as Mike Szczys points out they’re a very easy way to interface your own projects with a PC.

    2. Parallel ports Rock! 8 inputs, 8 outputs, addressable at an address that never changes. Contrast that to USB which is completely dynamic and can show up in a different place (ttyUSB0,1,..n) or (COM0,1…n) based on what order you happened to plug your removable devices in today…

      As other posters mentioned, it’s usually still there as a header if not a convenient connector even in new computers. If not, get an expansion card! Most motherboards still have one actual PCI slot or you can use PCI Express if you don’t need that for video.

      Better yet, buy a server motherboard, not one of those cheapie consumer things that most computers are made from these days. Something with actual expandibility, ie more than a few expansion slots plus RS232 and Parallel. It makes things so much easier!

      Yes, they do still sell such a thing. It’s more expensive but that’s because the hard to expand stuff is cheaper than the old parts were, not because the price of an expandable board has risen.

      We are makers afterall, why use the same throwaway hard to hack crap as all the norms?

      Or is it that everything has to be portable now? Enjoy those laptops, little sealed boxes that cook their own components and become unreliable in as little time as the warranties last. Or tablets with walled garden app stores and no keyboards.

  1. Or use the keyboard leds:
    Ledcontrol is a package designed to show any kind of information on the unused LEDs on your keyboard. Features include blinking LEDs, animations, priority levels etc.
    (and there are other programs as well)

  2. lol everyone here missed the article of how to use an IDE/PATA port as a parellel port…

    think bolting your board to a bracket and plugging in IDE to control it… you may now drool


    … takin bak the computer man

  3. It might be better to write a script that pulls the pin high, runs FFMPEG, then pulls the pin low, and run the script instead of FFMPEG directly. Then you wouldn’t need to check if it’s running every minute. This would only work easily if you only have 1 instance of FFMPEG running at a time.

  4. I like to use freebasic to control the parallel port. You can make a stand along binary, do not need any external code, and you do not have to mess with removing lp that I can remember.

Leave a 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.