HPLIP

HPLIP (HP Linux Imaging and Printing) provides printer drivers for HP devices. It also includes scanner, fax support as well as service tools for various multi-purpose peripherals.

Do you require HPLIP?
Most HP printers do not require HPLIP to successfully print from. You can likely use a default CUPS install, which likely provides adequate drivers or PPD files.

If you have a MFD with a scanner feature, then you will require HPLIP as it is likely the scanner driver is provided only as a binary blob. Also, HPLIP with fax USE flag will also be needed if you require support for sending files from your computer to the FAX modem on MFD devices.

(I'll add my own personal note here, there seems to be no difference in print quality or speed when using HPLIP versus the CUPS provided PPD files, and are likely identical in installation aside from what name you give your printer.)

Installation
For printing support, it is recommended to use the new hpcups driver, which you can enable with the hpcups USE flag. The old hpijs driver is still included when you build with the hpijs USE flag.

The default install enables dynamically generated ppd files at runtime. Some printers may still require static ppd files. If you encounter problems when using hp-setup try enabling the static-ppds USE flag and rebuild.

For USB printers has to be built with the usb USE flag. This way it makes use of the user space tool which replaces kernel usb printer support (CONFIG_USB_PRINTER). In case of problems you can disable the usb USE flag for and activate the kernel functionality again. All users who need to access the printer have to be a member of the lp group.

To be able to set up a network printer has to be built with USE avahi or slp. The 1.6 series of has dropped slp support and one can choose to build it with USE avahi or zeroconf. To be able to print on a network printer needs to be built with USE snmp.

For some scanner devices the appropriate sane backend needs to be activated. To find out which backend is required for your device go to http://www.sane-project.org/cgi-bin/driver.pl and search for 'HEWLETT-PACKARD' as manufacturer. This provides a list of all supported devices including the required backend. For instance if the device needs the hp backend the following must be added to the portage configuration to build it when installing :

Kernel
USB connected devices require basic kernel USB support.

Network connected devices require basic kernel network support.

The above two methods are usually already enabled within most kernels.

Parallel connected devices require the following kernel options:

Software
Install :

Printers and Faxes
If installed with enabled qt4 USE flag, use the "HP Device Manager" to configure your devices.

Alternatively you can run hp-setup in a terminal:

For network printer also specify the printer's IP address:

Afterwards you should restart the cups daemon:

Scanners
Overall, scanners should just work if they do not require a binary plugin and will be detected with XSane.

For those requiring the binary plugin for networked scanning devices using the following for installing and upgrading.

Printer
The above command, should provide an option to test print. If it fails printing due to lack of X as root, use your CUPS web interface located at http://localhost:631/ for printing a test page.

Scanner
Use xsane and then press the preview button to ensure the binary scanner driver is installed and working properly.

Upgrading
Every time when upgrading run hp-setup -r to remove all printers and configure them again as described above in the configuration section.

Buggy hp-setup
Install HPLIP with snmp USE flag and try again.

/usr/libexec/cups/backend/hp failed
Edit this and remove the lines prefixed with "State", "Reason" and "Type".

Upon saving the file and restarting the cupsd daemon, printing should resume.

Error on install "File "./plugin_install.py", line 78 except ImportError, e:"
PROBLEM: A snipping of the error follows.

WORK AROUND: The cause is because incompatible coding is being used with Python 3 within hp-setup. To work around, "eselect python list" and "eselect python (set to version 2)". Just remember to revert back to Python 3 version when you are finished installing.

RESOLUTION: This bug is further documented at the following link and there appears to be no fix since 2011.11.16 as of 2012.11.18!

HPLIP ebuild Upgrades Do Not Upgrade Binary Plugin(s)
PROBLEM: The HPLIP ebuild does not upgrade the binary plugin(s) when the ebuild is upgraded. A symptom of this problem, you may get segfaults when starting XSane. (ie. The HP LaserJet M1522nf requires a binary plugin for using the scanning feature.)

WORK AROUND #1: Use hp-plugin -i 192.168.1.27 to manually upgrade the binary (scanner) plugin(s). This method is currently untested.

WORK AROUND #2: Delete all printers within CUPS and use hp-setup after upgrading the HPLIP ebuild. This method does work.