Re: Looking to add support for Avision AV50F plus scanner
Ove Laurum <[email protected]> Sun, 8 Sep 2024 14:04:51 +0100
| Newsgroups | gmane.comp.graphics.scanning.sane.devel |
|---|---|
| Message-ID | <CAPrFBS=OVAi1L8doVj4tTnQfTsB8uYt3CjcLMkBij7fVxr1FMg@mail.gmail.com> |
Thanks Ralph, I am not familiar with udev, but I added my scanner to the bottom of the file /lib/udev/hwdb.d/20-sane.hwdb on the VM I have the Scanner connected to as you suggested I did: $ *udevadm control --reload-rules* No luck I rebooted the VM but I still can not see the scanner with scanimage -L Is the scanner supposed to show up using scanimage -L? I also tried the GUI xsane, but it also can not see the scanner. Last 7 lines of 20-sane.hwdb: # Dell Dell 1235cn usb:v413Cp5310* libsane_matched=yes # OVE usb:v0638p2b6a* libsane_matched=yes output from lsusb & sane-find-scanner & scanimage -L root# lsusb Bus 001 Device 003: ID 0638:2b6a Avision, Inc. AV50F Plus root# sane-find-scanner # sane-find-scanner will now attempt to detect your scanner. If the # result is different from what you expected, first make sure your # scanner is powered up and properly connected to your computer. # No SCSI scanners found. If you expected something different, make sure that # you have loaded a kernel SCSI driver for your SCSI adapter. found possible USB scanner (vendor=0x0638 [AVISION], product=0x2b6a [AV50F Plus]) at libusb:001:003 # Your USB scanner was (probably) detected. It may or may not be supported by # SANE. Try scanimage -L and read the backend's manpage. # Not checking for parallel port scanners. # Most Scanners connected to the parallel port or other proprietary ports # can't be detected by this program. root# scanimage -L No scanners were identified. If you were expecting something different, check that the scanner is plugged in, turned on and detected by the sane-find-scanner tool (if appropriate). Please read the documentation which came with this software (README, FAQ, manpages). Regards Ove. On Wed, 4 Sept 2024 at 19:20, Ralph Little <[email protected]> wrote: > Hi, > > On Wed, Sep 4, 2024 at 10:11 AM Ove Laurum <[email protected]> wrote: > >> Thanks Ralph, >> >> I found the code on GitLab. Very useful. >> >> I also managed to add my scanner to the config file >> /etc/sane.d/avision.conf >> usb 0x0638 0x2b6a >> > > Great. > > >> >> I didn't get much of a trace out until I ran it as root, see abbreviated >> output below >> SANE_DEBUG_AVISION=100 scanimage -L >> (I don't think I can use the -d option unless the device is listed with >> "scanimage -L") >> >> When I do: >> SANE_DEBUG_AVISION=50 sane-find-scanner >> I get no trace, is that because the backend is not involved at this stage? >> > > Yeah, that won't work. sane-find-scanner is not using the SANE API at all. > It merely looks for devices that might be scanners. > You should use scanimage or another SANE frontend instead. This *should* > work once the avision backend knows about your scanner. > I *think* that you can use -d avision to pick the first avision device. > > >> >> In the trace that I did get, it looks like the backend is opening the >> correct device "libusb:001:003" and tries a first command which is >> "Inquiry". >> It builds the query and tries to write it but fails with error code 9. >> >> I am running the command as root (not as sudo) so it should not be a >> permissions issue unless the backend is run by a different user. >> If I run as an unprivileged user then I do not even get this far. In that >> case it tries to access the scanner but fails and is not even getting to >> the stage of Attaching to the scanner. >> Also worth noting is that my Canon LiDE220 works fine with sane, which is >> another indicator that it is unlikely a permissions issue. >> > > Permissions are generally handled by udev which has rules based on USB ids > to give permissions to non-root users. > Just adding the USB ids to the backend will not be sufficient. You *could* > add the USB ids to a udev file such as /lib/udev/hwdb.d/20-sane.hwdb > followed by running something like > > *udevadm control --reload-rules* > > ...as root. This should allow you to connect to the device as a regular > scanning user. > > >> >> So based on the trace and on the source code it looks like it is: >> >> - Attaching to the scanner. >> - SANE_Status = SANE_STATUS_GOOD in reply to sanei_usb_open >> - starts building an inquiry >> - tries to send the inquiry >> - fails to do sanei_usb_write_bulk >> - sanei_usb.c responds with error >> >> How can I see log entries from sanei_usb.c code? >> >> > I believe SANE_DEBUG_SANEI_USB=5 will give you some info about sanei USB > operations. Greater value gives you more info. > > Cheers, > Ralph >