== Mustek 1200UB Scanner == === There is no kernel module === The Mustek 1200UB scanner does not require a kernel driver module, instead using the [[libsane]] userspace library for operation. === Required packages === The following package suites are required to operate the flatbed scanner: * [[sane]] * [[sane-utils]] * [[libsane]] === Checking the scanner for connectivity === The [[lsusb]] tool should show the scanner attached to the [[usb]] port: lsusb Bus 001 Device 003: ID 055f:0006 Mustek Systems, Inc. ScanExpress 1200 U The sane-find-scanner tool should identify the scanner as usable: sane-find-scanner|grep "^found" found USB scanner (vendor=0x055f, product=0x0006, chip=MA-1017) at libusb:001:003 === System groups for scanner users === In order to be able to operate the scanner as a normal user, it is necessary to become a member of the scanner system group. As [[root]], create this group, if it does not exist on the system: groupadd -g 23 scanner As [[root]], add users to the scanner group: gpasswd -a foobar scanner === Configuration of sane for utilization of the scanner === The !/etc/sane.d/mustek_usb.conf configuration file should contain the following entries: # Autodetect 1200 UB and Trust Compact Scan USB 19200 usb 0x055f 0x0006 /dev/bus/usb/001/003 option 1200ub Notice that 001 and 003 correspond to the USB bus and device numbers and must be set to values that match the numbers identified by [[lsusb]] above. === Making the usbfs filesystem mountable === The [[libsane]] userspace library can only access the scanner if it is not claimed by the kernel scanner driver. The [[usbfs]] filesystem must be mounted in order for [[libsane]] to be able to operate. The !/etc/fstab configuration file should contain the following entry: none /proc/bus/usb usbfs defaults 0 0 === Creating the udev entries === It is now necessary to create the /etc/udev/rules.d/libsane.rules file with entries as follows: # This file was automatically created based on description files (*.desc) # by sane-desc 3.5 from sane-backends 1.0.21 on Sun Dec 12 16:18:21 2010 # ACTION!="add", GOTO="libsane_rules_end" ENV{DEVTYPE}=="usb_device", GOTO="libsane_create_usb_dev" SUBSYSTEMS=="scsi", GOTO="libsane_scsi_rules_begin" SUBSYSTEM=="usb_device", GOTO="libsane_usb_rules_begin" SUBSYSTEM!="usb_device", GOTO="libsane_usb_rules_end" # Kernel >= 2.6.22 jumps here LABEL="libsane_create_usb_dev" # For Linux >= 2.6.22 without CONFIG_USB_DEVICE_CLASS=y # If the following rule does not exist on your system yet, uncomment it # ENV{DEVTYPE}=="usb_device", MODE="0664", OWNER="root", GROUP="root" # Kernel < 2.6.22 jumps here LABEL="libsane_usb_rules_begin" # Mustek ScanExpress 1200 UB | Trust Compact Scan USB 19200 ATTRS{idVendor}=="055f", ATTRS{idProduct}=="0006", MODE="0664", GROUP="scanner", ENV{libsane_matched}="yes" # The following rule will disable USB autosuspend for the device ENV{libsane_matched}=="yes", RUN+="/bin/sh -c 'test -e /sys/$env{DEVPATH}/power/ level && echo on > /sys/$env{DEVPATH}/power/level'" LABEL="libsane_usb_rules_end" SUBSYSTEMS!="scsi", GOTO="libsane_scsi_rules_end" LABEL="libsane_scsi_rules_begin" # Generic: SCSI device type 6 indicates a scanner KERNEL=="sg[0-9]*", ATTRS{type}=="6", MODE="0664", GROUP="scanner", ENV{libsane_matched}="yes" # Some scanners advertise themselves as SCSI device type 3 KERNEL=="sg[0-9]*", ATTRS{type}=="3", ATTRS{vendor}=="HP", ATTRS{model}=="C7670A", MODE="0664", GROUP="scanner", ENV{libsane_matched}="yes" LABEL="libsane_scsi_rules_end" LABEL="libsane_rules_end" ==== A template file may be available ==== Note that a template file may be available in the /lib/udev/rules.d directory. Do not symlink this file. Instead copy it to !/etc/udev/rules.d/libsane.rules. === The scanner will be available for use when the system is restarted === The [[udev]] system will need to evaluate the new rules, and [[fstab]] will need to be evaluated in order for the above changes to take effect. This will occur automatically, when the system is next rebooted. === Producing a test scan === A test scan can be produced by placing a picture into the scanner and using the following command: scanimage --mode color --resolution 300 >image.pnm