Tuesday, October 27, 2009

Introduce an old scanner to Ubuntu 9.04

Update: below method works with Simple Scan, which replaced Xsane from Ubuntu 10.04, as well.

I bought my scanner several years ago from Zhongguancun. It's an acer s2w 3300u. I love the idea of s2w, scan to web. It's what Google Books is doing. I've been using it to digitalise photos and documents these year, only on Windows.

Since I have a almost Windows-free home now, I planned to try it on Ubuntu. I started Xsane last night, an error occurred

Failed to open device 'snapscan:libusb:003:002': Invalid argument.

This is because the backend of the scanning program, snapscan, doesn't know what kind of scanner it is and which driver to use. Let's try sane-find-scanner and lsusb to figure it out.

 zhao@nettop:~$ sane-find-scanner   
  # sane-find-scanner will now attempt to detect your scanner. If the  
  # result is different from what you expected, first make sure your  
  # scanner is powered up and properly connected to your computer.  
  # No SCSI scanners found. If you expected something different, make sure that  
  # you have loaded a kernel SCSI driver for your SCSI adapter.  
 found USB scanner (vendor=0x04a5 [Color], product=0x20b0 [ FlatbedScanner 22]) at libusb:003:002  
  # Your USB scanner was (probably) detected. It may or may not be supported by  
  # SANE. Try scanimage -L and read the backend's manpage.  
  # Not checking for parallel port scanners.  
  # Most Scanners connected to the parallel port or other proprietary ports  
  # can't be detected by this program.  
  # You may want to run this program as root to find all devices. Once you  
  # found the scanner devices, be sure to adjust access permissions as  
  # necessary.  

 zhao@nettop:~$ lsusb   
 Bus 001 Device 004: ID 0bda:0158 Realtek Semiconductor Corp. Mass Stroage Device  
 Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub  
 Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub  
 Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub  
 Bus 003 Device 002: ID 04a5:20b0 Acer Peripherals Inc. (now BenQ Corp.) S2W 3300U/4300U  
 Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub  
 Bus 002 Device 003: ID 0603:00f2 Novatek Microelectronics Corp.   
 Bus 002 Device 002: ID 0d62:a100 Darfon Electronics Corp. Benq Mouse  
 Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub  

As you can see the system has this model in its database, what I need to do is to find the driver for it. I cannot find its original CD since I can use it without any special driver or application on Windows. But this is not a big problem for this popular scanner. After a quick search, I got u176v040.bin from a zip file. I copied it to /usr/share/sane/snapscan/ and modified /etc/sane.d/snapscan.conf as follows

 # Change to the fully qualified filename of your firmware file, if  
 # firmware upload is needed by the scanner  
 firmware /usr/share/sane/snapscan/u176v040.bin  

All done. Xsane is sort of like GIMP, powerful yet not so friendly. I have to get used to it or find other alternatives, but that's way more simple than driving the scanner up and running.

PS connect the USB cable before power on the scanner.

1 comment:

  1. Hello . I am new to this but I found your post helpful but the thing its that I cannot get this working . After doing all that you have done it still gives R the same error .