About 12 years ago, I bought a laser printer. Brother MFC HL-2280DW with scanner, fax, ethernet, and wi-fi. It was perfect. Until we got iPhones.

The Problem

I’ve tried setting up airprint via cups a few times over the past four years, but could never get it to work. There seemed to be four essential components:

  • Upstream print driver support
  • cups, of a recent enough vintage
  • bonjour/avahi
  • something-something-mdns? Reflector? Firewall/NAT/something?

My approach in the past was generally to run cups and avahi on a VM, and access it from iPhones on a separate wifi network. As noted above, this never worked. I concluded that the missing piece was a dedicated device on the wifi network, running linux, connected directly to the printer. Until recently, dedicated devices have tended to be kludgy, expensive, bulky, or some combination thereof. Single-board computers like the RaspberryPi have eliminated the expensive and bulky factors, and when combined with a 3d-printed case are mostly non-kludgy.

The Hardware

The SBC landscape has a LOT of cheap options with wifi, most with USB, and a few with ethernet. The OrangePi Zero 3 checked all the boxes, and was available on AliExpress for about $22 USD. There were several 3d-printable enclosures avaiable on Printables, so it seemed like as easy choice. I ordered it.

The SBC arrived yesterday. I had already printed a case for it, and got in assembled in about three minutes. I downloaded the appropriate “minimal” flavor of Armbian-current, wrote it to a MicroSD card, and it came right up and appeared on the (wired, with DHCP) network as “orangepi”. I didn’t have the right DisplayPort adaptor, so I did the initial configuration over SSH. Part of the initial configuration was setting up the wireless connection, which was shockingly simple with nmtui-connect.

I ended up with the device connected to the home network via the internal Wi-Fi, and connected to the printer via the on-board ethernet. Power is provided by a 2A USB power supply.

The Software

I installed cups, brother drivers, foomatic-db(?) and avahi-daemon via apt, and configured cups to listen on the local network (not just localhost) and allow access to the admin page. I stepped through the cups “add a printer” wizard, using an “lpd” connection to the printer’s IP address (print queue for my printer was “BINARY_P1”), and selected the “Share” option. The cups and avahi service weren’t running, so I enabled and started them systemctl and did a confirmation reboot.

The Result

I tried printing out an email from my phone, and for the first time, it worked. I’m pumped.