[sane-devel] Epson Perfection v370 Not Responding

C. Cook c.a.cook at quantum-sci.com
Sun Sep 20 18:39:47 BST 2020


On 2020-09-20 00:33, Andrea Croci wrote:
> Hello everybody,
>
> I believe I too have a permission problem like this, although with other
> scanners.
>
> Xsane sees both my Epson and my Canon right from my laptop with a new
> Ubuntu 20.04.
>
> From the desktop with 18.04 Xsane can't find any scanner. They both
> work fine with scanimage, though.
>
> Would anyone please tell me what I need to look at and how do I fix
> this? I'm not familiar with this 'udev' stuff.
>
> Thank you, regards.

Hi Andrea,

First, it's considered good listserv etiquette to reply -after- the
prior response, because it keeps a sensible conversation.  Feel free to
trim any cruft above when it becomes irrelevant.

Second, 'udev' is what we, from the old VAX days, called 'auto-sizing'. 
It helps the kernel set up devices on boot.  But sometimes it needs
help, so we set those rules in /etc/udev/rules.d .

$ lsusb
...
Bus 001 Device 019: ID 04b8:014a Seiko Epson Corp.
...

Notice that --at the moment-- my scanner is at bus 001 position 019, but
that amusingly changes every time you power off or unplug the scanner.

Notice also that my scanner's Vendor is 04b8 (Epson) and model is 014a
(Perfection v370).  There are tables on The Internets where you can look
this up, but it isn't necessary.

Here's the problem:

# ls -al /dev/bus/usb/001
total 0
drwxr-xr-x  2 root root     180 Sep 19 16:01 .
drwxr-xr-x  4 root root      80 Aug 28 19:15 ..
crw-rw-r--  1 root root 189,  0 Aug 28 19:15 001
crw-rw-r--  1 root root 189,  1 Aug 28 19:15 002
crw-rw-r--  1 root root 189,  2 Aug 28 19:15 003
crw-rw-r--  1 root root 189,  3 Aug 28 19:15 004
crw-rw-r--  1 root root 189,  4 Aug 28 19:15 005
crw-rw-r--  1 root root 189,  5 Aug 28 19:15 006
crw-rw-r--+ 1 root root 189, 18 Sep 19 18:01 019

Which is my scanner device?

Remember, 019.  Notice that Owner/Group is root and permissions for
those are read/write.  BUT permission for Others is read-only.  So no
ordinry user can send commands to the scanner...  but root can.

These permissions are set by a udev rules file which comes with your OS,
probably at /usr/lib/udev/rules.d/50-udev-default.rules which has the
command

SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", MODE="0664"

Well, we can't have that with the scanner if our users are to be able to
use it.  Unfortunately no .deb or .rpm package manager has been
considerate enough to include a rule to fix this universal and
frustrating problem.  So we few make our own rule.

Where?  Remember, in /etc/udev/rules.d .  Now, udev rules are run by the
system lexigraphically, whether they're in /usr/lib/udev/rules.d/ or
/etc/udev/rules.d .  So we must make sure our rule runs -after- the
system's rule, so I named my rule 60-carls-scanner.rules -- additions I
make to /etc I put my name in them so I can later do a quick mlocate for
them and be sure to save them.  Starting the name with 60- makes sure
it'll run -after- the system's rule.

In that file you put:

SUBSYSTEM=="usb", ATTR{idVendor}=="04b8", ATTR{idProduct}=="014a",
OWNER="saned", GROUP="saned", MODE="0666"

We have now set the owner and group of -that- scanner (Vendor/Model), no
matter where on the USB bus it pops up, and we've also set it
world-writable so that any user can use it.

As Sean kindly reminds us, now rather than rebooting, you can:

$ sudo udevadm control --reload-rules

... and un/plug the scanner.

check it:

$ lsusb

$ ls -al /dev/bus/usb/001

and it will work.












More information about the sane-devel mailing list