I had to have a HomeBridge server already and was running it from a Pi Zero W -- I just decided to bolt it onto the back of the printer and make it pull double-duty as the CUPS box.
A little party trick -- depending on the printer, you might be able to get an "in line" power tap/Y splitter for the power cord to run the Pi and the printer off the same outlet. (My printer takes a normal C14, so I just split and slapped a USB brick on the other end.)
Neat. I am also using a Raspberry Pi to keep my (18 year old) Samsung CLP510N alive, however the Raspberry Pi also runs Pi-Hole (DNS Adblock). I'm curious if i can combine avahi (for air print) and pi-hole?
Interesting: I knew about in-addr.arpa but didn't know they have a bunch of others, including the home.arpa as used it the post: https://www.iana.org/domains/arpa
I’ve been wanting to set this up for a long time for my Dell Color Laser 1320n, however I can’t seem to get printing working from RPi ARM Linux as the drivers only support x86.
I would much prefer a way that doesn't require setting up another computer on the network as a print server when the printer itself is already on the network.
I don’t think such a method exists. Modern printers do usually support driverless printing out of the box, but for older printers that still work well, there was no IPP Everywhere or AirPrint standard when they were manufactured, and there are no new firmware updates. Using another system to translate from these protocols and modern formats like PDF is required
I had a IPP capable printer that wasn’t showing up for AirPrint, and was able to solve that with a (relatively) simple static mDNS entry in my DNSMasq config, which I already had running on our router.
The article says the formats need to include ‘image/urf’, which afaik wasn’t true in 2017, and there may be other salient differences these days. We subsequently moved to a newer printer w/built-in AirPrint.
I see that note, and the wording on it confuses me. My recollection, and some confirmation from this article [1], is that I was using handyPrint when connected to the mac via USB. At the time of the blog post I wrote, I was switching from usb to ethernet, and discovering that I didn’t need a separate computer to make the bonjour / mDNS announcements.
It’s still reliant on the printer handling the correct print protocols (so that CUPS isn’t needed to translate), but my specific printer did work.
I don't find solutions that amount to "just configure a computer on every network you encounter as a print server regardless of whether you own the network" to be very interesting. Using a container doesn't solve the problem unless that container is running on my phone.
Yes, because a person doesn't only ever want to print things to their own printer on their own network. Sometimes a person wants to be able to ask their friend "Hey, can I print something?" while over at their friend's house.
The problem is iOS's unwavering demand for AirPrint and fundamental disrespect for every pre-existing CUPS printer that still works perfectly with every macOS, *nix, and Windows PC. Every computing device on the planet other than iPhones and iPads prints just fine to network printers that don't support AirPrint. So, yeah, it would be best to fix that problem on the mobile device side, because the problem is the mobile device itself not the network or the printer.
macOS automatically detects my Brother HL-2280DW just fine even without a custom Brother CUPS driver installed, because that printer already supports Bonjour, but iOS refuses to see it.
If the printer supports IPP advertised via Bonjour (mDNS), with PDLs including PDF, then I think all that's missing is the Apple Raster (image/urf) PDL on the mDNS entry and the URF entry. The image/urf support doesn't have to be real, since it's proprietary CUPS on Linux won't support it but I haven't run into an issues yet, I think iOS uses it mostly as a marker and otherwise respects the pdl ordering. You might look at the Discovery app to see what the mDNS records its currently advertising are. The URF entry can encode a bunch of information (info here: https://wiki.debian.org/CUPSAirPrint), but I've gotten away with URF=DM3.
I believe many Bonjour printers are of the kind that you can create by plugging a USB printer into an Airport, and they require a driver on the client. Apple makes this pretty simple by automatically searching for the driver based on the usb_MFG and usb_MDL from the printer's IEEE 1284 Device ID. None of these drivers would work on iOS, given its a different OS on a different architecture. I think AirPrint was the first driverless printing standard, followed by the PWG standard, and since they used existing technologies I assume they wanted iPhone users to only see printers which would actually work.
Bonjour also supports PostScript printers, which would use a PPD file on the client to configure the UI options and generate a PostScript preamble (this also requires generating a PostScript file from a PDF on the client -- a somewhat expensive operation). I don't know much about this apart from the couple of times its mentioned in the spec: http://devimages.apple.com/opensource/BonjourPrinting.pdf.
The practical solution is to have your friend configure a print server and advertise AirPrint mDNS on their network -- besides printing from my own iPhone, having friends be able to print to my decades-old but mighty HP LaserJet just by hopping on WiFi has been great.