<div dir="ltr"><div>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</div><div>I did: $ <b>udevadm control --reload-rules</b></div><div>No luck</div><div>I rebooted the VM but I still can not see the scanner with scanimage -L</div><div><br></div><div>Is the scanner supposed to show up using scanimage -L?</div><div><br></div><div>I also tried the GUI xsane, but it also can not see the scanner.</div><div><br></div><div><br></div><div>Last 7 lines of 20-sane.hwdb:<br># Dell Dell 1235cn<br>usb:v413Cp5310*<br> libsane_matched=yes<br><br># OVE<br>usb:v0638p2b6a*<br> libsane_matched=yes<br></div><div><br></div><div>output from lsusb & sane-find-scanner & scanimage -L</div><div>root# lsusb<br>Bus 001 Device 003: ID 0638:2b6a Avision, Inc. AV50F Plus<br></div><div><br></div><div>root# sane-find-scanner<br><br> # sane-find-scanner will now attempt to detect your scanner. If the<br> # result is different from what you expected, first make sure your<br> # scanner is powered up and properly connected to your computer.<br><br> # No SCSI scanners found. If you expected something different, make sure that<br> # you have loaded a kernel SCSI driver for your SCSI adapter.<br><br>found possible USB scanner (vendor=0x0638 [AVISION], product=0x2b6a [AV50F Plus]) at libusb:001:003<br> # Your USB scanner was (probably) detected. It may or may not be supported by<br> # SANE. Try scanimage -L and read the backend's manpage.<br><br> # Not checking for parallel port scanners.<br><br> # Most Scanners connected to the parallel port or other proprietary ports<br> # can't be detected by this program.<br>root# scanimage -L<br><br>No scanners were identified. If you were expecting something different,<br>check that the scanner is plugged in, turned on and detected by the<br>sane-find-scanner tool (if appropriate). Please read the documentation<br>which came with this software (README, FAQ, manpages).<br></div><div><br></div><div><br></div><div>Regards Ove.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, 4 Sept 2024 at 19:20, Ralph Little <<a href="mailto:skelband@gmail.com" target="_blank">skelband@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><div>Hi,</div><div><br></div></div><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Sep 4, 2024 at 10:11 AM Ove Laurum <<a href="mailto:laurum.tech@gmail.com" target="_blank">laurum.tech@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Thanks Ralph,<div><br></div><div>I found the code on GitLab. Very useful.<br><div><br></div><div>I also managed to add my scanner to the config file /etc/sane.d/avision.conf</div><div>usb 0x0638 0x2b6a<br></div></div></div></blockquote><div><br></div><div>Great.</div><div> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div></div><div><br></div><div>I didn't get much of a trace out until I ran it as root, see abbreviated output below</div><div>SANE_DEBUG_AVISION=100 scanimage -L<br></div><div>(I don't think I can use the -d option unless the device is listed with "scanimage -L")</div><div><br></div><div>When I do:</div><div>SANE_DEBUG_AVISION=50 sane-find-scanner</div><div>I get no trace, is that because the backend is not involved at this stage?</div></div></div></blockquote><div><br></div><div>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.</div><div>You should use scanimage or another SANE frontend instead. This *should* work once the avision backend knows about your scanner.</div><div>I *think* that you can use -d avision to pick the first avision device.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div><br></div><div>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".</div><div>It builds the query and tries to write it but fails with error code 9.</div><div><br></div><div>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.</div><div>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.</div><div>Also worth noting is that my Canon LiDE220 works fine with sane, which is another indicator that it is unlikely a permissions issue.<br></div></div></div></blockquote><div><br></div><div>Permissions are generally handled by udev which has rules based on USB ids to give permissions to non-root users.</div><div>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 <br></div><div><span lang="en"><span><b><br></b></span></span></div><div><span lang="en"><span><b>udevadm control --reload-rules</b></span></span></div><div><span lang="en"><span><b><br></b></span></span></div><div><span lang="en"><span>...as root. This should allow you to connect to the device<b> </b>as a regular scanning user.<b><br></b></span></span></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div></div><div><br></div><div>So based on the trace and on the source code it looks like it is: </div><div><ul><li>Attaching to the scanner.</li><li><code>SANE_Status</code> = <code>SANE_STATUS_GOOD</code> in reply to <code>sanei_usb_open</code></li><li>starts building an inquiry</li><li>tries to send the inquiry</li><li>fails to do <code>sanei_usb_write_bulk</code></li><li>sanei_usb.c responds with error</li></ul></div><div>How can I see log entries from sanei_usb.c code?</div><div><br></div></div></div></blockquote><div><br></div><div>I believe SANE_DEBUG_SANEI_USB=5 will give you some info about sanei USB operations. Greater value gives you more info.</div><div><br></div></div><div class="gmail_quote">Cheers,</div><div class="gmail_quote">Ralph<br></div></div>
</blockquote></div></div>