Using the HP LaserJet Professional P1102w in Debian GNU/Linux

I got a new cheap laser printer, an HP "LaserJet Professional P1102W" (£75). As I wasted some time before I got it set up right, here are suggestions on how to get it working over wireless within Debian.

Getting wireless working

Connecting directly to the printer's default ad-hoc wireless network didn't seem to work usefully (I could connect to the network, but not reach the printer). HP's official hplip tools also didn't get me anywhere (even after editing models.dat to say that, yes, this model is a wireless printer). Forum discussions which got this far just suggested using a Microsoft system to configure wireless, but fortunately there is a better solution.

To set up wireless, temporarily plug in the printer with the supplied USB cable, and run ewsgateway.py from here to talk to the printer's embedded web server over USB:

http://www.jspenguin.org/software/ewsgateway/

Starting the program gave me a 'Could not access some devices' warning that could safely be ignored -- the printer itself was listed fine. Click 'Start' then 'Launch browser', and use the printer's web interface to choose the right wireless network and supply a password if needed.

If you want to check the printer's status (including what IP address it is using), hold down the cancel button on the printer (lower button, with a cross) and it will print a status page.

Printing

HP's official hplip tools seem to require downloading some additional non-free software to support this printer, and then failed to work for me anyway, but the free foo2zjs works fine for this printer.

Unfortunately the foo2zjs in squeeze is too old, but the version in wheezy (current testing) is fine. If you're running squeeze, you can easily make your own backport: e.g. add "deb-src http://ftp.debian.org/debian/ testing main" to your sources.list, "apt-get build-dep foo2zjs; apt-get source foo2zjs", enter the new directory and "debuild -uc -us", then install the resulting package.

To set up the printer, visit localhost:631 in a web browser (if that doesn't work, check your CUPS installation), and go to "Administration" then choose "Add Printer". The printer should be discovered over wireless using Zeroconf. To get the right printer driver, choose "HP" and click "Continue", then then scroll through the big list to find the right option -- for me, it was "HP LaserJet Pro P1102w Foomatic/foo2zjs-z2 (recommended) (en)". Note that the list is sorted using all the words, so similar model numbers can be far apart. Ignore any similar entries with hpijs / hplib. Click "Add Printer" leaving the PPD field blank, then "Set default options" to finish configuration.

A warning for those who want hplip: as the printer wasn't  working with the packaged hplip, I tried getting the latest version directly.  The official hplip installer from HP supports Debian, but after reassuringly checking dependencies and pulling in any additional required packages, it scattered un-packaged files across the disk for the hplip software itself.