Playing around with various methods to determine a workable more advanced method to control the HP 5N printer, I have come to realize how naive we were back in the 90's. So I figured I might be able to use the syslog server functionality of the printer to actually get the data I need to figure out the state of the printer and this is partially true, but seemingly nobody ever thought it a good idea to actually log jobs! I can find no way to "set" the log level.
I definitely see some pages and percentages going on there. If I could catch that data and distil the highest number, adding some margins, I could come pretty close to the correct amount of time needed to print the batch and power off the printer after cool down.
I did play around with printing multiple blank pages, both as one document and as one page duplicated a number of times, and as I suspected, the spooler queue is useless to determine anything other than "A job has been added".
At this point in time, I think the most effective way forward is to do something like this.
- Check for job
- Job detected, power on printer and start scanning lpstat -p for page count
- determine power on time from page count
- continue checking syslog for errors
- if error occurs, stop script from turning off printer.
In this scenario, a print would always be ready with the printer neatly turned off unless it ran out of paper or had a jam.
So we found out where the "hack" lies. Good times.