willswire / balenaPrint

Managed CUPS on Raspberry Pi devices, running balenaOS
https://hub.balena.io/
Apache License 2.0
90 stars 34 forks source link

Adding printers on Raspberry Pi (1) Model B+ #22

Closed linus-ha closed 5 months ago

linus-ha commented 2 years ago

Adding a printer via the CUPS web interface fails on my rpi (1) that I now reuse as a print server (Thanks a lot for this great project!).

I've gone through a bit of troubleshooting and found the reason the printer setup fails before the driver selection page. The driver list is too long to be parsed by a rather slow pi before a hard timeout is reached, so you receive a rather odd error containing both "Error" and "success" instead of being able to select a driver and therefore add the printer.

A possible fix for me was to run lpinfo -m on the cups container as described here. That way the driver XML gets parsed beforehand and the CUPS GUI can actually display all information in time, so that I was able to add my printer via the GUI as expected after running the command and refreshing the CUPS web interface.

You may want to run lpinfo -m on service startup, so that others don't have to deal with that manually. It seems that lpinfo -m actually caches the available drivers, so that the GUI can be displayed in time even on very slow hardware.

willswire commented 2 years ago

23 should fix this! If you could checkout that branch and test that your proposed idea works in production, I'd be happy to merge it in