Getting the HP 2400c Scanner working in Linux Ubuntu Karmic

I had a tough day working on Ubuntu to get a HP 2400c Scanner working today.

A list of problems included the drivers not being included in the Sane package – and after an upgrade to karmic a normal user couldn’t access the USB device.

Here’s a quick rundown of what I did to get it working.

1 – Download the HP scanner drivers from Elcot
2 – Install the drivers as root. The instructions are in the readme file.
3 – Create a new udev rule by creating the file /lib/udev/rules.d/71-scanner.rules
4 – In the rules file, paste in the following code:

#HP ScanJet 2400c
ACTION=="add", ATTRS{idVendor}=="03f0", ATTRS{idProduct}=="0a01", GROUP="scanner"

5 – Add the user to the scanners group.
6 – Run Sane or Xsane and be happy!

There was a bit of groping around as I hadn’t created my own udev file before without following the instructions or howtos for specific hardware.

The key point to know is that there are some very useful commands:
lsusb – lists info about the usb devices plugged in
udevadm monitor – outputs udev events and shows you the device paths for any devices plugged in / removed
udevadm info –query=all –path /devpath – Shows the udev properties of a specific device
udevadm info –attribute-walk –path /devpath – Shows the udev properties of a device and its parents
* devpath is the path output from udevadm monitor

Once I’d worked my head around these, I could put together the .rules file that I needed. This basically checks the vendor and device ID match, and that it is an ‘ADD’ action. Once confirmed, udev adds the group membership of the device to ‘scanner’ so that the users you want to use the scanner can actually use it!