<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p><br>
    </p>
    <div class="moz-cite-prefix">On 2020-09-09 11:41, Ralph Little
      wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAFNXweOpt1=RAcmRKtfNwqHosP8BC8+xMUabA-gjWV3ax0-omQ@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr">
        <div dir="ltr">
          <div>Hi,</div>
          <div>OK, no we're getting somewhere. <br>
          </div>
        </div>
        <br>
        <div class="gmail_quote">
          <div dir="ltr" class="gmail_attr">On Wed, Sep 9, 2020 at 10:29
            AM C. Cook <<a href="mailto:c.a.cook@quantum-sci.com"
              moz-do-not-send="true">c.a.cook@quantum-sci.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>... <br>
            </div>
          </blockquote>
          <blockquote class="gmail_quote" style="margin:0px 0px 0px
            0.8ex;border-left:1px solid
            rgb(204,204,204);padding-left:1ex">
            <div>I didn't see any traffic when not specifying the
              interface, so apparently in that case lo is ignored.  But
              now I see attempts.<br>
              <p>I changed net.conf to 127.0.0.1 instead of localhost
                and:<br>
              </p>
              <p># SANE_DEBUG_NET=128 scanimage -L<br>
                [sanei_debug] Setting debug level of net to 128.<br>
                [net] sane_init: authorize != null, version_code != null<br>
                [net] sane_init: SANE net backend version 1.0.14
                (AF-indep+IPv6) from sane-backends 1.0.27<br>
                [net] sane_init: Client has little endian byte order<br>
                [net] sane_init: searching for config file<br>
                [net] sane_init: connect timeout set to 30 seconds<br>
                [net] sane_init: trying to add scan-server<br>
                [net] add_device: adding backend scan-server<br>
                [net] add_device: error while getting address of host
                scan-server: Name or service not known<br>
                [net] sane_init: trying to add 127.0.0.1<br>
                [net] add_device: adding backend 127.0.0.1<br>
                [net] add_device: backend 127.0.0.1 added<br>
                [net] sane_init: done reading config<br>
                [net] sane_init: evaluating environment variable
                SANE_NET_HOSTS<br>
                [net] sane_init: evaluating environment variable
                SANE_NET_TIMEOUT<br>
                [net] sane_init: done<br>
                [net] sane_get_devices: local_only = 0<br>
                [net] connect_dev: trying to connect to 127.0.0.1<br>
                [net] connect_dev: [0] connection succeeded (IPv4)<br>
                [net] connect_dev: sanei_w_init<br>
                [net] connect_dev: net_init (user=carl, local
                version=1.0.3)<br>
                [net] connect_dev: freeing init reply (status=Success,
                remote version=1.0.3)<br>
                [net] connect_dev: done<br>
                [net] sane_get_devices: finished (0 devices)<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>
                [net] sane_exit: exiting<br>
                [net] sane_exit: closing dev 0x55f2484331e0, ctl=3<br>
                [net] sane_exit: finished.</p>
              <br>
            </div>
          </blockquote>
          <div><br>
          </div>
          <div>No need to worry about SANE_NET_HOSTS now, we are seeing
            activity.</div>
          <div>So it looks like the net backend is connecting to saned
            at the server end.</div>
          <div>I have not used reverse SSH before so I had to look that
            up. Interesting.</div>
          <div><br>
          </div>
          <div>Seems like we need to look to the server end now.</div>
          <div>So, let's review what we have there.</div>
          <div>saned is effectively just another SANE frontend. It
            connects to the backends in exactly the same way that
            scanimage and xane do.</div>
          <div>
            <div><br>
            </div>
            <div>On the server, could you try scanimage -L there and
              post what you get?</div>
            <div>Hopefully, you should see the scanner listed. <br>
            </div>
            <div>If so, then we need to discover why saned does not. I
              would be thinking about the user that saned is running as,
              therefore its permissions and the like.</div>
            <div>If not, then we have some problems with the driver
              setup and we can take it from there.<br>
            </div>
            <div><br>
            </div>
            <div>Cheers,</div>
            <div>Ralph<br>
            </div>
          </div>
        </div>
      </div>
    </blockquote>
    <p>On the server, it takes about 15 seconds to get a response,
      although after the first try it then comes up quickly:<br>
    </p>
    <p># SANE_DEBUG_NET=128 scanimage -L<br>
      device `epkowa:interpreter:001:011' is a Epson Perfection V370
      Photo flatbed scanner<br>
    </p>
    <p>I have everything in dll.conf commented out except epkowa.  I
      don't understand why the rest of the debug messages do not appear.<br>
    </p>
    <p>It's weird that xsane and scanimage do not go through saned but
      directly to the backends.  Seems then that the only point of saned
      is to network the scanner.</p>
    <p># lsof -i -n -P |grep 6566<br>
      systemd      1     root   17u  IPv4 12903022      0t0  TCP *:6566
      (LISTEN)</p>
    <p>I can only infer that in listening on * interfaces, it does
      include lo, although I had to specify tcpdump -i lo or else it was
      not checked.</p>
    <p>List of available devices:<br>
          epkowa:interpreter:001:011<br>
    </p>
    <p># SANE_DEBUG_NET=128 scanimage >/home/bill/dl/test.jpg<br>
    </p>
    <p>... does result in a good scan image in test.jpg, although since
      the scan server is headless I have to scp it to the client to view
      the file.</p>
    <p># lsusb<br>
      Bus 001 Device 011: ID 04b8:014a Seiko Epson Corp.</p>
    <p># ls -al /dev/bus/usb/001<br>
      total 0<br>
      ...</p>
    <p>crw-rw-r--+ 1 root root 189, 10 Sep 10 08:04 011</p>
    <p>I think you're right, this looks like a permissions problem, as
      I'm reaching through the SSH tunnel as absolutely unprivileged
      user 'sleeper'.  Only question is what to do about it?<br>
    </p>
    <p># cat /etc/systemd/system/sockets.target.wants/saned.socket<br>
      [Unit]<br>
      Description=saned incoming socket<br>
      <br>
      [Socket]<br>
      ListenStream=6566<br>
      Accept=yes<br>
      MaxConnections=1<br>
      <br>
      [Install]<br>
      WantedBy=sockets.target<br>
    </p>
    <p><br>
    </p>
    <p><br>
    </p>
    <p><br>
    </p>
    <p><br>
    </p>
    <p><br>
    </p>
  </body>
</html>