[sane-devel] USB scanner paper

Karl F. Larsen k5di@zianet.com
Mon, 18 Nov 2002 15:55:24 -0700 (MST)


Hi Henning, thanks for all the great help! I will include your 
corrections and put this paper on my web page so it can be a referanced 
URL. It will be like www.zianet.com/k5di/usb/ by tomorrow.

On Mon, 18 Nov 2002, Henning Meier-Geinitz wrote:

> Hi,
> 
> On Sun, Nov 17, 2002 at 04:04:20PM -0700, Karl F. Larsen wrote:
> > 
> > 	Hi Gang, this is expected to work with the Linux systems 
> > defined. If you see errors please note them to me.
> 
> I'm only commenting on topics that are not already mentioned by others.
> 
> > 	If the scanner you have has a USB cable that plugs into the
> > computer, and if your computer has a plug for it to plug into, this paper
> > will tell you how to make certain that the software called Sane on your
> > Linux operating system can find 
> 
> Ok.
> 
> > and use your scanner.
> 
> That's to strong in my opinion because "using" means for me that the
> scanner scans. So a backend must exist. Maybe write "can be identified
> by SANE".
> 
> And even this is not true for scanners thatdon't have a bulk-out
> endpoint, see my previous comments. Some USB scanners also use the
> SCSI-over-USB kernel drivers.
>  
> > 	Next your Sane. You should have a recent version of this software.
> > To find out what you have, run this simple test. In an Xterm window type
> > scanimage --version. This will print out the backend version and it needs
> > to be 1.0.7 or higher to work well with a USB scanner. If your version is
> > older you need to install the latest version from
> 
> Use 1.0.9. Don't recommend anything else. The older versions support
> less USB scanners.
> 
> > 	In terms of the Red Hat Linux, version 7.3 or higher will fully
> > support running a USB scanner. An earlier version might require both a
> > kernel and Sane upgrade.
> 
> See above. Maybe write "you can try older versions, but before giving
> up, try the latest".
> 
> > 	Plug your scanner into the computer and turn it on. Notice the Name
> > of your scanner and it's model number. Now in an Xterm window at the command
> > line do this:
> > 
> > 		cat /proc/bus/usb/devices <Enter>
> > 
> > This lists all the data about your USB ports.
> 
> USB devices, not only ports.
> 
> > Here is a copy of my computer's setup:
> 
> [...]
> 
> > T:  Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  2 Spd=12  MxCh= 0
> > D:  Ver= 1.10 Cls=ff(vend.) Sub=00 Prot=ff MxPS= 8 #Cfgs=  1
> > P:  Vendor=04b8 ProdID=010f Rev= 1.00
> > S:  Manufacturer=EPSON
> > S:  Product=EPSON Scanner 010F
> > C:* #Ifs= 1 Cfg#= 1 Atr=c0 MxPwr=  2mA
> > I:  If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=ff Driver=(none)
> > E:  Ad=81(I) Atr=03(Int.) MxPS=   1 Ivl=16ms
> > E:  Ad=82(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms
> > E:  Ad=03(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms
> > 
> > 	I have an Epson model Perfection 1250 scanner and you can see that
> > this printout is correct for an Epson.
> 
> Not all scanners show up with their Vendor and product names.
> 
> Example:
> T:  Bus=01 Lev=02 Prnt=02 Port=01 Cnt=01 Dev#=  5 Spd=12  MxCh= 0
> D:  Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
> P:  Vendor=055f ProdID=021d Rev= 1.00
> S:  Product=USB Scanner
> C:* #Ifs= 1 Cfg#= 1 Atr=a0 MxPwr=500mA
> I:  If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none)
> E:  Ad=81(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms
> E:  Ad=02(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms
> (Mustek BearPaw 2400 CU Plus)
> 
> > Notice at the second P: is listed a number called Vender=04b8 which
> > means Epson. ProdID=010f which means model Perfection 1250 are the 2
> > numbers we need to set up Sane so it can find the scanner.
> 
> The numbers are needed to set up the Linux kernel driver.
> 
> > 	The numbers need to be changed to exact Hex numbers so instead of
> > 04b8 it is written 0x04b8 and 010f is written 0x010f. We will use these
> > numbers with the scanner module to set up a working scanner. It's assumed
> > you have scanner as a module on your Linux. 
> 
> Maybe: "It's assumed your scanner driver is compiled as a module."
> 
> > 	To load the module with the scanner numbers in place we use modprobe
> > and we must be in an xterm window as root.
> 
> root is true, but just write shell, no need for X or even xterms :-)
> 
> > To do this type su - and when it
> > asks for your password type that in. You will see the prompt turn to # and
> > you will be in the /root directory. Now type in the following:
> > 
> > 	modprobe vendor=0x04b8 product=0x010f
> > 
> > but instead of my numbers put in your scanners numbers. It should take a
> > second to do it's job and then stop without any error messages.
> 
> Add that you should try rmmod scanner first to make sure, that the
> module wasn't loaded before. You will get no error message if you do
> the modprobe but the options will be ignored if the module is already
> loaded.
> 
> > If you get an error message you didn't type it in right.
> 
> Also having a look at the syslog may help.
> 
> > 	Now to see if Sane can find the scanner. For this we use the tool
> > that comes with Sane called "sane-find-scanner". In an xterm window type in:
> 
> xterm, see above.
> 
> > 		sane-find-scanner
> > 
> > 	My Linux came back with this:  	
> > 
> > # Note that sane-find-scanner will find any scanner that is connected
> > # to a SCSI bus and some scanners that are connected to the Universal
> > # Serial Bus (USB) depending on your OS. It will even find scanners
> > # that are not supported at all by SANE. It won't find a scanner that
> > # is connected to a parallel or proprietary port.
> > 
> > sane-find-scanner: found USB scanner (vendor = 0x04b8, product = 0x010f) at
> > device /dev/usb/scanner0
> > 
> > Notice the last 2 lines that begin "sane-find-scanner:".
> 
> Newer versions of sane-find-scanner won't print the "sane-find-scanner":
> found USB scanner (vendor=0x055f, product=0x021d [USB Scanner]) at libusb:001:005
> 
> > It says Sane has
> > found our scanner because it gives the proper vendor and product numbers for
> > my scanner. 
> 
> If it doesn't work, try as root (permissions!).
> 
> > 	At this point your scanner will probably not work yet but your sure
> > that Sane can find your scanner. Your more than 1/2 toward a working
> > scanner in Linux.
> 
> If your scanner is supported by a backend at all...
> 
> > 	To use the scanner you will want to load the module scanner each
> > time you turn on your Linux. There are several ways to do this but the most
> > straight forward way is to load scanner from the file /etc/rc.d/rc.local.
> > This file on my computer looks like this:
> > 
> > #!/bin/sh
> > #
> > # This script will be executed *after* all the other init scripts.
> > # You can put your own initialization stuff in here if you don't
> > # want to do the full Sys V style init stuff.
> > 
> > touch /var/lock/subsys/local
> > 
> > # This turns on the scanner module with the Epson scanner
> > 
> > insmod scanner >/dev/null
> > 
> > It's the insmod scanner that loads the module. Now we want to load the
> > vendor and product numbers.
> 
> ...specify the vendor and product numbers...
> 
> > This is done in the file /etc/modules.conf. Mine
> > looks like this:
> 
> I'm not sure if it makes sense to show all the unrelated lines. Maybe
> too confusing.
> 
> > alias parport_lowlevel parport_pc
> > alias eth0 8139too
> > alias sound-slot-0 es1371
> > post-install sound-slot-0 /bin/aumix-minimal -f /etc/.aumixrc -L >/dev/null
> > 2>&1 || :
> > pre-remove sound-slot-0 /bin/aumix-minimal -f /etc/.aumixrc -S >/dev/null
> > 2>&1 || :
> > alias usb-controller usb-uhci
> > options scanner vendor=0x4b8 product=0x010f
> > 
> > Notice the last line which is what I added. To make that line active as root
> > you need to use a tool that reads the file and does what it says to do. This
> > tool is called "depmod" and you use it this way:
> > 
> > 		#depmod -a
> > 
> > It will take several seconds and then just stop.
> 
> Technically, that's not correct. "options scanner..." will work
> without depmod, but it's ok to avoid a warning message so I'm just
> nitpicking here.
> 
> > 	Testing the setup is easy and takes little time. Remove the scanner
> > module from the kernel with rmmod scanner. Then run sane-find-scanner and
> > see it can't find it. Then use modprobe scanner to re-load it and again run
> > sane-find-scanner and observe it again finds it.
> 
> This is a test for modules.conf but not for rc.local. Again, I'm
> nitpicking.
> 
> When it's ready, can you put your text on a webpage?
> 
> Bye,
>   Henning
> _______________________________________________
> Sane-devel mailing list
> Sane-devel@www.mostang.com
> http://www.mostang.com/mailman/listinfo/sane-devel
> 
> 

-- 
                      
               - Karl Larsen k5di Las Cruces,NM Az ScQRPions -