Introduction
In this article I want to give a brief explanation about how to configure a HP Officejet Pro 8020 printer and scanner with OpenBSD.
Packages to install
The printer is connected to my home network via wifi. I therefore want to use cups for printing and avahi for scanning.
pkg_add cups gtk+2-cups gtk+3-cups gtk+4-cups hpaio hplip skanlite
Services to enable
rcctl enable messagebus cupsd cups_browsed avahi_daemon
rcctl start messagebus cupsd cups_browsed avahi_daemon
Firewall setings
Make sure the firewall is opened for certain ports:
pass in proto tcp to port 9100
pass in proto udp to port 5353
Port 9100 is for cups and 5353 is for avahi.
Reload the firewall:
pfctl -f /etc/pf.conf
Setup cups
Navigate to https://127.0.0.1:631 in your browser. Log in to cups webinterface with your username and password. Now add a printer. Select socket and enter the ip address of the printer the following way:
socket://192.168.1.73:9100
Now select the driver from the list. With the hplip package installed you have a long list of drivers available. Select the correct driver for the HP Officejet Pro 8020. Finish the printer setup and print a test page. Make the printer the default printer. Now you can close the browser. And voila.
Setup avahi
With avahi_daemon
running and hpaio installed simply start skanlite and select the scanner.
The scanner will just work.
Conclusion
Setting up the printer and scanner is a bit of work, but it works like a charm for years.