Skip navigation

Category Archives: Printing

Click here for a tl;dr version that just gives you the fix without the background.

At my school, we have a fairly robust iPad program, and the decision was made, when we began to ramp up the deployment of iPads, that users should be able to print to their iPads.

Like so many of Apple’s technologies, AirPrint is one of those things that works well in a home environment but pretty quickly breaks down when taken into an enterprise environment.  Sure, you could go out and buy all new printers that have AirPrint built in, but when you’ve got a dozen or more printers that you might want to have available for iPad users, that quickly becomes a very expensive proposition.

You can roll your own AirPrint solution using a Linux box running avahi, but most people and departments would rather have a pre-baked solution, and then there’s only really one option: Printopia Pro.  If you’re running any sort of Bonjour gateway, such as the one built in to Cisco’s wireless access point controllers or Aerohive’s HiveManager cloud controller, you don’t even need more than one instance of the software.

And then Apple broke it all.

An engineer at the company that now develops Printopia Pro told me that for iOS 8 and OS X Yosemite, Apple moved away from a widely-used open-source mDNS discovery daemon to their own, in-house-developed daemon, and that’s where all the trouble started.

In a best-case scenario, we could maybe advertise four printers, and we often had to manually restart the Printopia Pro service when even those printers disappeared.

There is a solution that should work for most deployment cases, though.


This solution works only on networks running IPv4 and assumes that your Printopia Pro server is using a static IP address.  No, I don’t know all the technical details behind the IPv4/6 portion of this fix; I could have asked, and would have been very interested to find out the answer, but I didn’t feel like I had time for a several-hour conversation at the time.

Log in to your Printopia server and open the Terminal application and run the following command

networksetup -setv6off Ethernet

networksetup -setv6off EthernetLike the option says, this command turns off IPv6, which can’t be done through the GUI.  Next, open Printopia’s Advanced Settings.

Open Advanced Settings (command + comma)Under the General tab, there is a box to check that says “Publish printers using IPv4 addresses only.”  Uncheck this box if it’s checked.  Yes, that may seem counter-intuitive, but remember that you just turned off IPv6.

Picture of General tab under Advanced Settings with arrow pointing towards bottom-most checkbox with directions to uncheck that option.At this point, it’s worth making sure that printers are being advertised only over the Ethernet interface.  For each printer group, click “Settings…”

Picture indicating location of Settings button for printer groupand, under the Network Interfaces tab, select the bottom radio button and then select only your Ethernet interface.

Network Interface tab opened with only the Ethernet interface, en0, selected.Finally, for good measure, restart the Printopia service from the General tab.  Within a minute of applying these changes, we went from seeing four printers advertised over Printopia to seeing all seven printers that we were sharing.  You can check to make sure that the printers are being advertised over your network using the free Bonjour Browser application.

Bonjour Browser application window showing printers being advertised.So far, this solution has been totally stable for us, though it’s also recommended that you update your instance of Printopia Pro to the most recent release, 1.0.3.2, which can be downloaded here.

Advertisements

Well, I said that I was going to build a server to do a larger-scale test for AirPrinting from iOS devices here on campus, and by gum I did.  Right now, under my desk, there’s an Ubuntu 12.04.1 Precise server named Goodmountain (see what I did there?) whose only job is to serve up AirPrint printers for campus iDevices.

Nothing more glamorous than an old ThinkCentre shoved under a desk, amiright?

Here it is (center).  Nothing more glamorous than an old ThinkCentre shoved under a desk, amiright?

So how’s it working so far?  Well, I’ve printed a couple pieces of short fiction from my iPad to two of the printers that I’ve made available for this pilot program, and everything’s gone just fine.  There aren’t any students around this week, and I don’t know how much demand there’s been for iPad printing.  For this pilot, I’ve only made four printers available in the locations where the iPads get used most often, and I’ll be waiting to see if there’s more demand and/or how much the service gets used before I do anything else.  Top on my list of priorities is moving this to an actual server that isn’t hanging out under my desk, but that only happens if this is something that there’s heavy demand for.

Now, what have I learned?  Well, top on my list is that the Ubuntu server installer doesn’t recognize full-sized Apple SATA drives (or at least drives that have been pulled out of the bin and have an Apple logo on them–I don’t actually know if it’s the drives or something about the partitions, and I don’t care to test that right now).  More important than that, though, is that if you’re going to be serving multiple printers, you need to have a separate .service XML file under /etc/avahi/services/ for each printer or none of them are going to show up.  If you’ve already built a nice big file for all your printers and you need to cut it up into a bunch of individual files, just consider it more Vim practice.  Yank is your friend.

Expect to see another report here once I have some usage statistics.

Like many other private schools, there have been rumblings at my workplace about going one-to-one (that is computers to students). At the moment, those rumblings point towards a pilot program rolling out iPads in the Middle School. We have a lot of smart teachers doing interesting things with iPads in their classrooms already, and I think that an iPad program could have a number of benefits in the classroom (though it will require a thoughtful digital citizenship curriculum), but that’s not what I’m most concerned with at the moment. I’m concerned with how the kids and teachers will print to all our legacy printers from their shiny new tablets.

A week or two ago, I was asked to research a product that is supposed to simply and seamlessly solve the problem of using legacy printers for AirPrint. The idea, which is a decent idea, is that you plug this box into your network and it discovers all your printers and makes them available for AirPrint. The problem, which I’ve heard from other sysadmins at schools in the area, is that this particular product doesn’t scale well–one of the boxes costs about $100, and each of them is “good” for about 7 printers, but even then, they apparently have a tendency to lock up and require frequent hard resets. There are software solutions available, but they cost money and run on Macs, and I don’t want to make us get a dedicated Mac to act as an AirPrint server if there’s a way to get the system running for free on open-source software.

Well, it turns out there is a way. At this point, I’ve only done a small-scale proof-of-concept, but as of this writing, I have printed a document from my iPad to my office’s HP 3505n, which is certainly a step in the right direction, and in the future, I’ll probably do a scaled-up test and then hopefully put the system into full deployment. In my test case, there was no noticeable lag between my submitting the print job from my iPad and the printer firing up compared to printing directly from my computer.

To get this running, I used my Linux workstation, which is running Ubuntu 12.04.1. Ubuntu comes with Avahi pre-installed, which is great, because you need that, too. (You may remember my mentioning Avahi before.) After installing your printer or printers, you need to make sure that they’re shared, then edit your CUPS configuration and create a configuration file for Avahi. Full instructions are on gyttja’s blog, though the original article referenced seems to be down, so you’ll want to go here to get it on the wayback machine.

You’ll want to restart CUPS and Avahi after you’ve put through all the changes, otherwise, you probably won’t get any results, and some swearing might ensue. To do that, just run

sudo service cups restart
sudo service avahi-daemon restart

Look for another post on this subject here once I get a solution working on our campus.