Software, technology, sysadmin war stories, and more. Feed
Friday, February 24, 2012

LaserJet display hacks for fun and more

Around the time when I was acting as a teacher's assistant for a computer lab at my school, I discovered that we had an extra HP LaserJet just sitting around. I don't know if it had been left by the previous occupant of that space, but it was easily the nicest printer in the entire school. I had some fun with that thing.

As part of my earlier DOS-based print server project, I had started learning about talking to parallel ports in software. It should then come as no surprise that I soon learned about PJL commands, particularly the one which would change the "ready message" from, well, "Ready", to... almost anything you wanted.

PJL RDYMSG was fun! Even though that little printer had approximately 10 characters on its display, that was enough to keep me busy. Naturally, I started with silly static messages like "INSERT COIN". I couldn't add a "FOR 1P START" with so few characters, but a solution was close at hand: flip between messages!

So, soon I had it saying both "INSERT COIN" and "FOR 1P START" just like a classic arcade game by having the computer drive it actively. Granted, I had to keep a small program running the whole time, but it was worth it to blow some minds. Having a printer say something bizarre amused people in and of itself, but having it keep changing was even better.

I think I wound up hacking some code to make it scroll messages very slowly by rendering them as one long string and using a sliding window to push things out. This would yield a series of messages like the following:






... you get the idea. It actually looked pretty nice on there. Unfortunately, it turned out to be too annoying to send anything substantial (like output from BSD's "fortune") through it.

That left me in the realm of display hacks. The last thing I ever really did with that was to write "1 dimensional Pong". Yep. Normally, Pong is played with paddles and the ball has both an X and Y component. Since this was happening on a display which was about 10 characters wide and only 1 character tall, it only had an X component.

Given that there would be no point to actually trying to play this yourself, I just had the computer bounce a little block segment (my "pong ball") back and forth. Of course, what it was really doing is sending a series of RDYMSG updates with the block offset one position from wherever it had been previously, but it looked like movement.

To top off this particular silly display hack, I decided it needed to make a "dink" noise when it bounced off an end stop and changed direction. Since my attached PC was running the show, it knew when that would happen, and it was trivial to make a small sound through the system speaker.

This is the kind of stuff I would do during down time in the lab when there were no systems to be (re)installed, or wires to be crimped, or students to help with some random application issue.

Epilogue: years later, while working at my school district sysadmin job, I needed to chase down a rogue printer which was doing something bad on the network. For whatever reason, I needed physical access to set something straight. There was no map of patch panel ports, so even though I could tell where it was on our switch stack, the trail went cold when it jumped from there into the patch panel.

Rather than poking my head into every single office in the admin building (which had dozens of printers), I just put up a message on that printer's display. Instead of reading "00 Ready" or similar, it said "Please call xxxx" -- my office phone's extension. A few hours later, someone called me, and I thanked them for noticing. I asked where the printer was located, and my mystery was solved. Later, I was able to go straight to it and resolve the issue at my leisure.

I guess the moral of the story is that not all display hacks are wastes of time. Sometimes they can actually save it!