Monitoring batch jobs the Cylon way with Python and a parallel port

parallel-port-trigger

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.

Continue reading to see a video of his parallel port trigger in action.

Comments

  1. fartface says:

    Transcoding on a computer that has a parallel port?

    EWWWWW! No thanks, not interested in taking days for a bluray to transcode on such old hardware.

    • Fritoeata says:

      What’s the only thing better than the best rig on the planet?
      …The rig you already have!

    • Ben Ryves says:

      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.

    • Morgauxo says:

      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.

    • lwatcdr says:

      You see there are these things called slots….
      Parallel ports are super easy to interface too and very handy for all sorts of projects.

      So pop one of these are your uber latests and greatest http://www.newegg.com/Product/Product.aspx?Item=N82E16815124083
      And if you have a PCI slot this is even cheaper.

      http://www.newegg.com/Product/Product.aspx?Item=N82E16815166005

  2. Alex says:

    It seems most motherboards still have a parallel port these days, just in the form of a header not a DB25. Yeah, even the i7 and DDR3 based ones.

  3. Andrew Smith says:

    I want a parallel port and a serial port too.
    This is a good idea, I have a my cron jobs email me when I need to take action or when they’ve just finished a backup

  4. tantris says:

    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)

  5. arnold says:

    Can’t we transcode in the cloud already? Any easy ways to get that up and running?

  6. Hirudinea says:

    Since your using a parallel port (and they do rock!) why not ring a physical bell when the transcoding is done, bells rock too.

  7. NewCommenter1283 says:

    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

    PS SEARCH HACKADAY “IDE STK200″

    … takin bak the computer man

  8. metalwolf says:

    You could have used parashell to run the leds. This works too.

  9. anon says:

    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.

  10. mail junky says:

    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

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,353 other followers