Whilst I've commercially developed for Linux since 1995, I've not really released any
standalone Linux software. Patches have gone in to the Kernel or other software and I've
created several commercial Linux-based products with my own Linux-from-scratch approach.
I've had most fun with Blackfin uClinux and early ARM Linux, though embedded Debian is now a realistic platform I develop with.
Mrs J was unimpressed that she couldn't print from fancy Apple devices to our behemoth HP laser printer,
as it doesn't natively support AirPrint. Linux to the rescue, with a combination of CUPS
and other twiddles. Configuration wasn't completely straightforward,
so I'm putting this info here as a quick rundown reference of the things I've had to do to get it working.
YMMV, and I may have missed detail, but this is the basic scenario on Debian jessie:
- apt-get install cups cups-gutenprint python-cups magicfilter avahi-daemon
- Edit /etc/cups/cupsd.conf:
- Remove 'Listen' lines and add 'Port 631' instead, to listen on all interfaces
- Add 'ServerAlias *' to make CUPS shut up about .local names and IPV6 stuff
- Possibly add 'Allow From' lines in the <Location> directives as suitable for your network
- echo "image/urf application/pdf 100" pdftoraster > /usr/share/cups/mime/airprint.convs
- echo "image/urf urf string(0,UNIRAST<00>)" > /usr/share/cups/mime/airprint.types
- /etc/init.d/cups start
- Browse to https://your-server:631/ and use the Administration Tab, Add Printer, and, scarily, enter your root login credentials!
- Follow the CUPS webpage setup for your printer. Luckily my HP5550dn was found on the LAN, known and supported. Good luck there.
- Share the printer
- mkdir /etc/airprint ; cd /etc/airprint
- wget -O airprint-generate.py --no-check-certificate https://raw.github.com/tjfontaine/airprint-generate/master/airprint-generate.py
- chmod 755 airprint-generate.py
- ./airprint-generate.py -d /etc/avahi/services
- /etc/init.d/avahi-daemon restart
You may have to poke appropriate holes in your firewall. And if you print, and nothing happens at the printer,
try turning off "Double-sided" in iOS when the option appears (takes about 10 seconds to appear in the dialog sometimes!)