Mostly, It's All About Tech... Mostly.

Raspberry Pi, CUPS for Linux and a USB HP LaserJet P1009

Introduction

(Scroll down to 'installation instructions if you just want to get on with installing CUPS)

For reasons only known to themselves, both Microsoft and HP decided to drop driver support for the HP LaserJet P1000 series of printers on Windows 10 and 11. So if you own a P1005/P1006/P1007/P1008/P1009 printer, you will most probably have a terrible time getting these printers to work on the latest versions of Windows. I managed to get my P1009 working for a single print job only on Windows 10, after which it never worked again, despite how many times I reinstalled the drivers.

It's a travesty that this happens, as these printers are great little black-and-white printers, and no equipment if it's still working, should be consigned to a landfill just because someone at HP decided they were now end-of-life.

But then, this is HP, and as we all know, they just don't care about the environment – if they did, then they wouldn't do all those shady things with 'official printer inks' only and building poor quality super cheap inkjet printers that stop working the moment you turn your back on them.

Anyway, rant over; let's get on to how we get these printers working using CUPS and Linux, and in my case, a Raspberry Pi. However, if you have a Debian or Debian derivative distribution (such as Ubuntu), then these instructions will work for you.

Some personal context first; I have an HP LaserJet P1009 and Raspberry Pi that I have OctoPrint installed on, which is connected to my 3D Printer. When I'm not using the 3D printer, the Pi is sitting there doing nothing, so it was an ideal candidate to become a network print server for the P1009.

Once you know the steps, setting the whole thing up is quite simple. I wasted a fair bit of time browsing the forums and reading conflicting advice. These instructions, however, are correct.

Installation Instructions

(I will refer to a Raspberry Pi in these instructions, but the following will work on any Debian Linux distro-based box)

Login to the Pi locally, or via remotely via SSH, or using the Terminal (if you have a GUI installed)

As is custom, update your repository cache:

sudo apt update

Now install cups:

sudo apt install cups

Then install HPLIP (HP Linux Imaging and Printing):

sudo apt install hplip

Add the 'pi' account (or whatever account you want to use for admin rights in CUPS) to the lpadmin group:

sudo usermod -a -G lpadmin pi

Edit the cupsd.conf file to allow full access to any printers and the web interface:

sudo nano /etc/cups/cupsd.conf

Tell CUPS to listen on all IP addresses, not just localhost/127.0.0.1, by changing the 'Listen' section from this:

# Only listen for connections from the local machine.
Listen localhost:631
Listen /run/cups/cups.sock

To this:

# Only listen for connections from the local machine.
Listen 0.0.0.0:631
Listen /run/cups/cups.sock

Add the 'Allow All' directive to the <Location /> section:

# Restrict access to the server...
<Location />
Order allow,deny
Allow All
</Location>

Add the 'Allow All' directive to the <Location /admin> section:

# Restrict access to the admin pages...
<Location /admin>
Order allow,deny
Allow All
</Location>

That's the minimum changes needed to get the CUPS web interface working across your local network. Save the file and exit your text editor (Ctrl+X in Nano).

I'd recommend a reboot at this point, which is totally against the whole Linux-never-needs-rebooting thing, but as a Windows guy originally, I've come to have faith in reboots giving you a 'known-good' starting point:

sudo shutdown -r now

Once the Pi (or your Linux box) is back up, navigate to the CUPS web interface via a browser on another machine by entering this location:

http://ip-address-or-host-name-of-the-raspberry-pi:631

You should be greeted with the CUPS web interface.

Before adding the HP printer to CUPS, you need to install the firmware files (plus other supporting stuff) to the Raspberry Pi. This step is important, as, without it, your printer will just refuse to print and won't even throw an error.

Log back into an SSH or terminal session on the Pi, and run hp-plugin:

sudo hp-plugin

This part takes a while. What it is doing is connecting to HP and downloading extra proprietary binaries for a range of HP printers. Be patient, and eventually, it will ask you to agree to the licence agreement.

Type Y and let it finish installing.

Again, I rebooted here, you probably don't need to. Your choice.

That's the installation part done. Congrats!

Configuring the HP LaserJet P1006/P1009 under CUPS

Navigate to the CUPS webpage on your Pi and select the Administration tab (you may be asked to login).

Click on Add Printer.

Select the P100x in the list, it will be the one with HPLIP in the name. Mine was called:

HP LaserJet P1009 USB AA1527X HPLIP (HP LaserJet P1009)

Click 'Continue' and edit the description and location as you see fit.

Check the 'Share This Printer' option.

Click 'Continue' and select the correct driver for the printer. It should automatically select the right one, but in case it doesn't, my P1009 is using the P1006 HPIJS driver (the P1006 and P1009 are effectively the same printer):

HP LaserJet p1006 hpijs, 3.18.12, requires proprietary plugin (en)

Click on 'Add Printer'

That's It! CUPS is now done. To test it, on the 'Printers' tab, select your printer, and then select 'Print test page' – and your printer should print. If it doesn't, try power cycling the printer to get HPLIP to send it the firmware (this needs to happen on every power-up of the printer, which is what the HP-Plugin tool sets up).

Windows Configuration

My particular use case is to be able to print to the printer from Windows, so that is what I cover here.

On your Windows machine, go to Settings, and then 'Devices' and then 'Printers and Scanners'.

Click 'Add a printer or scanner'

It will try to search for a printer, but may fail to find it, so click on 'The printer that I want isn't listed'

Then select 'Add a bluetooth, wireless or network discoverable printer'

After a short while of probing the network, Windows should display the new printer; on my system, it looked like this:

HP LaserJet P1009 @ OctoPi

Follow the prompts, and let Windows install the drivers for it.

Once it's installed, Select it in the list on the 'Printers and Scanners' page and select 'Manage', then select 'Print a Test Page'. If everything is working – the test print should be printed, and you are good to go!