[sane-devel] How o make genesys backend make use of symlink via udev-rule?

Jozef Riha jose1711 at gmail.com
Fri Aug 6 22:06:57 BST 2021


Hello Heinz,

thank you for your detailed answer. If I understand correctly the whole
issue is caused by the fact that  Windows driver/software is hardwiring the
current bus/device ID during installation.

-d genesys:libusb:/dev/myLide60

This trick did not work for me either - perhaps libusb always needs bus and
device ID and does not take any names. Tried symbolic links, tried making
character device but with the same results. I am beginning to think that
this would need a code change (not sure about the complexity). Perhaps it
would be simpler to try and port xsane to windows again :-/

Cheers, jose

On Fri, Aug 6, 2021 at 6:59 PM Kelly Price <strredwolf at gmail.com> wrote:

> I think the Sane-devel list would know more than what I do.
>
> On Fri, Aug 6, 2021 at 12:50 PM Heinz Rohde <5420108 at mailbox.org> wrote:
> >
> > Dear Kelly,
> >
> >
> > Hello,
> >
> > I am very sorry for beeing so short with my detailed information.
> >
> >
> > Here we go:
> >
> > - The Scanner is a Canon CanoScan LiDE 60
> > - The Scanner is
> > connected to an ols ThinkPad r60e via USB (All USB ports are USB 2.0)
> > -
> > The Scanner is handeled by genesys backend.
> > - The OS is Debian Buster 64
> > bit, all updates installed.
> > - The IP number of the Thinkpad is
> > 192.168.168.245
> >
> > - The scanner works locally
> > hr at r60e:~$ sudo scanimage -L
> > d
> > evice `genesys:libusb:002:005' is a Canon LiDE 60 flatbed scanner
> >
> >
> > - The
> > scanner works over the network, my 2nd laptop is a Dell E6440 running
> > Debian Buster
> > hr at e6440:~$ scanimage -L
> > device
> > `net:192.168.168.245:genesys:libusb:002:005' is a Canon LiDE 60 flatbed
> > scanner
> >
> >
> > - This is my udev-rule in /usr/lib/udev/rules.d
> >
> > less 90-
> > scanner.rules
> >
> > # change device file permission to group scanner for sane
> > access
> > ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="221c",
> > SUBSYSTEMS=="usb", ACTION=="add", MODE="0664", GROUP="scanner",
> > SYMLINK+="MyLide60"
> >
> > but this does not work - it creates no symlink in
> > /dev
> >
> >
> >
> > - This does work and is my udev-rule in /etc/udev/rules.d
> >
> > less 83-
> > scanner.rules
> >
> > SUBSYSTEM=="usb", ATTR{product}=="CanoScan",
> > ATTR{idProduct}=="221c", ATTR{idVendor}=="04a9", SYMLINK+="myLide60"
> > GROUP+="scanner"
> >
> > It creates a symlink in /dev/
> > lrwxrwxrwx  1 root root
> > 15 Aug  6 18:18 myLide60 -> bus/usb/002/005
> >
> >
> > It's hardly possilbe to
> > document here all the links I visited during the last 5 days, but tere
> > are Links that suggested to use
> > hr at r60e:~$ sudo scanimage -d
> > /dev/myLide60
> >
> > which obv iously does not work, because a UNIX Device is
> > not to be used within the backend systax.
> >
> > A invocation like
> > hr at r60e:~$
> > sudo scanimage -d genesys:libusb:/dev/myLide60 results also in an
> > error, though it was recommended in a forum blogpost by someone more or
> > less savvy.
> >
> >
> > The reason for this is, that I have some windows 10 clients
> > in my network.
> > They can be used with sane-Scanning-Solution via NAPS2
> > Scanning Software and the windows WIA-Sane driver
> > https://github.com/mback2k/wiasane/wiki/Downloads
> >
> > But one need to
> > configure the scanning device by hand. Unfortunatly the scanner will be
> > assigned deviating USB Bus and Device numbers if the scanner is
> > unplugged and replugged or if the scanserver is rebootet. You cannot
> > rely on the persistence of USB bus/device number assignment.
> >
> > That leads
> > to the situation, that the users of the windows clients won't be able
> > to scan at a certain day or hour noone can predict.
> > To assign the then
> > valid usb bus / device numbers, you'll have to reinstall the WIA-Sane
> > driver each time it is necessary.
> >
> > Therefore I'd like to have the option
> > to configure the windows WIA Sane Driver to the symbolic link.
> >
> > But until
> > today this endeavour was not successful.
> >
> >
> > Important to know:
> > SCSI-
> > Scanners seem to behave other than USB-Scanners.
> > SCSI-Scanners for
> > example may have a /dev/sg1, which is a UNIX-Device.
> > For SCSI-Scanners
> > the symlink may work. I unfortunatly cannot try this out, but several
> > postings do claim that.
> >
> >
> > I am now looking for a method to get a
> > persistent USB device enumeration for my scanner.
> >
> > A already tried the
> > ALIASES option via dll.aliases.
> >
> > I wrote this script, which updates the
> > dll.aliases in /dev/sane.d
> >
> > -----
> > #!/bin/bash
> >
> > ALIASFILE=/etc/sane.d/dll.ali
> > ases
> >
> > lsusb | grep LiDE | awk '{ print "alias MyLiDE
> > genesys:libusb:"$2":"$4}' | sed 's/.$//' > $ALIASFILE
> > -----
> >
> > The scanner
> > then is recognised by its alias, but the windows clients cannot make
> > use of it.
> > All that the windows WIA Sane Driver sees by autotetection is
> > the genesys:libusb:002:005 which I can select as only Option during
> > WIA-Sane Setup.
> >
> >
> >
> > This is the long version, perhaps you have ideas how I
> > should proceed.
> >
> > THX,
> > Heinz
> >
> > Am Freitag, den 06.08.2021, 08:50 -0400 schrieb Kelly Price:
> > > First, run:  sudo sane-find-scanner
> > >
> > > That'll check if the scanner is identified or not under the current
> > > SANE version you have.
> > >
> > > If that doesn't work, check that your scanner is supported and you're
> > > on the latest SANE version (you may need to use the PPA in Ubuntu).
> > >
> > > If that does work, then the permissions are not set to allow the
> > > regular user to use the scanner.
> > >
> > > Usually you don't need to symlink to the scanner if you're using
> > > xsane, so I'd remove your udev rule and see if that helps.  Xsane
> > > will
> > > scan for your scanner, and if it's the only one, uses it (it'll
> > > prompt
> > > you otherwise).
> > >
> > > On Fri, Aug 6, 2021 at 8:37 AM Heinz Rohde via sane-devel
> > > <sane-devel at alioth-lists.debian.net> wrote:
> > > > Hello,
> > > >
> > > > I created a symlink via udev rule calles MyScanner and points to
> > > > /dev/bus/001/002 (for example)
> > > >
> > > > I cannot get genesys to use this link, or in other words, scanimage
> > > > -d
> > > > /dev/MyScanner resukts in an error.
> > > >
> > > > Any Ideas?
> > > >
> > > > Thank you,
> > > > Heinz
> > > >
> > > >
> > >
> > >
> >
> >
>
>
> --
> Kelly "STrRedWolf" Price
> http://redwolf.ws
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/sane-devel/attachments/20210806/7103b026/attachment.htm>


More information about the sane-devel mailing list