|
发表于 2002-12-17 13:44:24
|
显示全部楼层
这一篇有没有用?
http://eugeneteo.net/docs/USBScanner-HOWTO.txt
The Linux USB Scanner mini-HOWTO
Author: Eugene Teo <eugeneteo@eugeneteo.net>
Version 0.01, Last update: 01/04/22
This document describes how to set up an EPSON USB scanner on a Debian
system using SANE (Scanner Access Now Easy).
================
1. Introduction
----------------
This is a description of what I did to get my USB subsystem and EPSON
Perfection 610 flatbed scanner working on my Debian system without
resorting to using any commercial operating systems and softwares.
==========================
2. Obtaining the software
--------------------------
You will need a late version kernel. Kernel version 2.2.17 and later
enables you to set up a working USB subsystem.
As of this writing, the latest stable kernel is 2.4.3 and you can
download it from the Linux Kernel Archives.
http://www.kernel.org/pub/linux/kernel/v2.4/linux-2.4.3.tar.gz
If for some reasons, you would want to use a 2.2 kernel, you are advised
to patch the kernel with the Linux USB drivers backport for the USB
codes found in 2.2 kernel are outdated.
http://www.suse.cz/development/usb-backport/
You will need the SANE backends and frontends packages. Here are the
list of packages required to be installed.
http://packages.debian.org/unstable/graphics/sane.html
==================================
3. Installation and Configuration
----------------------------------
First of all, you need a working USB subsystem. Here are the steps:
# tar xvzf linux-2.4.3.tar.gz
# ln -s linux-2.4.3 linux
# make mrproper
# make menuconfig
Choose the following options under USB Support:
- select Support for USB (module)
- select Preliminary USB device filesystem
- select (use lspci -v. More info at Documentation/usb/usb.txt)
+ UHCI (Intel PIIX4, VIA, ...) support (module) _or_
+ UHCI Alternate Driver (JE) support (module) _or_
+ OHCI (Compaq, iMacs, OPTi, SiS, ALi, ...) support
- select USB Scanner support (module)
After making the necessary changes to the kernel options, exit the
configuration menu.
# vi /usr/src/linux/drivers/usb/scanner.h
Make the following changes:
--- linux-BAK/drivers/usb/scanner.h Mon Dec 11 08:49:43 2000
+++ linux/drivers/usb/scanner.h Wed Apr 11 23:02:56 2001
@@ -41,10 +41,10 @@
MODULE_DESCRIPTION("USB Scanner Driver");
MODULE_PARM(vendor, "i");
-MODULE_PARM_DESC(vendor, "User specified USB idVendor");
+MODULE_PARM_DESC(vendor, "0x04b8");
MODULE_PARM(product, "i");
-MODULE_PARM_DESC(product, "User specified USB idProduct");
+MODULE_PARM_DESC(product, "0x0103");
/* Enable to activate the ioctl interface. This is mainly meant for */
If you are not sure what to put for the vendor and product, you can get
some hints if you scroll down scanner.h, e.g.
/* Seiko/Epson Corp. */
{ 0x04b8, 0x0101 }, /* Perfection 636U and 636Photo */
{ 0x04b8, 0x0103 }, /* Perfection 610 */
{ 0x04b8, 0x0104 }, /* Perfection 1200U and 1200Photo */
After making the changes, proceed to create the kernel image and install it.
# make-kpkg clean
# fakeroot make-kpkg --revision=usb.1.0 \ kernel_image
# dpkg -i /usr/src/kernel-image-2.4.3_usb.1.0_i386.deb
Do not forget to run lilo after installing the kernel. For more
information, see
http://www.yolinux.com/cgi-bin/man2html?cgi_command=lilo
http://www.yolinux.com/cgi-bin/man2html?cgi_command=lilo.conf
If you follow the instruction closely, you should see this:
pandemonium:/usr/src# ls -l /lib/modules/<kernel version>/usb/
total 112
-rw-r--r-- 1 root root 7856 Apr 11 23:03 scanner.o
-rw-r--r-- 1 root root 24984 Apr 11 23:03 usb-uhci.o
-rw-r--r-- 1 root root 73068 Apr 11 23:03 usbcore.o
Add the corresponding entries in /etc/modules
alias char-major-180 usb-uhci
pre-install usb-uhci
modprobe scanner vendor=0x04b8 product=0x0103
After setting up the USB subsystem, do a soft reboot to use the new
kernel. During booting, you should be able to see these.
usb.c: USB device number 2 default language ID 0x409
Manufacturer: EPSON
Product: Perfection610
scanner.c: probe_scanner: User specified USB scanner --
Vendorroduct - 4b8:103
usb.c: usbscanner driver claimed interface c29d4320
Type lsmod and you should be able to see the following modules loaded.
scanner 4784 0 (unused)
usb-uhci 18880 0 (unused)
usbcore 47568 0 [scanner usb-uhci]
Create the device file in /dev.
mknod /dev/usbscanner0 c 180 48
chmod 666 /dev/usbscanner0
Once the scanner has been set up, you can proceed to install the SANE
packages.
# apt-get update
# apt-get install sane
The only thing you need to configure for SANE is to edit the epson.conf
# vi /etc/sane.d/epson.conf
and append the following line in replace of the /dev/usbscanner0
usb /dev/usbscanner0
=====================
4. Using the scanner
---------------------
I have tried several front-end programs and I find scanimage command-line
program being the most stable one available (At least it does not crash
my box like xsane did).
Before you can use scanimage to scan images, you have to find out the name
of the available scanner device(s).
# scanimage --list-devices
You should be able to see:
amnesia@pandemonium:~$ scanimage --list-devices
device `epson:/dev/usbscanner0'
is a Epson Perfection610 flatbed scanner
To see what parameters are supported for the listed device:
# scanimage --help -d epson:/dev/usbscanner0
Now that you know the device name, test if your scanner really works.
Appending --test parameter would make scanimage perform diagnostic tests
on the scanner.
# scanimage --test -d epson:/dev/usbscanner0
If it all works well, you can start scanning your favourite pictures
and photos!
# scanimage -d epson:/dev/usbscanner0 --mode color
--format tiff > image.tiff
# scanimage -d epson:/dev/usbscanner0
--resolution 300 > image.ppm
# scanimage -d epson:/dev/usbscanner0 --resolution 300
--mode lineart > image.pbm
To edit the file, you can use GIMP or netpbm to manipulate the scanned
images.
To learn more about scanimage, see
http://www.yolinux.com/cgi-bin/man2html?cgi_command=scanimage
=================
END OF mini-HOWTO
================= |
|