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?
Using HPLIP is recommended for most HP inkjet or laserjet based printers. There may however be devices which work with a default CUPS install, which provides adequate drivers or PPD files.

For some devices the driver is needed because a binary plugin which is installed with the driver is required to be able to use all features of the device (i. e. printing or scanning is not possible without the plugin), to achieve a better printing quality or to speed up printing. See the binary plugins section for more information.

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 HPLIP 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 HPLIP.

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 HPLIP 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 the sane projects driver search engine 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 port connected devices require basic kernel USB support. When using the old kernel USB printer driver which means not using the usb USE flag the following kernel options must be set:

If preferred this driver can be enabled as module which will be called usblp. This also makes testing the usb USE flag easier as one can simple switch between both methods by either disabling the USE flag and load the kernel module or enable the USE flag and unload the kernel module via modprobe. This saves kernel recompilations and machine restarts and only HPLIP needs to be recompiled for the USE flags changes to take effect. If the module should permanently disabled it can be blacklisted to prevent automatic loading at boot time.

Load the usblp kernel module:

Unload the usblp kernel module:

Blacklist the usblp kernel module:

Parallel port connected devices require the following kernel options:

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

Network connected devices do not require special kernel drivers but basic kernel network support.

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 and will be detected with XSane etc.

Printer
After completing hp-setup you should be provided with the option of printing a test page. You can do this later using the "HP Device Manager" or the CUPS web interface which is located at http://localhost:631/.

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

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

Binary plugins
There are some devices which require a binary plugin to use all functions the device provides. A list with devices requiring the binary plugin including the reasons why it is needed is available at the project's homepage. Gentoo currently does not support the binary plugin. hp-setup however tries to automatically install the plugin. The installed files are out of portage's control and are located under  and. For installing just the plugin without configuring printer queues hp-plugin is available. If installing the plugin fails with hp-setup or hp-plugin the plugin installer is available for download here. To install the plugin the downloaded *.run file has to executed in a shell:

Afterwards follow the instructions of the installer similar to hp-setup or hp-plugin

Printing Paused
If printing does not immediately occur after submitting a print job, make sure the printer quene is not paused. Check the CUPS printer administration interface and make sure the printer is not in a paused state. I have no idea why the printer will sporadically enter a paused state. It is something that should not happen, unless the user or administrator explicitly pauses the printer!

/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.

Misleading Generic Error
I recently found, while trying to manage this error or install the HPLIP package, only using this command line method resulted in a working printer. Although command line tools should be extremely stable, with HPLIP whether command line or graphical tools are more stable, is extremely erratic.

If this doesn't work, then try to enable the fax USE Flag as well. It appears the dependencies for the fax USE Flag will be required, even when specifying no fax USE Flag, within hplip-3.13 versions.

Pulling in extra, usually not needed dependencies, is another strong sign; those coding the hplip package are just hacking and requiring every package even though they do not use the packages. Or, they're poorly documenting while they're coding. Either way, nothing looks pretty from my user perspective, something a user should not be experiencing!

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

SOLUTION: Python 3 is set as main python interpreter. HPLP currently does not work correct with python 3. Switching back to python 2 by using eselect python fixes this.

This is further documented at the

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

SOLUTION: Following the upgrade instructions should take care of this as hp-setup tries to upgrade the plugin.

Printing Weird Characters
PROBLEM: The printout contains weird looking characters.

SOLUTION: The printer likely can not handle Postscript Level 3 output. To work around, the printer's PPD file needs to be edited by replacing '*LanguageLevel: "3"' with '*LanguageLevel: "2"'.

See which was initially opened in the year 2008 and  for more information.

HPLIP Specific Printers More Stable within MS Windows
HPLIP specific printers appear to be more stable within MS Windows, and seems to be due to HPLIP not being properly maintained upstream. HPLIP users should expect receiving the above error, "/usr/libexec/cups/backend/hp failed" for a multitude of reasons at least twice or more times a year. When this disfunction occurs, it usually occurs during times when you need your printer the most! Suggest a competiting manufacturer in order to work around these issues. Personally, several years ago, I found HPLIP quite confusing when trying to utilize a command line only environment, which is indicative of somebody not properly building software from the ground up, and depending explicitly on X/Xorg. Another bad sign this package is not maintained upstream, it still depends explicitly on Python 2 when installing the binary flatbed scanner plugin package, while still spawning a generic errors.

Possible Solution to Avert HPLIP Problems
There is a likely solution to averting all HPLIP's problems. Currently there is a package within Gentoo Bugs tracker for net-print/hplip-plugins, but with a depend of net-print/hplip. However, if this net-print/hplip-plugins package were to drop the net-print/hplip depend and only provide the binary plugins, for which is the number one reason why people install net-print/hplip, then it would appear many users would effectively evade all HPLIP errors and problems. Likely 90% of the code within HPLIP are graphical utilities for FAX and FAX EMailing, along with FAX contacts. HPLIP is not usually needed by most, as most printers already use a default CUPS PPD file and driver for printing, only providing binary scanner and maybe some binary printer drivers for some. So, have net-print/hp-plugins EBuild install the binary drivers only without the net-print/hplip depend, perform some minimal configuration and further point users to another web page providing instructions or internal README for configuring their individual devices. This would further follow the ideology of breaking each task into other separate tools, rather than providing one huge blob trying to do everything.

XSane "error during device i/o"
This error likely occurs because of installing an HPLIP package upgrade, without upgrading the binary plugin as well. Even if you have manually upgraded using "hplip-plugin -i", a stale file (ie. /var/lib/hp/hplip.state) may still be leftover from a previous installation. Also, the permissions may not be correctly set for this folder or file. Manually removing this folder (ie. rm /var/lib/hp) and reinstalling the plugin should recreate the folder and resolve this error. (Might find xsane can be run as root and not as user, even though the user is within the /etc/groups file.)

External resources
HPLIP at launchpad Lauchpad bug tracker Launchpad answers Troubleshooting section of the HPLIP knowledge database.