Printing on HP Color Laser 150nw from OpenBSD

       683 words, 4 minutes

I got an HP Color Laser 150nw wireless printer some time ago and never really tried to use it with OpenBSD. Mostly because printers are… printers. But after discovering that it works well on my wife’s Slackware Linux laptop (better than on Windows 10), I decided to give it a try using OpenBSD.

This compact printer has various communication options: a USB plug, an Ethernet port and a Wi-Fi 802.11b/g/n module. It is also compatible with Apple AirPrint. Mine is connected to a WiFi 6 network.

An important thing I learned is that this printer talks SPL. More on this at the end of the post.

Using the printer with OpenBSD

First thing to gather is the IP the printer got from DHCP. That was easy as I register the MAC addresses of all my IoT stuff and assign a fixed IP to those.

Then I had to install and enable a few packages on my OpenBSD 7.6 laptop.

$ doas pkg_add cups

$ more /usr/local/share/doc/pkg-readmes/cups
$ more /usr/local/share/doc/pkg-readmes/cups-filters
$ more /usr/local/share/doc/pkg-readmes/foomatic-db-engine

$ doas rcctl enable cupsd cups_browsed
$ doas rcctl start cupsd cups_browsed

Turn the printer on and connect to the CUPS interface using a Web browser: http://127.0.0.1:631/

Select the “Administration” menu item and authenticate using your unprivileged user credentials.

In the “Printer” section, click the “Add Printer” button.

In the “Discovered Network Printers” section, select “HP Color Laser 150 (HP Color Laser 150)” and click the “Continue” button.

In the “Connection” section, enter the printer connection URL; something like “ipp://192.0.2.101/ipp/”. Then click the “Continue” button.

Fill-in a Name, and more if needed. Then click the “Continue” button. Note that the name field

May contain any printable characters except “/”, “#”, and space

In the “Make” section, select “HP” and click the “Continue” button.
In the “Model” section, select “IPP Everywhere ™” and click the “Add Printer” button.

IPP Everywhere is an exciting version of IPP that makes it possible to print to network printers without special software. You can find out more on the IPP Everywhere technology page .

Once on the “Set Printer Options” page, set whatever is relevant to you. I did set the “Media Size” to “A4”. Then click the “Set Default Options” button.

The printer has been added. Click the link to be redirected to the printer administration page.
It can also be displayed from the “Printers” top menu.

To be able to print from GTK applications, a couple of additional packages are required.

# pkg_add gtk+2-cups gtk+3-cups gtk+4-cups

I tested Atril, Firefox, LibreOffice, Mousepad and Kwrite. Everyone of those could print their content; in Colour or Black&White.

About the HP Color Laser 150nw Linux driver

A driver for Linux can be downloaded from the HP Web site. It contains a PPD file for the HP Color Laser 150nw printer that can be used by CUPS.

$ ftp https://ftp.hp.com/pub/softlib/software13/printers/CLP150/uld-hp_V1.00.39.12_00.15.tar.gz
$ tar xzf uld-hp_V1.00.39.12_00.15.tar.gz
$ find uld -type f -name *ppd
uld/noarch/share/ppd/HP_Color_Laser_15x_Series.ppd
uld/noarch/share/ppd/HP_Color_Laser_MFP_17x_Series.ppd
uld/noarch/share/ppd/HP_Laser_10x_Series.ppd
uld/noarch/share/ppd/HP_Laser_MFP_13x_Series.ppd

The problem is that if you use this PPD with OpenBSD, CUPS will raise the following error message:

"File "/usr/local/libexec/cups/filter/rastertospl" not available: No such file or directory"

Remember now that the printer talks SPL? SPL stands for Samsung Printer Language. AFAIK, this is a proprietary printer language for cheap printers. It is closed source. There is still an OpenSource alternative for some printers using SpliX . But my HP printer is not compatible with this.

The uld/x86_64/rastertospl binary exists in the Linux driver archive but is… a Linux binary. According to what I read, there is no open sources for this binary; no direct way to use it on OpenBSD.

That said, if you’re on Linux or FreeBSD, you can still use the PPD file if you make rastertospl available in the CUPS filter directory. I tested it on FreeBSD 14.2 and it worked. More options are available such as toner save, black optimization, etc. Given the fact that I barely print more that 10 pages a year, those options won’t be missed on my OpenBSD laptop.

Et voilà. I’ll be able to print the Amazon Return Receipts using my OpenBSD laptop 🤭