Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #186681 > unrolled thread

Scanner problem

Started byMENGUAL Jean-Philippe <mengualjeanphi@free.fr>
First post2017-09-11 20:50 +0200
Last post2017-09-13 12:40 +0200
Articles 10 — 3 participants

Back to article view | Back to linux.debian.user


Contents

  Scanner problem MENGUAL Jean-Philippe <mengualjeanphi@free.fr> - 2017-09-11 20:50 +0200
    Re: Scanner problem Brian <ad44@cityscape.co.uk> - 2017-09-12 11:30 +0200
      Re: Scanner problem MENGUAL Jean-Philippe <mengualjeanphi@free.fr> - 2017-09-12 22:10 +0200
        Re: Scanner problem Michael Stone <mstone@debian.org> - 2017-09-12 23:30 +0200
        Re: Scanner problem Brian <ad44@cityscape.co.uk> - 2017-09-13 00:10 +0200
          Re: Scanner problem MENGUAL Jean-Philippe <mengualjeanphi@free.fr> - 2017-09-13 01:20 +0200
            Re: Scanner problem Michael Stone <mstone@debian.org> - 2017-09-13 07:40 +0200
              Re: Scanner problem MENGUAL Jean-Philippe <mengualjeanphi@free.fr> - 2017-09-13 08:40 +0200
                Re: Scanner problem Brian <ad44@cityscape.co.uk> - 2017-09-13 11:40 +0200
                Re: Scanner problem Michael Stone <mstone@debian.org> - 2017-09-13 12:40 +0200

#186681 — Scanner problem

FromMENGUAL Jean-Philippe <mengualjeanphi@free.fr>
Date2017-09-11 20:50 +0200
SubjectScanner problem
Message-ID<uoBWp-75f-5@gated-at.bofh.it>

[Multipart message — attachments visible in raw view] — view raw

Hi,


Two scanners: 1=Epson; 2=canon. 1 works fine, as root and as user. Canon
works as root but not as user, scanimage and sane-find-scanner do not
find it.


While /dev/bus/usb/001/0XX is owned by root:root,, but as well by the
scanner group (where my user is), it is not the case with Canon, the
device is owned only by root:root.


If I do setfacl -mgroup:scanner:rw- the scanner works as regular user.


My questions:

1. Why permissions are set properly for Epson and not Canon?

2. How can I create a Udev rule to fix itN

3. Should I reportbug to the sane package?


Thanks. If I should write to another list such as debian-sane or
whatever, tell me.


Best regards,


-- 
signature_jp_2
Logo Hypra 	JEAN-PHILIPPE MENGUAL
DIRECTEUR TECHNIQUE ET QUALITÉ
102, rue des poissonniers, 75018, Paris
Tel : +331 84 73 06 61 <tel:+33184730661> Mob : +336 76 34 93 37
<tel:+33676349337>
jpmengual@hypra.fr <mailto:jpmengual@hypra.fr>
www.hypra.fr <http://www.hypra.fr/>
Facebook Hypra <https://www.facebook.com/hyprasoftware/> Twitter Hypra
<https://twitter.com/Hypra_> Linkedin Jean-Philippe
<https://fr.linkedin.com/in/jean-philippe-mengual-800133135>


[toc] | [next] | [standalone]


#186701

FromBrian <ad44@cityscape.co.uk>
Date2017-09-12 11:30 +0200
Message-ID<uoPG1-7Td-13@gated-at.bofh.it>
In reply to#186681
On Mon 11 Sep 2017 at 19:23:09 +0200, MENGUAL Jean-Philippe wrote:

> Two scanners: 1=Epson; 2=canon. 1 works fine, as root and as user. Canon
> works as root but not as user, scanimage and sane-find-scanner do not
> find it.

Do we assume your system is a stretch one? Please post the model names
of the scanners.
 
> While /dev/bus/usb/001/0XX is owned by root:root,, but as well by the
> scanner group (where my user is), it is not the case with Canon, the
> device is owned only by root:root.

On jessie and stretch a user is not required to be in the scanner group.

Post the output of 'ls -l /dev/bus/usb/*/*' for both scanners.

> If I do setfacl -mgroup:scanner:rw- the scanner works as regular user.

This should be unnecessary.

> My questions:
> 
> 1. Why permissions are set properly for Epson and not Canon?

Let's see if we can find out.
 
> 2. How can I create a Udev rule to fix itN
> 
> 3. Should I reportbug to the sane package?
> 
> Thanks. If I should write to another list such as debian-sane or
> whatever, tell me.

Hopefully, doing any of these will become superfluous.

There is a wiki page dealing with scanners.

-- 
Brian.

[toc] | [prev] | [next] | [standalone]


#186719

FromMENGUAL Jean-Philippe <mengualjeanphi@free.fr>
Date2017-09-12 22:10 +0200
Message-ID<uoZFo-5Ul-11@gated-at.bofh.it>
In reply to#186701
Hi,


Le 12/09/2017 à 11:22, Brian a écrit :
> On Mon 11 Sep 2017 at 19:23:09 +0200, MENGUAL Jean-Philippe wrote:
> 
>> Two scanners: 1=Epson; 2=canon. 1 works fine, as root and as user. Canon
>> works as root but not as user, scanimage and sane-find-scanner do not
>> find it.
> 
> Do we assume your system is a stretch one? Please post the model names
> of the scanners.


I try on Stretch and Buster.

We have Epson Perfection 3490 and Canon Lide 120.



>> While /dev/bus/usb/001/0XX is owned by root:root,, but as well by the
>> scanner group (where my user is), it is not the case with Canon, the
>> device is owned only by root:root.
> 
> On jessie and stretch a user is not required to be in the scanner group.
> 
> Post the output of 'ls -l /dev/bus/usb/*/*' for both scanners.

For Epson:
crw-rw-r--  1 root root 189, 136 sept. 12 21:07 /dev/bus/usb/002/009
crw-rw-r--+ 1 root root 189,  28 sept. 12 21:06 /dev/bus/usb/001/029
crw-rw-r--  1 root root 189,  27 sept. 12 20:56 /dev/bus/usb/001/028
crw-rw-r--  1 root root 189,   1 sept. 12 20:56 /dev/bus/usb/001/002
crw-rw-r--  1 root root 189, 129 sept. 12 20:56 /dev/bus/usb/002/002
crw-rw-r--  1 root root 189,   0 sept. 11 18:56 /dev/bus/usb/001/001
crw-rw-r--  1 root root 189, 128 sept. 11 18:56 /dev/bus/usb/002/001
crw-rw-r--  1 root root 189, 131 sept. 11 18:56 /dev/bus/usb/002/004
crw-rw-r--  1 root root 189,   2 sept.  5 20:04 /dev/bus/usb/001/003

For Canon:
crw-rw-r-- 1 root root 189, 136 sept. 12 21:09 /dev/bus/usb/002/009
crw-rw-r-- 1 root root 189,  29 sept. 12 21:09 /dev/bus/usb/001/030
crw-rw-r-- 1 root root 189,  27 sept. 12 20:56 /dev/bus/usb/001/028
crw-rw-r-- 1 root root 189,   1 sept. 12 20:56 /dev/bus/usb/001/002
crw-rw-r-- 1 root root 189, 129 sept. 12 20:56 /dev/bus/usb/002/002
crw-rw-r-- 1 root root 189,   0 sept. 11 18:56 /dev/bus/usb/001/001
crw-rw-r-- 1 root root 189, 128 sept. 11 18:56 /dev/bus/usb/002/001
crw-rw-r-- 1 root root 189, 131 sept. 11 18:56 /dev/bus/usb/002/004
crw-rw-r-- 1 root root 189,   2 sept.  5 20:04 /dev/bus/usb/001/003

FYI (and without I do any configuration anywhere, I just plug in scanners):
getfacl /dev/bus/usb/001/031:

Canon:
getfacl : suppression du premier « / » des noms de chemins absolus
# file: dev/bus/usb/001/031
# owner: root
# group: root
user::rw-
group::rw-
other::r--

getfacl /dev/bus/usb/001/032 (EPSON):
getfacl : suppression du premier « / » des noms de chemins absolus
# file: dev/bus/usb/001/032
# owner: root
# group: root
user::rw-
user:jp:rw-
group::rw-
group:scanner:rw-
mask::rw-
other::r--

Many thanks for  your help

Best regards,


> 
>> If I do setfacl -mgroup:scanner:rw- the scanner works as regular user.
> 
> This should be unnecessary.
> 
>> My questions:
>>
>> 1. Why permissions are set properly for Epson and not Canon?
> 
> Let's see if we can find out.
>  
>> 2. How can I create a Udev rule to fix itN
>>
>> 3. Should I reportbug to the sane package?
>>
>> Thanks. If I should write to another list such as debian-sane or
>> whatever, tell me.
> 
> Hopefully, doing any of these will become superfluous.
> 
> There is a wiki page dealing with scanners.
> 

-- 
Logo Hypra 	JEAN-PHILIPPE MENGUAL
DIRECTEUR TECHNIQUE ET QUALITÉ
102, rue des poissonniers, 75018, Paris
Tel : +331 84 73 06 61 <tel:+33184730661> Mob : +336 76 34 93 37
<tel:+33676349337>
jpmengual@hypra.fr <mailto:jpmengual@hypra.fr>
www.hypra.fr <http://www.hypra.fr/>
Facebook Hypra <https://www.facebook.com/hyprasoftware/> Twitter Hypra
<https://twitter.com/Hypra_> Linkedin Jean-Philippe
<https://fr.linkedin.com/in/jean-philippe-mengual-800133135>

[toc] | [prev] | [next] | [standalone]


#186725

FromMichael Stone <mstone@debian.org>
Date2017-09-12 23:30 +0200
Message-ID<up0UO-6DU-19@gated-at.bofh.it>
In reply to#186719
On Tue, Sep 12, 2017 at 09:21:33PM +0200, MENGUAL Jean-Philippe wrote:
>We have Epson Perfection 3490 and Canon Lide 120.
>
>>> While /dev/bus/usb/001/0XX is owned by root:root,, but as well by the
>>> scanner group (where my user is), it is not the case with Canon, the
>>> device is owned only by root:root.

Take a look at /lib/udev/rules.d/60-libsane.rules and 
/usr/share/doc/libsane/README.Debian.gz

The lsusb command should show you the vendor and product ids.

Mike Stone

[toc] | [prev] | [next] | [standalone]


#186726

FromBrian <ad44@cityscape.co.uk>
Date2017-09-13 00:10 +0200
Message-ID<up1xw-77C-25@gated-at.bofh.it>
In reply to#186719
On Tue 12 Sep 2017 at 21:21:33 +0200, MENGUAL Jean-Philippe wrote:

> Le 12/09/2017 à 11:22, Brian a écrit :
> > On Mon 11 Sep 2017 at 19:23:09 +0200, MENGUAL Jean-Philippe wrote:
> > 
> >> Two scanners: 1=Epson; 2=canon. 1 works fine, as root and as user. Canon
> >> works as root but not as user, scanimage and sane-find-scanner do not
> >> find it.
> > 
> > Do we assume your system is a stretch one? Please post the model names
> > of the scanners.
> 
> 
> I try on Stretch and Buster.
> 
> We have Epson Perfection 3490 and Canon Lide 120.
> 
> >> While /dev/bus/usb/001/0XX is owned by root:root,, but as well by the
> >> scanner group (where my user is), it is not the case with Canon, the
> >> device is owned only by root:root.
> > 
> > On jessie and stretch a user is not required to be in the scanner group.
> > 
> > Post the output of 'ls -l /dev/bus/usb/*/*' for both scanners.
> 
> For Epson:
> crw-rw-r--  1 root root 189, 136 sept. 12 21:07 /dev/bus/usb/002/009
> crw-rw-r--+ 1 root root 189,  28 sept. 12 21:06 /dev/bus/usb/001/029
> crw-rw-r--  1 root root 189,  27 sept. 12 20:56 /dev/bus/usb/001/028
> crw-rw-r--  1 root root 189,   1 sept. 12 20:56 /dev/bus/usb/001/002
> crw-rw-r--  1 root root 189, 129 sept. 12 20:56 /dev/bus/usb/002/002
> crw-rw-r--  1 root root 189,   0 sept. 11 18:56 /dev/bus/usb/001/001
> crw-rw-r--  1 root root 189, 128 sept. 11 18:56 /dev/bus/usb/002/001
> crw-rw-r--  1 root root 189, 131 sept. 11 18:56 /dev/bus/usb/002/004
> crw-rw-r--  1 root root 189,   2 sept.  5 20:04 /dev/bus/usb/001/003

This is exactly what you would expect for a supported scanner. In
particular, the ACL:

  crw-rw-r--+ 1 root root 189,  28 sept. 12 21:06 /dev/bus/usb/001/029

> For Canon:
> crw-rw-r-- 1 root root 189, 136 sept. 12 21:09 /dev/bus/usb/002/009
> crw-rw-r-- 1 root root 189,  29 sept. 12 21:09 /dev/bus/usb/001/030
> crw-rw-r-- 1 root root 189,  27 sept. 12 20:56 /dev/bus/usb/001/028
> crw-rw-r-- 1 root root 189,   1 sept. 12 20:56 /dev/bus/usb/001/002
> crw-rw-r-- 1 root root 189, 129 sept. 12 20:56 /dev/bus/usb/002/002
> crw-rw-r-- 1 root root 189,   0 sept. 11 18:56 /dev/bus/usb/001/001
> crw-rw-r-- 1 root root 189, 128 sept. 11 18:56 /dev/bus/usb/002/001
> crw-rw-r-- 1 root root 189, 131 sept. 11 18:56 /dev/bus/usb/002/004
> crw-rw-r-- 1 root root 189,   2 sept.  5 20:04 /dev/bus/usb/001/003

There is no ACL for any device. But the Canon Lide 120 is a supported
device for SANE according to

  http://www.sane-project.org/sane-mfgs.html#Z-CANON
 
> FYI (and without I do any configuration anywhere, I just plug in scanners):
> getfacl /dev/bus/usb/001/031:
> 
> Canon:
> getfacl : suppression du premier « / » des noms de chemins absolus
> # file: dev/bus/usb/001/031
> # owner: root
> # group: root
> user::rw-
> group::rw-
> other::r--

You would want to have "user:jp:rw-", as you do with the Epson.
 
> getfacl /dev/bus/usb/001/032 (EPSON):
> getfacl : suppression du premier « / » des noms de chemins absolus
> # file: dev/bus/usb/001/032
> # owner: root
> # group: root
> user::rw-
> user:jp:rw-
> group::rw-
> group:scanner:rw-
> mask::rw-
> other::r--

The file /lib/udev/rules.d/60-libsane.rules does not have an entry for
the 120. See what happens with scanner detection if you add

  ATTRS{idvendor}=="04a9", ATTRS{idProduct}="x", ENV{libsane_matched}="yes"

to 60-libsane.rules?

You get "x" from the 'lsusb' command.

-- 
Brian.

[toc] | [prev] | [next] | [standalone]


#186727

FromMENGUAL Jean-Philippe <mengualjeanphi@free.fr>
Date2017-09-13 01:20 +0200
Message-ID<up2Dg-7P4-9@gated-at.bofh.it>
In reply to#186726
>> FYI (and without I do any configuration anywhere, I just plug in scanners):
>> getfacl /dev/bus/usb/001/031:
>>
>> Canon:
>> getfacl : suppression du premier « / » des noms de chemins absolus
>> # file: dev/bus/usb/001/031
>> # owner: root
>> # group: root
>> user::rw-
>> group::rw-
>> other::r--
> 
> You would want to have "user:jp:rw-", as you do with the Epson.
>  
>> getfacl /dev/bus/usb/001/032 (EPSON):
>> getfacl : suppression du premier « / » des noms de chemins absolus
>> # file: dev/bus/usb/001/032
>> # owner: root
>> # group: root
>> user::rw-
>> user:jp:rw-
>> group::rw-
>> group:scanner:rw-
>> mask::rw-
>> other::r--
> 
> The file /lib/udev/rules.d/60-libsane.rules does not have an entry for
> the 120. See what happens with scanner detection if you add
> 
>   ATTRS{idvendor}=="04a9", ATTRS{idProduct}="x", ENV{libsane_matched}="yes"
> 
> to 60-libsane.rules?
> 
> You get "x" from the 'lsusb' command.


I added:
ATTRS{idvendor}=="04a9", ATTRS{idProduct}="190e", ENV{libsane_matched}="yes"

in this file and, alternatively, in etc//udev/rules.d/60-libsane.rules,
as mentioned in the Debian README of libusb. Nothing has canged
unfortunately. I rebooted the machine before testing again.


Just for remembrer, with setfacl -mgroup:scanner:rw- the scanner works
as regular user. But no longer when I plug-out the scanner or reboot the
computer.

Thanks for your help,

Best regards


-- 
Logo Hypra 	JEAN-PHILIPPE MENGUAL
DIRECTEUR TECHNIQUE ET QUALITÉ
102, rue des poissonniers, 75018, Paris
Tel : +331 84 73 06 61 <tel:+33184730661> Mob : +336 76 34 93 37
<tel:+33676349337>
jpmengual@hypra.fr <mailto:jpmengual@hypra.fr>
www.hypra.fr <http://www.hypra.fr/>
Facebook Hypra <https://www.facebook.com/hyprasoftware/> Twitter Hypra
<https://twitter.com/Hypra_> Linkedin Jean-Philippe
<https://fr.linkedin.com/in/jean-philippe-mengual-800133135>

[toc] | [prev] | [next] | [standalone]


#186729

FromMichael Stone <mstone@debian.org>
Date2017-09-13 07:40 +0200
Message-ID<up8yZ-3aB-7@gated-at.bofh.it>
In reply to#186727
On Wed, Sep 13, 2017 at 12:37:16AM +0200, MENGUAL Jean-Philippe wrote:
>I added:
>ATTRS{idvendor}=="04a9", ATTRS{idProduct}="190e", ENV{libsane_matched}="yes"

Was it actually "idvendor" instead of "idVendor"?

Mike Stone

[toc] | [prev] | [next] | [standalone]


#186731

FromMENGUAL Jean-Philippe <mengualjeanphi@free.fr>
Date2017-09-13 08:40 +0200
Message-ID<up9v4-3Me-5@gated-at.bofh.it>
In reply to#186729

[Multipart message — attachments visible in raw view] — view raw

Hi,


Many thanks for your help guys, it works. The exact line:

ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="190e",
ENV{libsane_matched}="yes"


Should I /reportbug to libsane to add it in 60-libsane.rules? Because if
I add in /etc/udev/rules.d/60-libsane.rules as mentioned by the doc, it
no longer detects my EPSON (bcecause it bypasses
/lib/udev/rules.d/60-libsane.rules). Or is it useless and should I be
happy enough with setting my own conf file?/

/
/

/Actually I added to /lib/... but your opinion would be nice about
reporting bug or not./

/
/

/Regards/

//


Le 13/09/2017 à 07:36, Michael Stone a écrit :
> On Wed, Sep 13, 2017 at 12:37:16AM +0200, MENGUAL Jean-Philippe wrote:
>> I added:
>> ATTRS{idvendor}=="04a9", ATTRS{idProduct}="190e",
>> ENV{libsane_matched}="yes"
>
> Was it actually "idvendor" instead of "idVendor"?
>
> Mike Stone
>
>

-- 
signature_jp_2
Logo Hypra 	JEAN-PHILIPPE MENGUAL
DIRECTEUR TECHNIQUE ET QUALITÉ
102, rue des poissonniers, 75018, Paris
Tel : +331 84 73 06 61 <tel:+33184730661> Mob : +336 76 34 93 37
<tel:+33676349337>
jpmengual@hypra.fr <mailto:jpmengual@hypra.fr>
www.hypra.fr <http://www.hypra.fr/>
Facebook Hypra <https://www.facebook.com/hyprasoftware/> Twitter Hypra
<https://twitter.com/Hypra_> Linkedin Jean-Philippe
<https://fr.linkedin.com/in/jean-philippe-mengual-800133135>


[toc] | [prev] | [next] | [standalone]


#186736

FromBrian <ad44@cityscape.co.uk>
Date2017-09-13 11:40 +0200
Message-ID<upcjg-5yY-9@gated-at.bofh.it>
In reply to#186731
On Wed 13 Sep 2017 at 08:32:34 +0200, MENGUAL Jean-Philippe wrote:

> Many thanks for your help guys, it works. The exact line:
> 
> ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="190e",
> ENV{libsane_matched}="yes"
> 
> 
> Should I /reportbug to libsane to add it in 60-libsane.rules? Because if
> I add in /etc/udev/rules.d/60-libsane.rules as mentioned by the doc, it
> no longer detects my EPSON (bcecause it bypasses
> /lib/udev/rules.d/60-libsane.rules). Or is it useless and should I be
> happy enough with setting my own conf file?/
> 
> /Actually I added to /lib/... but your opinion would be nice about
> reporting bug or not./

The LiDE 120 is supported in the experimental package libsane1 (note
the name change from libsane). A bug report against libsane would be
closed when libsane1 comes into unstable but reporting a bug (with
your solution) could help other users who meet the same problem.

I'd use /etc/udev/rules.d/90-libsane.rules. This should not replace
/lib/udev/rules.d/60-libsane.rules.

-- 
Brian.

[toc] | [prev] | [next] | [standalone]


#186737

FromMichael Stone <mstone@debian.org>
Date2017-09-13 12:40 +0200
Message-ID<updfk-6ad-5@gated-at.bofh.it>
In reply to#186731
On Wed, Sep 13, 2017 at 08:32:34AM +0200, MENGUAL Jean-Philippe wrote:
>Should I reportbug to libsane to add it in 60-libsane.rules? Because if I add
>in /etc/udev/rules.d/60-libsane.rules as mentioned by the doc, it no longer
>detects my EPSON (bcecause it bypasses /lib/udev/rules.d/60-libsane.rules). Or
>is it useless and should I be happy enough with setting my own conf file?

Please report it.

>Actually I added to /lib/... but your opinion would be nice about reporting bug
>or not.

If you add it to /lib it will be overwritten if there are any security 
updates or other changes to the libsane package until the scanner is 
added to the package. What you can do is copy the entire 
/lib/udev/rules.d/60-libsane.rules file (plus your addition) to 
/etc/udev/rules.d/60-libsane.rules, which will be preserved on upgrades 
and should then have lines for both scanners. 

Mike Stone

[toc] | [prev] | [standalone]


Back to top | Article view | linux.debian.user


csiph-web