Sunday, June 21, 2015

[solved] xsane detection of older or all-in-one HP printers

Sometimes you've got an old HP printer missing print heads or some such, but you still want to use it for scanning. Not all printers can be directly accessed using scanning software, such as SANE, unless the entire printer has been installed using printer software "drivers" (in Windows terms). This is often the case with HP's. To install HP printers, the standard "driver" package is HPLIP. HPLIP is available on Arch repos, however the Arch version of HPLIP doesn't include the specialized PPD's necessary for the printer. (See Section 3 below).

A recent encounter with a broken old HP OfficeJetPro L7590 was a case in point. I only needed this printer to scan. I turned the printer on, and connected the USB. My box detected the USB connection, but /etc/sane.d/dll.conf could not be modified for SANE to successfully communicate with the HP. The standard symptom of this existed: $ sane-find-scanner located the printer, but $ scanimage -L did not. So, good connection, but no scanning: I would have to install the printer driver. Here are the steps.


As just noted above, SANE was properly installed. That was simply:
# pacman -S xsane
Xsane pulls-in SANE software as dependencies, so no need to separately install SANE.


As also noted above, after we'd had SANE in, we'd connected everything (USB cable to scanner, powered on scanner) and attempted $ sane-find-scanner. This detected the printer, but $ scanimage -L did not. Since we were dealing with an HP, we needed the HP Linux printer driver set, HPLIP.
# pacman -S hplip

3. PPD

As noted at the outset, the Arch version of HPLIP does not include PPD's. PPD's are information files specific to each printer model. Both CUPS and HPLIP rely on them. Since the Arch version of HPLIP does not include them, the attempt to install an HP printer ($ hp-install -i) fails at the PPD step. Where to get the PPD for HP printers?

Go to the HP support website and download the tarball of the full version of HPLIP. Uncompress it. Enter the uncompressed folder and locate the "ppd" folder. Find the PPD for your model. After you unzip that PPD, put it anywhere you can easily remember, say your home folder. Now you are ready to complete the HPLIP printer driver installation.

4. Finally

Run $ sane-find-scanner again, and write down the USB number. In this case, let's say it was "002:003". Then we simply run...
$ hp-install -i 002:003
...and follow its prompts. At some point, the HP install dialog will prompt you for a path to the PPD. Provide the path to wherever you put it, eg. "/home/foo/hp_l500.ppd". The installation of the printer will finish normally1.

After HPLIP and the proper PPD are present, and the scanner is connected, our last test is to $ scanimage -L . We should see the scanner:
$ scanimage -L
device `hpaio:/usb/Officejet_Pro_L7500?serial=MT97K251CP' is a Hewlett-Packard Officejet_Pro_L7500 all-in-one
Now we can fire-up Xsane and scan.

1 If also needing to print with this printer, do a customary CUPS printer installation (after doing the steps above). Assuming the CUPS daemon is already running and permissions are correct, access the CUPS'administrative page at http://localhost:631 and add the printer to CUPS.

No comments: