Like a lot of other folks, I recently updated my iPad to iOS 4.2.1 and began looking to see what worked and what didn’t. After getting over the mute switch, I wanted to try AirPrint. I don’t know how much I’ll ever use this feature but it bugs me that support is limited to so few printers. I have an HP OfficeJet Pro L7680 All in One. I loathe this printer, and don’t recommend buying one but it’s the printer I own. Anyway I thought maybe if I could find enough information on the Internet I could configure my Linux VM to serve up my “incompatible” printer.
Most of what follows is based on a blog entry from Ryan Finne with added help from a blog entry by tjfontaine. I won’t repeat their great work here. Instead, I hope to add more of the noob perspective since I didn’t even know what CUPS was until I began this quest.
My Linux VM is a minimal install of Ubuntu 10.04 server with samba, vsftpd, and nfs. I use it primarily to share a big USB drive to the Windows boxes in my home and also to the ESXi server hosting it. My VM is named
allspice. However, I do not run a local DNS so everything was done using it’s static IP address of
192.168.8.199. Your mileage may vary.
Step 1 was to get the files necessary to support printing from the VM:
sudo apt-get install cups cups-pdf hplip
This got me the CUPS files, the PDF filter, and the support files for my HP printer. With no GUI on the server, the next step was to gain access to the CUPS web interface from another box. I had to modify
0/etc/cups/cupsd.conf because the default file only allows localhost access. Below is a summary of my changes:
#Listen localhost:631 #Listen /var/run/cups/cups.sock Port 631 ServerAlias * <Location /> Order allow,deny Allow @LOCAL </Location> <Location /admin> Order allow,deny Allow @LOCAL </Location>
After restarting CUPS, I could browse
https://192.168.8.199:631 and see the web interface. There I changed the basic settings on the configuration tab as noted. Once the server restarted and the page refreshed, I clicked the Find New Printers button. My network printer was located and included in the list of printers to add. In my case my printer model showed up twice in the list. Both entries appeared identical
HP HP Officejet Pro L7600 (Officejet Pro L7600 [9CD796]) however viewing the page source revealed that one had a URI of:
while the other had a URI of:
I chose the one ending in
_printer._tcp.local. I named it
HPL7680, and chose the appropriate driver from the offered list. The last thing I did was to print a test page and verify that the VM was capable of printing.
Next I jumped in head first and followed my source’s instructions only to get nowhere fast. Something was missing. After a half a day of no-progress I slept on it, and woke up with a fresh idea. I have one other Linux box, an Asus EEE netbook which also is running Ubuntu. I pulled that out and sat down to try and print Ubuntu to Ubuntu. Once I fed it (just) the address of the print server, the netbook detected my printer at
ipp://192.168.8.199:631/printers/HPL7680 and I was able to print a test page.
Now I knew my print server was serving up my configured printer to my network. But the iPad still wouldn’t display it. The problem had to lie in the advahi configuration. I re-ran tjfontaine’s script and had a look at the file it generated:
<?xml version='1.0' encoding='UTF-8'?> <!DOCTYPE service-group SYSTEM "avahi-service.dtd"> <service-group> <name replace-wildcards="yes">AirPlay HPL7680 @ %h</name> <service> <type>_ipp._tcp</type> <subtype>_universal._sub._ipp._tcp</subtype> <port>631</port> <txt-record>txtvers=1</txt-record> <txt-record>qtotal=1</txt-record> <txt-record>Transparent=T</txt-record> <txt-record>URF=none</txt-record> <txt-record>rp=/printers/HPL7680</txt-record> <txt-record>note=HP Officejet Pro L7600</txt-record> <txt-record>product=(GPL Ghostscript)</txt-record> <txt-record>printer-state=3</txt-record> <txt-record>printer-type=0x80901c</txt-record> <txt-record>pdl=application/octet-stream,application/pdf,application/postscript,image/gif,image/jpeg,image/png,image/tiff,text/html,text/plain,application/openofficeps,application/vnd.cups-banner,application/vnd.cups-pdf,application/vnd.cups-postscript</txt-record> <txt-record>adminurl=ipp://localhost:631/printers/HPL7680</txt-record> </service> </service-group>
Using the default options, the file it created contained
adminurl=ipp://localhost:631/printers/HPL7680 which obviously won’t work remotely. I manually changed this to
ipp://192.168.8.199:631/printers/HPL7680 and restarted the avahi-daemon.
My netbook could see
AirPlay HPL7680 @ allspice but not my iPad. I tried configuring the printer on the netbook using the AirPlay configuration. Still no test page was printed. Browsing the CUPS error_log revealed this line:
E [26/Nov/2010:09:31:20 -0500] Bad URI "//printers/HPL7680" in request!
After I changed the line
<txt-record>rp=/printers/HPL7680</txt-record>to remove the leading ‘/’. I restarted the avahi-daemon and finally my iPad could see and more importantly print to the printer.