Back in the day when men were men and printers were only build to put ink to paper as effectively as possible, some amazingly robust and capable machine were build. The HP laser-jets of the 90's hold a special place in my heart as I came to know them well. Maintaining a small army of HP 5N printers which were by that time already 10 years old, I really liked these workhorse tanks. As per Unix philosophy, they did one thing but they did it very well indeed.
The abuse my fleet endured in the factory I worked in was something else. Continues use in a harsh climate with powdery residue everywhere. A typical unit needed a clean about every 3 months after which it ran like new. This apposed to newer hardware that would simply give up the ghost after 2 month with no hope in hell of recovering.
Of course the maintenance drill was more involved than simply shaking the cartridge. The unit had to be blown clean with an air hose and the mirror assembly had to be cleaned with wipes, but eventually I could do this in less than 15 minutes, which is less then a new office laser printer for every department every few months. The factory really was terribly dusty.. by design!
So when it came to a home printing solution for al users and devices, I bought me a second hand HP 5N as cartridges are still available in extended versions. Nothing can beat the printing costs for B&W costing about 50 Euros for 10000 prints. TEN *&^&*@# THOUSAND!!! Seeing as 99% of the stuff we print is B&W, this made perfectly good sense.
The only problem with this generation of printers is that they do not perform and connect like modern machine do. These are power hungry beasts even in standby mode and they do not play well with mobile printing protocols. For the later, of course there is CUPS and Avahi got you covered and of course all of you have a Raspberry Pi in your network for various tasks and if you do not? What are you thinking?
But the power thing is a bit of a problem. At idle the thing probably pulls 1.21 Jiggawats and it is LOUD!!! So the current state of affairs that when we print a document, we walk upstairs to the office, turn on the printer and the document starts coming out after about 30 seconds. After the spooler is empty and printing has finished, we turn off the machine and go back to what we were doing. What I would like is for this 25 year old behemoth to have my pages ready when I choose to go and fetch said pages, so some auto power on function that is better than its idle mode.
Introducing the TP Link HS100 grade-A Chinesium el cheapo "smart" plug. A 20 euro device that hooks up to your network and let you control a socket from a mobile device. It needs an app and an account in the cloud and all that jazz. But I do not want to control it from a bloody phone, nor do I want a cloud service to have any type of control over my outlets. I want my printer server to do that.
Luckily this model "smart" plug has already been cracked wide open and a simple bash script can toggle it and get it's status without any added fuss. Here is the github for the script I used. hs100 bash script I did not upgrade the firmware due to the possibility that perhaps new firmware would brick this solution.
The real trick here is to write a script that can accurately determine what is going on. Turning on the printer when a print job is active is simple enough, but to know how long to stay one or when to shut the printer off is going to be the technical part of this gig. At this moment I have the simplest version of the script running on the RPi. When lpstat returns a job, the printer will power on for 10 minutes.
This works perfectly fine for any job 50 pages or less, but it could be a whole lot better. So on this page I'll like to discuss about various options to build...
Read more »
@voxnulla, does not your LJ5 go into POWERSAVE mode? I'm looking at an LJ5 manual and it says after 30 minutes this will happen. Further the manual (http://h10032.www1.hp.com/ctg/Manual/bpl03055.pdf) says the 30 minutes can be shortened (of course it refers to another document for how to do it):
" To change the PowerSave setting:You can change this setting using the software that came with yourprinter (see software and online helps) or through the printer controlpanel by following these steps:1Press[Menu]untilPRINTINGMENUappears.2Press[Item]untilPWRSAVE=settingappears.3Press- Value +]until the setting you want appears.The options are Off, 15 min., 30 min., 1 hr., 2 hrs., or 3 hrs.4Press[Select]to save your selection. An asterisk (*) appears next toyour selection.5Press[Go]to exit the menus "
BTW, my POWERSAVE setting (LJ4) is under the JOBS menu not the PRINTING menu. Mine was set to 30 minutes (default?). So I changed it to 15 minutes.
So, if you let your LJ5 idle until the POWERSAVE message appears on the display what does the script return?
BTW, your (LJ5) manual also says this:
" If the printer is on a network, you will probably want to turn AUTO CONTINUE to ON. "
Guessing, from what I'm reading, this change to ON will stop issues like Paper jams and Out of paper events from taking the printer off line until the even is cleared. I'm still trying to figure out if this is the reason such events prevent the script from working. So far no luck on an LF4. The script continues to not work during such events.
(I see you change this web page to include our attempts at PJL. Nice. Good heavens, it that my hackaday.io name? I registered a long time ago and thought that field was a kind of CV / description. I'll have to mull that over that a bit.)