Back to the printer problem
I got an very old Hp Deskjet F375 printer/scanner working with this ct.de article again:
Am Drucker bleiben | c't | heise magazine
(sorry, its behind a paywall, but I have an abo, its only in german, I’m from german). They checked it with a Raspberry PI, but should work in all Ubuntu/Debian versions and other distries you can adapt the commands.
The main things that were helpfull:
(it also helpfull for local usb printer, the full article is also about scanner and multifunction printer)
Print server
Even before you set up the CUPS printing system, you should connect the printer via USB interface and turn it on (in the output of lsusb, the device should show up now):
sudo apt-get install cups printer-driver-all hplip
The command does not only add the actual service, but besides CUPS itself it also adds some packages for common printer models, which come from various free projects and partly from manufacturers. They cover a large part of common printer models.
With the packages “printer-driver-all” you can get all drivers included in Pi OS and with “hplip” you can add some HP specific programs and modules. Some packages also help with the scanner operation of multifunctional devices - thus making possible manual steps unnecessary, which the article recommends for the scanner setup.
To make the printer visible in the network, you have to allow CUPS to share it, share it in the friendly network and allow administrative access to the CUPS web interface:
sudo cupsctl --share-printers
sudo cupsctl --remote-any
sudo cupsctl --remote-admin
It is also necessary to assign the user who will manage the printers to the “lpadmin” group. For the default user “pi” this command does it:
sudo usermod -a -G lpadmin pi
Now you can reach the CUPS web interface in a browser, on a Mac by entering the name with .local appended, i.e. as http://printit.local:631
- 631 is the TCP port CUPS listens on. On a Windows PC, take the IP address of the Raspi instead of “printit.local”; resolving the .local name will not work easily there (see explanations at the end of the article and in the box on p. 20).
Box:
Rights twister: Fun with devices, udev, groups and users
When accessing scanners and printers under Linux, all sorts of things can subtly go wrong. Often it has to do with access rights. When USB devices are plugged in, the udev daemon creates pseudo files in the file tree that are necessary for access. The daemon uses an extensive set of rules for this, which also describes who is allowed to access a device.
For scanners and printers there are special groups like lp and scanner. Regular user accounts like “pi” on the Raspi can be sorted into these groups. The groups also contain special user accounts which have been created for services, for example “saned” for the SANE daemon. If this assignment is missing, SANE cannot control a scanner.
It is easy to find out who owns a device and which group is allowed to access it: lsusb lists all USB devices. With the bus and device number of the scanner or printer you build the device path and display the permissions, for example with getfacl /dev/bus/usb/001/003.
(translated with deepl)