kopia lustrzana https://gitlab.com/sane-project/website
170 wiersze
8.2 KiB
HTML
170 wiersze
8.2 KiB
HTML
<HTML>
|
|
<HEAD>
|
|
<TITLE>sane-usb.5</TITLE>
|
|
</HEAD>
|
|
<BODY BGCOLOR=#FFFFFF TEXT=#000000><H1 ALIGN=CENTER><IMG SRC="/images/sane.png" HEIGHT=117 WIDTH=346></H1>
|
|
<H1>sane-usb.5</H1>
|
|
<HR>
|
|
<PRE>
|
|
<!-- Manpage converted by man2html 3.0.1 -->
|
|
<B><A HREF="sane-usb.5.html">sane-usb(5)</A></B> SANE Scanner Access Now Easy <B><A HREF="sane-usb.5.html">sane-usb(5)</A></B>
|
|
|
|
|
|
</PRE>
|
|
<H2>NAME</H2><PRE>
|
|
sane-usb - USB configuration tips for SANE
|
|
|
|
|
|
</PRE>
|
|
<H2>DESCRIPTION</H2><PRE>
|
|
This manual page contains information on how to access scanners with a
|
|
USB interface. It focuses on two main topics: getting the scanner
|
|
detected by the operating system kernel and using it with SANE.
|
|
|
|
This page applies to USB most backends and scanners, as they use the
|
|
generic sanei_usb interface. However, there is one exception: USB Scan-
|
|
ners supported by the <B><A HREF="sane-microtek2.5.html">sane-microtek2(5)</A></B> backend need a special USB ker-
|
|
nel driver.
|
|
|
|
|
|
</PRE>
|
|
<H2>QUICK START</H2><PRE>
|
|
This is a short HOWTO-like section. For the full details, read the fol-
|
|
lowing sections. The goal of this section is to get the scanner
|
|
detected by <B><A HREF="sane-find-scanner.1.html">sane-find-scanner(1)</A></B>.
|
|
|
|
Run <B><A HREF="sane-find-scanner.1.html">sane-find-scanner(1)</A></B>. If it lists your scanner with the correct
|
|
vendor and product ids, you are done. See section <B>SANE</B> <B>ISSUES</B> for
|
|
details on how to go on.
|
|
|
|
<B><A HREF="sane-find-scanner.1.html">sane-find-scanner(1)</A></B> doesn't list your scanner? Does it work as root?
|
|
If yes, there is a permission issue. See the <B>LIBUSB</B> section for
|
|
details.
|
|
|
|
Nothing is found even as root? Check that your kernel supports USB and
|
|
that libusb is installed (see section <B>LIBUSB</B>).
|
|
|
|
|
|
</PRE>
|
|
<H2>USB ACCESS METHODS</H2><PRE>
|
|
For accessing USB devices, the USB library libusb is used. There used
|
|
to exist another method to access USB devices: the kernel scanner
|
|
driver. The kernel scanner driver method is deprecated and shouldn't be
|
|
used anymore. It may be removed from SANE at any time. In Linux, the
|
|
kernel scanner driver has been removed in the 2.6.* kernel series. Only
|
|
libusb access is documented in this manual page.
|
|
|
|
|
|
</PRE>
|
|
<H2>LIBUSB</H2><PRE>
|
|
SANE can only use libusb 0.1.6 or newer. It needs to be installed at
|
|
build-time. Modern Linux distributions and other operating systems come
|
|
with libusb.
|
|
|
|
Libusb can only access your scanner if it's not claimed by the kernel
|
|
scanner driver. If you want to use libusb, unload the kernel driver
|
|
(e.g. rmmod scanner under Linux) or disable the driver when compiling a
|
|
new kernel. For Linux, your kernel needs support for the USB filesystem
|
|
(usbfs). For kernels older than 2.4.19, replace "usbfs" with "usbdevfs"
|
|
because the name has changed. This filesystem must be mounted. That's
|
|
done automatically at boot time, if /etc/fstab contains a line like
|
|
this:
|
|
|
|
none /proc/bus/usb usbfs defaults 0 0
|
|
|
|
The permissions for the device files used by libusb must be adjusted
|
|
for user access. Otherwise only root can use SANE devices. For <I>Linux</I>,
|
|
the devices are located in <I>/proc/bus/usb/</I> or in <I>/dev/bus/usb</I>, if you
|
|
use udev. There are directories named e.g. "001" (the bus name) con-
|
|
taining files "001", "002" etc. (the device files). The right device
|
|
files can be found out by running: <I>scanimage</I> <I>-L:</I> as root. Setting per-
|
|
missions with <B><A HREF="chmod.1.html">chmod(1)</A></B> is not permanent, however. They will be reset
|
|
after reboot or replugging the scanner.
|
|
|
|
Usually <B><A HREF="udev.7.html">udev(7)</A></B> or for older distributions the hotplug utilities are
|
|
used, which support dynamic setting of access permissions. SANE comes
|
|
with udev and hotplug scripts in the directory <I>tools/udev</I> and
|
|
<I>tools/hotplug</I>. They can be used for setting permissions, see
|
|
<I>/usr/local/share/doc/sane-backends/README.linux</I>, <I>tools/README</I> and the
|
|
<I>README</I> in the <I>tools/hotplug</I> directory for more details.
|
|
|
|
For the <B>BSDs</B>, the device files used by libusb are named <I>/dev/ugen*</I>.
|
|
Use chmod to apply appropriate permissions.
|
|
|
|
|
|
</PRE>
|
|
<H2>SANE ISSUES</H2><PRE>
|
|
This section assumes that your scanner is detected by <B>sane-find-scan-</B>
|
|
<B><A HREF="ner.1.html">ner(1)</A></B>. It doesn't make sense to go on, if this is not the case. While
|
|
<B><A HREF="sane-find-scanner.1.html">sane-find-scanner(1)</A></B> is able to detect any USB scanner, actual scanning
|
|
will only work if the scanner is supported by a SANE backend. Informa-
|
|
tion on the level of support can be found on the SANE webpage
|
|
(<I>http://www.sane-project.org/</I>), and the individual backend manpages.
|
|
|
|
Most backends can detect USB scanners automatically using "usb" config-
|
|
uration file lines. This method allows one to identify scanners by the
|
|
USB vendor and product numbers. The syntax for specifying a scanner
|
|
this way is:
|
|
|
|
usb <I>VENDOR</I> <I>PRODUCT</I>
|
|
|
|
where <I>VENDOR</I> is the USB vendor id, and <I>PRODUCT</I> is the USB product id of
|
|
the scanner. Both ids are non-negative integer numbers in decimal or
|
|
hexadecimal format. The correct values for these fields can be found by
|
|
running <B><A HREF="sane-find-scanner.1.html">sane-find-scanner(1)</A></B>, looking into the syslog (e.g.,
|
|
<I>/var/log/messages</I>) or under Linux by issuing the command <I>cat</I>
|
|
<I>/proc/bus/usb/devices</I>. This is an example of a config file line:
|
|
|
|
usb 0x055f 0x0006
|
|
|
|
would have the effect that all USB devices in the system with a vendor
|
|
id of 0x55f and a product id of 0x0006 would be probed and recognized
|
|
by the backend.
|
|
|
|
If your scanner is not detected automatically, it may be necessary to
|
|
edit the appropriate backend configuration file before using SANE for
|
|
the first time. For a detailed description of each backend's configu-
|
|
ration file, please refer to the relevant backend manual page (e.g.
|
|
<B><A HREF="sane-mustek_usb.5.html">sane-mustek_usb(5)</A></B> for Mustek USB scanners).
|
|
|
|
Do <B>not</B> create a symlink from <I>/dev/scanner</I> to the USB device because
|
|
this link is used by the SCSI backends. The scanner may be confused if
|
|
it receives SCSI commands.
|
|
|
|
|
|
</PRE>
|
|
<H2>ENVIRONMENT</H2><PRE>
|
|
<B>SANE_DEBUG_SANEI_USB</B>
|
|
If the library was compiled with debug support enabled, this
|
|
environment variable controls the debug level for the USB I/O
|
|
subsystem. E.g., a value of 128 requests all debug output to be
|
|
printed. Smaller levels reduce verbosity. Values greater than 4
|
|
enable libusb debugging (if available). Example: <I>export</I>
|
|
<I>SANE</I><B>_</B><I>DEBUG</I><B>_</B><I>SANEI</I><B>_</B><I>USB=4</I>.
|
|
|
|
<B>SANE_USB_WORKAROUND</B>
|
|
If your scanner does not work when plugged into a USB3 port, try
|
|
setting the environment variable <B>SANE_USB_WORKAROUND</B> to 1. This
|
|
may work around issues which happen with particular kernel ver-
|
|
sions. Example: <I>export</I> <I>SANE</I><B>_</B><I>USB</I><B>_</B><I>WORKAROUND=1.</I>
|
|
|
|
|
|
</PRE>
|
|
<H2>SEE ALSO</H2><PRE>
|
|
<B><A HREF="sane.7.html">sane(7)</A></B>, <B><A HREF="sane-find-scanner.1.html">sane-find-scanner(1)</A></B>, <B>sane-"backendname"</B>(5), <B><A HREF="sane-scsi.5.html">sane-scsi(5)</A></B>
|
|
|
|
|
|
</PRE>
|
|
<H2>AUTHOR</H2><PRE>
|
|
Henning Meier-Geinitz <<I>henning@meier-geinitz.de</I>>
|
|
|
|
14 Jul 2008 <B><A HREF="sane-usb.5.html">sane-usb(5)</A></B>
|
|
</PRE>
|
|
<HR>
|
|
<ADDRESS>
|
|
Man(1) output converted with
|
|
<a href="http://www.oac.uci.edu/indiv/ehood/man2html.html">man2html</a>
|
|
</ADDRESS>
|
|
</BODY>
|
|
</HTML>
|