Share your Windows printers using AirPrint

When AirPrint was first introduced in iOS 4.2, I have spent some time trying to share my Windows printer to my iPad. Of course a free solution was already there, one that involved installing Apple Bonjour Service with CUPS Lite for Windows. So I’ve quickly found that solution on Google and downloaded the necessary tools, namely Bonjour Print Services for Windows and Airprint.zip, which contains the CUPS service.

Making it work was quite easy. You need to unzip the Airprint.zip file to C:\Program Files\AirPrint (on a 32-bit Windows), or to C:\Program Files (x86)\Airprint on 64-bit Windows.

The next step is registering the service: log in as a user with admin rights, click “Start”, “Run”, enter “cmd” and press “OK”.

In the console, enter the following commands:

sc.exe create AirPrint binPath= "C:\Program Files\AirPrint\airprint.exe -s" depend= "Bonjour Service" start= auto
sc.exe start AirPrint

IMPORTANT: If you use 64-bit Windows, use the appropriate Program Files (x86) directory instead.

It worked! …until iOS 5. So I’ve run the Wireshark to see if Apple changed anything to the AirPrint protocol. It was not a surprise that they did:

Luckily, CUPS Lite has several command line switches and it can be adapted to the change.

To make Airprint.exe compatible with iOS 5 and above, run the following commands from the command prompt:

sc.exe stop Airprint
sc.exe delete Airprint
sc.exe create AirPrint binPath= "C:\Program Files\AirPrint\airprint.exe -R _ipp._tcp,_universal -s" depend= "Bonjour Service" start= auto
sc.exe start Airprint

IMPORTANT: Remember to use the right Program Files or Program Files (x86) directory.

Since you’ve seen the picture and the modified entry for Airprint service, you might already have guessed that -R binds CUPS Lite to a slightly different service name (the one which my iPad was looking for). This allows the iOS 5.x devices to be able to find shared printers again.

Make sure airprint.exe is allowed through in Windows Firewall. Some tutorials will tell you to disable Windows Firewall alltogether – don’t do that, it’s a security risk!

Some tutorials will tell you to enable guest account for the sharing to work. Don’t do that, it’s a security risk. If someone accesses your network (for example cracks or guesses your WiFi key), he will be able to print anything on your printer. Use one of the user accounts on Windows instead, and when you order iOS device to print something, iOS will automatically ask you for username and password.

The above has been tested with iPhone and iPad, both running iOS 8.1.2.

PS. If you are running Linux it is still possible to use CUPS and avahi daemon to share a Linux printer to AirPrint enabled devices.

A bug in iOS results in poor battery life

It seems a lot of people is displeased with the battery life of the new iPhone 4S. Unfortunately, the problem is not limited to the new iPhone users: other devices have been impacted by the problem as well. My iPhone 3GS with iOS5 is almost half discharged after a day on standby. I blamed it on the battery age at first, but many other people have started complaining about the same issue.

I did have a similar issue with my iPhone 3G at some point – when one of the processes kept running on the CPU. This issue looks similar, but is related to Location Services. In iOS5 Apple has divided System Services from other apps, and one of them seems to be the problem – the Setting Time Zone service. If you enable the Status Bar Icon, it will constantly show near the battery icon, meaning that something is using Location Services all the time. Disabling the Setting Time Zone service seems to fix the problem.

Location Services on iPad Location Services on iPhone

Trouble with installing iOS 5

I have always updated my iDevices just after the new firmware was available, and never experienced any problems. Unfortunately, installing iOS 5 was not as smooth ride as I expected it to be.

To my surprise, iTunes has reported errors 3004 and 3200 several times, and my iPad remained stuck in DFU mode. I have quickly googled to check if none has similar issues to mine and read several posts on forums. People suggest to add a manual entry for Apple’s gs.apple.com to the hosts file.

Unless you have jailbroken any of your iDevices, just be patient and keep trying every now and then – it will update at some point. If you did jailbreak any device on your computer, it is possible that the jailbreaking tools has added an entry to the system hosts file.

To check if your computer is affected:

  • Go to C:\Windows\system32\drivers\etc\hosts
  • Remove any entries regarding gs.apple.com

Once done, just keep trying to restore your iDevice every few minutes.

 

iOS 5 goes public on the 12th of October

Most Apple fans have mixed feelings after yesterdays press conference, mainly because intead of iPhone 5 Apple will serve a slihgtly updated iPhone 4S. But fear not, iOS 5 and iCloud are coming soon. Scott Forstall did not say much about the new system itself, but we know when it arrives in iDevices: 12 of October. Golden Master release has already been released for developers.

Most important features of the new iOS:

  • Notification Center (non-disruptive notifications)
  • Reminders (time and location based)
  • iMessage (instant messenger for all iDevices)
  • WiFi sync (no need for cables anymore)
  • Newsstand (for those who like reading newspapers on iPad)
  • split keyboards (great for thumb-typing on iPad)
  • AirPlay mirroring for the iPad 2 (and for iPhone 4S too)
  • Siri voice recognition (for iPhone 4S only)
  • Wireless activation (no need for iTunes)
  • OTA iOS updates

iCloud storage will provide a free 5GB (which is now a de facto standard for most personal clouds – same as Windows Live Mesh and Ubuntu One). The most important feature is however automatic push synchronistation between all iDevices.