<div dir="ltr"><div>Something of note is that most Avision scanners are fundamentally SCSI-over-USB, which means you can gain some understanding of the API structure by looking at the SCSI scanner spec. You should be able to find that with a google search.</div><div><br></div><div>allan<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Sep 4, 2024 at 10:13 AM Ralph Little <<a href="mailto:skelband@gmail.com">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">Hi,<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Sep 4, 2024 at 6:28 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">Hello and thanks for your responses.<div><br></div><div>The effort does not dissuade me, it will have to take the time it takes, in the meantime I will just have to retain a windows VM for using the scanner.<br>...<br><div>Ralph, I was trying to find where the source code is, GIT hub? or somewhere else? so that I can take a look at the code for some examples of backends. I assume it's written in C.<br></div><div>I found <a href="https://www.commandlinux.com/man-page/man-page/man-page/man5/sane-avision.5.html" target="_blank">https://www.commandlinux.com/man-page/man-page/man-page/man5/sane-avision.5.html</a> </div><div>So I will start there trying to figure out how to read logs for the scanner as per your suggestion.</div><div><br></div></div></div></blockquote><div><br></div><div>The SANE project is hosted at Gitlab, and you can find the source and currently reported issues here: <a href="https://gitlab.com/sane-project/backends" target="_blank">https://gitlab.com/sane-project/backends</a></div><div></div><div>The main website is here: <a href="http://www.sane-project.org/" target="_blank">http://www.sane-project.org/</a></div><div><br></div><div>The SANE code is divided up into two main repositories: backends and frontends. You will find the backends contain all the code required to talk to scanners.</div><div>Best way to start is to clone the backends repository and build it. On Linux, building is fairly straightforward and there are instructions in the INSTALL file.</div><div><br></div><div>If you wish to generate a log file from a backend, each backenc man page does indeed contain instructions, but broadly each backend has its own environment variable that can be used to get debug messages at various numerical levels. One example might be:</div><div><br></div><div>SANE_DEBUG_AVISION=50 scanimage -d {your device} {other parameters etc}</div><div><br></div><div>Consult the man page (man sane-avision) for details as to what level of diag corresponds to which number.</div><div><br></div><div>Personally, I would start with the avision backend. Many Avision devices use the protocol that is supported by that backend but it is not guaranteed in your case.</div><div>The backends are designed to support specific protocols and often these protocols are shared amongst different manufacturers. Some scanners use scanner-on-a-chip hardware (for example from Genesys) so a backend may support a wide range of devices from different manufacturers. In other cases, they are more manufacturer specific (like Canon with the pixma backend for example).</div><div></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>The other thing I will have to do is to trace a successful scan operation on Windows.</div><div><div>My goto tracer would be wireshark, I know I can trace USB ports in Linux so I assume that is possible on Windows as well to get a trace of successful scanning.</div><div>But is there a better tool to trace the USB traffic on Windows for the purpose of establishing some form of API?</div></div><div><br></div></div></div></blockquote><div><br></div><div>Yes, we would usually do a scan on Windows and capture it using Wireshark. I don't know of any particular analysis tools that could help you here. The ones I have looked at I tend to print out and mark out with pen. Pretty old school. If this device is supported by the avision backend, then I would suspect that initial communications are pretty generic and get a little more specific later on. On communications that I have seen, the early USB exchanges establish the devices type and capabilities. The result of this early exchange is output in the diag stream so would be a good place to start.</div><div><br></div><div>I don't know the backend very well, but I probably would start with the sane-avision man page and look into how to add the USB ids of your device to the backend's code or config file and just give it a try, capturing some detailed diag output. I would then study a trace gotten from a Windows scan to see how to go from there. If you are stuck at this point, I can spend a little time reminding myself how that backend works and help you out.<br></div><div><br></div><div>There is a bit of a steep learning curve and each backend has its own way of doing things. Different scanners can have a completely different way of working, some are fairly high level like avision and pixma, while others are very low-level like genesys or rts8891.</div><div><br></div><div>Cheers,</div><div>Ralph<br></div></div></div>
</blockquote></div><br clear="all"><br><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature">"well, I stand up next to a mountain- and I chop it down with the edge of my hand"</div>