PLDWWW: Docs/scanners

Mateusz Korniak "Mateusz Korniak" at pld-linux.org
Thu Apr 15 14:37:11 CEST 2010


Author: Mateusz Korniak   Date: Thu Apr 15 12:37:11 2010 GMT
Module: PLDWWW   URL: http://www.pld-linux.org/Docs/scanners?action=diff&rev2=2&rev1=1
---- Log message:
All I needed to run two my scanners.

---- Page affected: Docs/scanners

---- Diffs:

================================================================
The comment on the change is:
All I needed to run two my scanners.

   /usr/sbin/lsusb
  }}}
  
- Plug in scanner, check /var/log/kernel for sth similar to:
+ Plug in scanner, check ''/var/log/kernel'' for sth similar to:
  {{{
  Apr 15 10:34:27 laptop-hp kernel: [ 8122.892835] usb 2-1: new full speed USB device using ohci_hcd and address 4
  Apr 15 10:34:27 laptop-hp kernel: [ 8123.078105] usb 2-1: New USB device found, idVendor=055f, idProduct=021b
@@ -25, +25 @@

  }}}
  or run lsusb again and notice new device.
  
+ === Testing if sane recognizes scanner ===
+ Run (first from user account and later via sudo)
+ {{{
+ sane-find-scanner
+ }}}
+ One should see:
+ {{{
+ found USB scanner (vendor=0x055f, product=0x021b, chip=GT-6816?) at libusb:002:004
+ }}}
+ If there is also information
+ {{{
+ libusb couldn't open USB device /dev/bus/usb/002/004: Permission denied.
+ libusb requires write access to USB device nodes.
+ }}}
+ meaning there is privilages problem 
+ 
+ === Solving /dev/bus/usb/*/* privilages problem ===
+ If device being scanner has root:root privilates:
+ {{{
+ crw-rw-r-- 1 root root 189, 131 Apr 15 10:43 /dev/bus/usb/002/004
+ }}}
+ regular users will not be able to use scanner device.
+ 
+ Option is adding new udev rule to file ''/etc/udev/rules.d/41-libsane-local.rules'' which will deal with adding scanner device.
+ 
+ 
+ Selection criteria can be found from issuing command (after using proper usb bus numbers 2.4 in example):
+ {{{
+ udevadm info -a --name /dev/usbdev2.4 
+ }}}
+ or monitoring udev events (with properties display) during device plugin
+ {{{
+ udevadm monitor --property
+ }}}
+ 
+ Most likely criteria would be SYSFS{idVendor}== and SYSFS{idProduct} so rule migh look like:
+ 
+ {{{
+ SYSFS{idVendor}=="055f", SYSFS{idProduct}=="021b", MODE="0664", GROUP="scanner", ENV{libsane_matched}="yes"
+ }}}
+ 
+ Reload udev rules:
+ {{{
+ udevadm control --reload-rules
+ }}}
+ and unplug, plug device or trigger all rules again:
+ {{{
+ udevadm trigger
+ }}}
+ and verify results.
+ 
+ 
+ Note that we here try to use non-existing in PLD group 'scanner' but somehow rule works for me (udev-151, kernel-2.6.32.8) and something (TODO: what? by what criteria ?) adding currenly logged in on Xconsole user ? to device acl, so 
+ 'getfacl /dev/bus/usb/003/009' returns:
+ 
+ {{{
+ # file: 003/009
+ # owner: root
+ # group: root
+ user::rw-
+ user:matkor:rw-
+ group::rw-
+ mask::rw-
+ other::r--
+ }}}
+ 
+ and device is accesible (rw) for user 'matkor'.
+ 
+ Of course if above does not work, one can select any group 'usb', 'users' etc to be added for device.
+ 
+ === Firmware files needed for scanner models ===
+ Sometimes firmware file must be loaded to scanner before using it but required file(s) are not included with sane and must be downloaded from drivers/webpages. Run xsane from console and observere which files seems be needed for given scanner device.
+ 
+ === Clients: xsane ===
+ 


More information about the pld-cvs-commit mailing list