Hello and simple CUPS addon

At the outset, I would like to say hello to everyone. I have recently been using the Netgear R6220 router with OpenWRT software. I would like to thank everyone involved for the idea and work.

For my part, I missed the ability to control the printer. Unfortunately I didn't get it with the p910nd ... that's why I built a CUPS where it's easy to monitor the number of jobs to be printed.
I posted a simple program at https://github.com/gitkitsune/lpjobmonitor that monitors the CUPS server, and executes certain commands when it detects jobs in the buffer, and after the buffer is empty.
In my case, the program turns on the USB service and the "WPS LED", but instead of the diode I installed an optotriac, which controls the triac that connects the printer to the electrical network.

I will be very pleased if the program is useful not only for me :slight_smile:

1 Like

So, basically when you send a document for printing you turn on the printer and after a while you turn off?
That is, amazing! :rocket:

Yes, that's exactly what happens. The printer is next to the router, and you don't have to manually turn it on and off. The configuration file includes the time between subsequent checks if there is anything in the buffer. After printing, there is also a loop waiting for the next job. If nothing comes, it disconnects the printer. Theoretically, the optotriac can be controlled by turning on / off the USB port, if it only serves the printer and not other devices. Unfortunately, not all devices have the ability to turn on / off USB power, and not all have readily available LEDs or GPIO ports.

sob., 20 lut 2021, 06:20 użytkownik Braian87b via OpenWrt Forum <mail@forum.openwrt.org> napisał: