Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[TIP] Epson Stylus SX200 MFP
View unanswered posts
View posts from last 24 hours

Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message

Joined: 11 Jan 2009
Posts: 5

PostPosted: Sun Jan 11, 2009 11:28 pm    Post subject: [TIP] Epson Stylus SX200 MFP Reply with quote

While gutenprint takes care of the printing part rather well, scanning can be a problem with this model. When using the "epson" driver shipped with SANE, I got this kernel error:
"usbfs: interface 1 claimed by usblp while 'scanimage' sets config #1"

The problem is that 3 USB devices (printer, scanner, card reader) share the same USB cable. The trick is to install iscan (I used 2.15.0 from bugzilla) and comment out all drives except "epkowa" from /etc/sane.d/dll.conf . Now we still have an interface disputed by two drivers (usb_storage and sane) but this time we can easily discard one and still keep the printing capacity (as long as usb_storage is compiled as a module, of course). Edit /etc/udev/rules.d/70-libsane.rules and add this line after the other Epson devices (the device IDs come from lsusb):
ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0849", MODE="0664", GROUP="scanner", ENV{libsane_matched}="yes", RUN+="/root/scripts/"

The goal is to get a device with the proper permissions and to execute a shell script when the device is plugged in. "" contains the line "rmmod usb_storage". Now printing and scanning work for root and the users in the "scanner" group, but what about USB mass storage devices that will trigger the loading of usb_storage when plugged? Disabling the scanner while using the USB flash key is not an issue, but once the key is removed we want the module automatically unloaded so we create "/etc/udev/rules.d/80-custom.rules" with the following content:
SUBSYSTEM!="block", ENV{ID_BUS}!="usb", ACTION!="remove", GOTO="custom_rules_end"
SUBSYSTEM=="block", ENV{ID_BUS}=="usb", ACTION=="remove", RUN+="/root/scripts/ $env{DEVNAME}"
LABEL="custom_rules_end" unmounts the device and discards the module:

sleep 1
umount "$1"
rmmod usb_storage

After restarting the udev init script, the new rules are in effect.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum