Sunday, December 2, 2012

Canon CanoScan 9000F in Debian Linux

I purchased a Canon CanoScan 9000F scanner, to use with my Debian system. To ensure I would have a smooth time, I went to the Sane project website (http://www.sane-project.org/sane-mfgs.html#Z-CANON) and confirmed that it was fully supported.

Debian version of my system:


lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 6.0.6 (squeeze)
Release: 6.0.6
Codename: squeeze

Got the scanner plugged it in, powered it on. dmesg showed it.


[755012.680139] usb 1-8.1.3: new high speed USB device using ehci_hcd and address 96
[755017.773253] usb 1-8.1.3: New USB device found, idVendor=04a9, idProduct=1908
[755017.773260] usb 1-8.1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[755017.773264] usb 1-8.1.3: Product: CanoScan
[755017.773268] usb 1-8.1.3: Manufacturer: Canon
[755017.773411] usb 1-8.1.3: configuration #1 chosen from 1 choice

Good. Tried:

scanimage -L


No scanners were identified. If you were expecting something different,
check that the scanner is plugged in, turned on and detected by the
sane-find-scanner tool (if appropriate). Please read the documentation
which came with this software (README, FAQ, manpages).


which found no scanner, bummer.

Googling around a bit, it turns out the pixma-backend included with Squeeze, doesn't have the required support. So based on this post -> http://permalink.gmane.org/gmane.comp.graphics.scanning.sane.devel/20896, decided to get the backend from the git repository and compile. Needed to get a few packages:



apt-get install git

apt-get install autoconf
apt-get install gcc
apt-get install libusb-dev
apt-get install make

Before, I could do:


cd code/
git clone git://git.debian.org/sane/sane-backends.git
cd sane-backends/
autoconf ( Squeeze has a older version, then what the git repository used, but it worked)
automake
BACKENDS="pixma" ./configure
make
su ( need to be root, for make install and to run ldconfig)
make install

ldconfig -v ( -v is verbose. From man page: will set up the correct links for the shared binaries and rebuild the cache.)

Success. The old version was:


scanimage -V
scanimage (sane-backends) 1.0.21; backend version 1.0.21

After running ldconfig.

scanimage -V
scanimage (sane-backends) 1.0.21; backend version 1.0.24



Now scanimage can detect the scanner.

scanimage -L
device `pixma:04A91908' is a CANON Canoscan 9000F multi-function peripheral

However the xsane front-end has trouble getting access to the scanner, the reason being, udev has the old libsane rules and not the ones we just built. The old rules are in:

/lib/udev/rules.d/60-libsane.rules

The one we just built are ( relative to where git placed them):

sane-backends/tools/udev/libsane.rules

We could either manually copy the lines we care about:

diff -u /lib/udev/rules.d/60-libsane.rules tools/udev/libsane.rules | grep -C 2 9000
+# Canon CanoScan 700F
+ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="1907", MODE="0664", GROUP="scanner", ENV{libsane_matched}="yes"
+# Canon CanoScan 9000F
+ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="1908", MODE="0664", GROUP="scanner", ENV{libsane_matched}="yes"
+# Canon CanoScan LiDE 110

or as I prefer, replace the old one with the new one.


Now the scanner is usable.