Having configured USB printer using p910nd on my OpenWrt router I thought about the printer's nozzles drying.
Here is solution I came up with.
- Prepared a file using all ink colors my printer use (CMYK) and printed it from a machine with the printer properly configured (drivers installed etc)
- Captured net traffic to the p910nd print server with WireShark (no problems since it's not encrypted)
- Made file cmyk.pjl from captured data, gzipped it (it was rather big because windows driver sent a bunch of zero bytes to reset the printer I presume) and put the file to the router
- Added cron job:
#Printer nozzle dry prevention 0 08 */4 * * /bin/zcat /path/to/file/cmyk.pjl.gz > /dev/usb/lp0
I chose every 4th day because it gives maximum 7 days between runs in case of 31 days in a month, although I think to change it to run each 5th day to reduce ink and paper waste
Despite of all docs and examples for file printing such a way with PJL, PostScript, PDF I've found on the web, I could not prepare a file good enough for my printer to print it . So I end up using WireShark...
Is there any drawbacks in this solution or how to do it better?