User Tools

Site Tools


docs:scanners

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

docs:scanners [2010-04-15 13:12]
Mateusz Korniak My notes over scanners config
docs:scanners [2010-04-15 14:37] (current)
Mateusz Korniak All I needed to run two my scanners.
Line 19: Line 19:
 <​file>​ /​usr/​sbin/​lsusb <​file>​ /​usr/​sbin/​lsusb
 </​file>​ </​file>​
-Plug in scanner, check /​var/​log/​kernel for sth similar to: +Plug in scanner, check ///​var/​log/​kernel// for sth similar to: 
  
 <​file>​Apr 15 10:34:27 laptop-hp kernel: [ 8122.892835] usb 2-1: new full speed USB device using ohci_hcd and address 4 <​file>​Apr 15 10:34:27 laptop-hp kernel: [ 8122.892835] usb 2-1: new full speed USB device using ohci_hcd and address 4
Line 29: Line 29:
 or run lsusb again and notice new device. ​ or run lsusb again and notice new device. ​
  
 +
 +
 +==== Testing if sane recognizes scanner ====
 +Run (first from user account and later via sudo) 
 +
 +<​file>​sane-find-scanner
 +</​file>​
 +One should see: 
 +
 +<​file>​found USB scanner (vendor=0x055f,​ product=0x021b,​ chip=GT-6816?​) at libusb:​002:​004
 +</​file>​
 +If there is also information ​
 +
 +<​file>​libusb couldn'​t open USB device /​dev/​bus/​usb/​002/​004:​ Permission denied.
 +libusb requires write access to USB device nodes.
 +</​file>​
 +meaning there is privilages problem  ​
 +
 +
 +
 +==== Solving /​dev/​bus/​usb/​*/​* privilages problem ====
 +If device being scanner has root:root privilates: ​
 +
 +<​file>​crw-rw-r-- 1 root root 189, 131 Apr 15 10:43 /​dev/​bus/​usb/​002/​004
 +</​file>​
 +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): ​
 +
 +<​file>​udevadm info -a --name /​dev/​usbdev2.4 ​
 +</​file>​
 +or monitoring udev events (with properties display) during device plugin ​
 +
 +<​file>​udevadm monitor --property
 +</​file>​
 +Most likely criteria would be SYSFS{idVendor}== and SYSFS{idProduct} so rule migh look like: 
 +
 +
 +
 +<​file>​SYSFS{idVendor}=="​055f",​ SYSFS{idProduct}=="​021b",​ MODE="​0664",​ GROUP="​scanner",​ ENV{libsane_matched}="​yes"​
 +</​file>​
 +Reload udev rules: ​
 +
 +<​file>​udevadm control --reload-rules
 +</​file>​
 +and unplug, plug device or trigger all rules again: ​
 +
 +<​file>​udevadm trigger
 +</​file>​
 +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>#​ file: 003/009
 +# owner: root
 +# group: root
 +user::rw-
 +user:​matkor:​rw-
 +group::rw-
 +mask::rw-
 +other::r--
 +</​file>​
 +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 ====
  
docs/scanners.1271329933.txt.gz ยท Last modified: 2010-04-15 13:12 by Mateusz Korniak