Just set up AirPrinting from iPhone via my Ubuntu 10.10 server. I basically followed this http://www.finnie.org/2010/11/13/airprint-and-linux/ but you have to have a second linux box to run avahi-discover, so I took the service XML from here: http://www.rho.cc/index.php/linux2/48-misc/104-printing-from-ipad-airprint-via-cups and modified it to have the right rp and adminurl parameters.
Useful summary about how to do the whole thing is also http://gyttja.wordpress.com/2010/11/11/airprint-on-ubuntu/. Below are my tips.
Useful summary about how to do the whole thing is also http://gyttja.wordpress.com/2010/11/11/airprint-on-ubuntu/. Below are my tips.
- To find out your adminurl go to CUPS GUI, then to Administraton, Manage Printers, then click on your printer name. URL in the browser's address bar is what you need. Replace https with http if applicable.
- Do not forget to add "ServerAlias *" to your /etc/cups/cupsd.conf otherwise you'll get cups error "Request from "fe80::6233:4bff:fef5:fe14%br0" using invalid Host: field "yuserver.local" in /var/log/cups/error_log.
- To find out your "printer-type" I installed "bonjour print services for windows" from here http://support.apple.com/kb/dl999 on my Windows machine, then ran wireshark, set it to capture all UDP packets, then started the bonjour wizard and got the CUPS packet in wireshark:
User Datagram Protocol, Src Port: ipp (631), Dst Port: ipp (631) Common Unix Printing System (CUPS) Browsing Protocol Type: 0x0080105e State: idle (0x03) URI: ipp://192.168.1.30:631/printers/SAMSUNG_Network_Printer Location: "Local Printer" Information: "SAMSUNG CLP 500" Make and model: "Samsung CLP-500 Series (SPL-C)"
So printer-type here is 0x80105E. - rp is just part of adminurl.
- I was also getting "Unable to execute /usr/lib/cups/filter/rastertosamsungsplc: insecure file permissions (0100755)" error in CUPS error log, presumably because I added my printer via CUPS GUI while logged in as non-root user. I just went to /usr/lib/cups and done
chown -R root:root filter/
- Below is what I had to change in cupsd.conf:
--- cupsd.conf.default 2011-01-04 18:18:31.000000000 +0000 +++ cupsd.conf 2011-04-10 20:17:23.000000000 +0100 @@ -1,5 +1,4 @@ # -# "$Id: cupsd.conf.in 8805 2009-08-31 16:34:06Z mike $" # # Sample configuration file for the CUPS scheduler. See "man cupsd.conf" for a # complete description of this file. @@ -18,11 +17,14 @@ # Only listen for connections from the local machine. -Listen localhost:631 +Listen 631 Listen /var/run/cups/cups.sock +# For printing via AirPrint +ServerAlias * + # Show shared printers on the local network. -Browsing Off +Browsing On BrowseOrder allow,deny BrowseAllow all BrowseLocalProtocols CUPS dnssd @@ -34,11 +36,15 @@ # Restrict access to the server...
Order allow,deny + Allow localhost #added by Carl + Allow @LOCAL #added by Carl # Restrict access to the admin pages...Order allow,deny + Allow localhost #added by Carl + Allow @LOCAL #added by Carl # Restrict access to configuration files... @@ -46,6 +52,8 @@ AuthType Default Require user @SYSTEM Order allow,deny + Allow localhost #added by Carl + Allow @LOCAL #added by Carl # Set the default printer/job policies... @@ -122,5 +130,4 @@ # -# End of "$Id: cupsd.conf.in 8805 2009-08-31 16:34:06Z mike $". #
6 comments:
So you need two linux boxes? I currently have a linux debian samba server at home and a hacked router running Optware running my phone server. Seems like this project is very doable. Is it possible to have samba and cups and avahi running on the same box? Any advice in my case?
Thanks.
No, you only need 2nd box to see what printer type cups advertises really. As I said above you can use bonjour print services for windows and wireshark instead. To actually host AirPrint only 1 box is needed. It will be running cups and avahi.
So I can have samba, cups, and avahi all running in the same linux box at once?
Thanks Alexey!
I was able to set up print queues for my old HP LaserJet 1020 which is shared on an iMac, and a wifi Canon MX882. Worked great - until my domain server took a dive. I got it back up and running and can't figure out what changed, except that in the process I ended up setting a different IP reservation on the iMac. I changed the Avahi service settings to the new printer name. I can print from CUPS (Test Page), and from the CUPS shared printer, no problem. But when I try to print from iOS devices (via Avahi), I get the message "you do not have permission to use this printer". Have you encountered this? Do you have any ideas? My other option is to buy printopia, but I'd like to get the free route working.
Jay, my only experience with AirPrint was to follow the other people's instructions plus some wireshark magic. No I have not encountered this and I suggest you look at CUPS logs and arm yourself with google.
Post a Comment