From: briand on
device `epson2:/dev/sg1' is a Epson GT-9700 flatbed scanner

crw-rw----+ 1 root root 21, 1 Jul 14 18:57 /dev/sg1

here's the rule it looks like it should be matching :


# Epson Perfection 2450 | Epson GT-9700F | Epson Perfection 2450 PHOTO
ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0112", MODE="0664",
GROUP="scanner", ENV{libsane_matched}="yes"

Because, you know, that's the scanner I have :-)

So I'm not clear on how I can figure out whether a rule was matched at
all, and if it was, which one was matched.

Also, what's the best way to add rules to /etc/udev to force "my" rules
to be checked first. Do I simply add a rules file with a low prefix
number ??

Thanks,

Brian


--
To UNSUBSCRIBE, email to debian-user-REQUEST(a)lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster(a)lists.debian.org
Archive: http://lists.debian.org/20100714200905.512a9876(a)windy.deldotd.com
From: Bill Dennen on
On Thu, 15 Jul 2010 05:10:02 +0200, briand scribbled:

> device `epson2:/dev/sg1' is a Epson GT-9700 flatbed scanner
>
> crw-rw----+ 1 root root 21, 1 Jul 14 18:57 /dev/sg1
>
> here's the rule it looks like it should be matching :
>
>
> # Epson Perfection 2450 | Epson GT-9700F | Epson Perfection 2450 PHOTO
> ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0112", MODE="0664",
> GROUP="scanner", ENV{libsane_matched}="yes"
>
> Because, you know, that's the scanner I have :-)
>
> So I'm not clear on how I can figure out whether a rule was matched at
> all, and if it was, which one was matched.
>
> Also, what's the best way to add rules to /etc/udev to force "my" rules
> to be checked first. Do I simply add a rules file with a low prefix
> number ??
>
> Thanks,
>
> Brian

Humor me, I suggested lspci -nn earlier and it's still the way ...
udev will be matching on the vendor and device id fields. In the stanza
that's 0x04b8 and 0x0112 respectively. If your device doesn't return
those values then it isn't a match regardless of what the comment says.

(PS, you'd be surprised what is considered to be PCI ...)

Regards
--
>@<
Bill Dennen ieee1014(a)hotmail.com
Of all the things I miss, I miss my mind the most ...


--
To UNSUBSCRIBE, email to debian-user-REQUEST(a)lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster(a)lists.debian.org
Archive: http://lists.debian.org/i1qeth$uu5$1(a)speranza.aioe.org
From: briand on
On Fri, 16 Jul 2010 20:20:01 +0000 (UTC)
Bill Dennen <ieee1014(a)hotmail.com> wrote:

> On Thu, 15 Jul 2010 05:10:02 +0200, briand scribbled:
>
> > device `epson2:/dev/sg1' is a Epson GT-9700 flatbed scanner
> >
> > crw-rw----+ 1 root root 21, 1 Jul 14 18:57 /dev/sg1
> >
> > here's the rule it looks like it should be matching :
> >
> >
> > # Epson Perfection 2450 | Epson GT-9700F | Epson Perfection 2450
> > PHOTO ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0112",
> > MODE="0664", GROUP="scanner", ENV{libsane_matched}="yes"
> >
> > Because, you know, that's the scanner I have :-)
> >
> > So I'm not clear on how I can figure out whether a rule was matched
> > at all, and if it was, which one was matched.
> >
> > Also, what's the best way to add rules to /etc/udev to force "my"
> > rules to be checked first. Do I simply add a rules file with a low
> > prefix number ??
> >
> > Thanks,
> >
> > Brian
>
> Humor me, I suggested lspci -nn earlier and it's still the way ...
> udev will be matching on the vendor and device id fields. In the
> stanza that's 0x04b8 and 0x0112 respectively. If your device doesn't
> return those values then it isn't a match regardless of what the
> comment says.
>
> (PS, you'd be surprised what is considered to be PCI ...)
>

yes I did try that, and it's not useful, i.e. the scanner doesn't show
up. nothing which gets plugged into firewire or usb shows up there, so
I'm really not sure why you think that it should.

I don't know what version of udev your using but the version I'm using
doesn't seem to care about the idProduct fields.

This is the rule which i put in a scanner.rules file
in /etc/udev/rules.d:

KERNEL=="sg[0-9]*", ATTRS{type}=="3", ATTRS{vendor}=="EPSON",
ATTRS{model}=="GT-9700", MODE="0664", GROUP="scanner",
ENV{libsane_matched}="yes"

which matches on the model and vendor strings and not the idVendor or
idProduct.

So there were two parts of to this problem:

1 users needed to be in the scanner group
2 libsane does not have a udev rule to match the scanner

I filed a wishlist bug against 2, so maybe someday the rule will make
it into the libsane distribution.

Brian


--
To UNSUBSCRIBE, email to debian-user-REQUEST(a)lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster(a)lists.debian.org
Archive: http://lists.debian.org/20100716180449.4943f015(a)windy.deldotd.com
From: Tzafrir Cohen on
On Wed, Jul 14, 2010 at 08:09:05PM -0700, briand(a)aracnet.com wrote:
> device `epson2:/dev/sg1' is a Epson GT-9700 flatbed scanner
>
> crw-rw----+ 1 root root 21, 1 Jul 14 18:57 /dev/sg1
>
> here's the rule it looks like it should be matching :
>
>
> # Epson Perfection 2450 | Epson GT-9700F | Epson Perfection 2450 PHOTO
> ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0112", MODE="0664",
> GROUP="scanner", ENV{libsane_matched}="yes"

Where should $libsane_matched be set?

>
> Because, you know, that's the scanner I have :-)
>
> So I'm not clear on how I can figure out whether a rule was matched at
> all, and if it was, which one was matched.

1. Have you reloaded udev rules after your changes?

udevadm control --reload-rules

On Lenny:

udevadm control --reload_rules

2. udevmonitor (udevadm monitor) can help you see what you actually get
with the events. Use the option --env.

3. You seem to have quite a few conditions. Consider removing some of
them to see which one is the offender that does not apply.

>
> Also, what's the best way to add rules to /etc/udev to force "my" rules
> to be checked first. Do I simply add a rules file with a low prefix
> number ??

Are there any other rules that apply?

--
Tzafrir Cohen | tzafrir(a)jabber.org | VIM is
http://tzafrir.org.il | | a Mutt's
tzafrir(a)cohens.org.il | | best
tzafrir(a)debian.org | | friend


--
To UNSUBSCRIBE, email to debian-user-REQUEST(a)lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster(a)lists.debian.org
Archive: http://lists.debian.org/20100718113625.GV17569(a)pear.tzafrir.org.il
From: briand on
On Sun, 18 Jul 2010 11:36:25 +0000
Tzafrir Cohen <tzafrir(a)cohens.org.il> wrote:


> 1. Have you reloaded udev rules after your changes?
>
> udevadm control --reload-rules

that was one mistake I was making so I did

/etc/init.d/udev restart

>
> On Lenny:
>
> udevadm control --reload_rules
>
> 2. udevmonitor (udevadm monitor) can help you see what you actually
> get with the events. Use the option --env.
>

yes ! I figured this out. in fact I've been spending quality time with
udevadm.

>
> Are there any other rules that apply?
>

what I was really asking was "where do I put MY rules to make sure that
you dev tries to match them first. The answer I came up with was to
put a file "10-local.rules" in /etc/udev/rules.d.

This works just fine and now everything works as expected.

Brian


--
To UNSUBSCRIBE, email to debian-user-REQUEST(a)lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster(a)lists.debian.org
Archive: http://lists.debian.org/20100718095317.5f9108c5(a)windy.deldotd.com