Activate Canon Scanner LIDE 20

In the Ubuntu Feisty distribution there is a known bug that causes the LIDE 20 and 25 scanners to go into an undesired sleep mode. In this article I will show a workaround which activates the scanner when you want to scan your documents with xsane or other similiar programs.

The solution

The solution is a small bash script which is quite simple:

#!/bin/sh
echo "Activate Scanner (Press Ctrl+C to exit)..."
ZAHL1=`lsusb | grep Canon | awk '{print $2}'`
ZAHL2=`lsusb | grep Canon | awk '{print $4}' | sed 's/://'`
while true
do
    cat /dev/bus/usb/${ZAHL1}/${ZAHL2} > /dev/null
    sleep 1
done

Please store this script on your local filedisk (e.g. as scanner.sh) and make it executeable:

bash:~$ chmod a-x scanner.sh

The next steps are always the same:

  1. Plug in your scanner (if your haven't done so)
  2. Run the scanner activation script: ./scanner.sh
  3. Scan your documents with your favourite scanning program (like xsane, etc)
  4. Quit the scanner activation script with Ctrl+C

Acknowledgement

I found the original script here and modified it a bit.

Author: Christoph Hermes, published: 2007-09-16 14:31:38