[sane-devel] Net Client Not Contacting Server

C. Cook c.a.cook at quantum-sci.com
Thu Sep 10 16:14:10 BST 2020

On 2020-09-09 11:41, Ralph Little wrote:
> Hi,
> OK, no we're getting somewhere.
> On Wed, Sep 9, 2020 at 10:29 AM C. Cook <c.a.cook at quantum-sci.com
> <mailto:c.a.cook at quantum-sci.com>> wrote:
>     ...
>     I didn't see any traffic when not specifying the interface, so
>     apparently in that case lo is ignored.  But now I see attempts.
>     I changed net.conf to instead of localhost and:
>     # SANE_DEBUG_NET=128 scanimage -L
>     [sanei_debug] Setting debug level of net to 128.
>     [net] sane_init: authorize != null, version_code != null
>     [net] sane_init: SANE net backend version 1.0.14 (AF-indep+IPv6)
>     from sane-backends 1.0.27
>     [net] sane_init: Client has little endian byte order
>     [net] sane_init: searching for config file
>     [net] sane_init: connect timeout set to 30 seconds
>     [net] sane_init: trying to add scan-server
>     [net] add_device: adding backend scan-server
>     [net] add_device: error while getting address of host scan-server:
>     Name or service not known
>     [net] sane_init: trying to add
>     [net] add_device: adding backend
>     [net] add_device: backend added
>     [net] sane_init: done reading config
>     [net] sane_init: evaluating environment variable SANE_NET_HOSTS
>     [net] sane_init: evaluating environment variable SANE_NET_TIMEOUT
>     [net] sane_init: done
>     [net] sane_get_devices: local_only = 0
>     [net] connect_dev: trying to connect to
>     [net] connect_dev: [0] connection succeeded (IPv4)
>     [net] connect_dev: sanei_w_init
>     [net] connect_dev: net_init (user=carl, local version=1.0.3)
>     [net] connect_dev: freeing init reply (status=Success, remote
>     version=1.0.3)
>     [net] connect_dev: done
>     [net] sane_get_devices: finished (0 devices)
>     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).
>     [net] sane_exit: exiting
>     [net] sane_exit: closing dev 0x55f2484331e0, ctl=3
>     [net] sane_exit: finished.
> No need to worry about SANE_NET_HOSTS now, we are seeing activity.
> So it looks like the net backend is connecting to saned at the server end.
> I have not used reverse SSH before so I had to look that up. Interesting.
> Seems like we need to look to the server end now.
> So, let's review what we have there.
> saned is effectively just another SANE frontend. It connects to the
> backends in exactly the same way that scanimage and xane do.
> On the server, could you try scanimage -L there and post what you get?
> Hopefully, you should see the scanner listed.
> 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.
> If not, then we have some problems with the driver setup and we can
> take it from there.
> Cheers,
> Ralph

On the server, it takes about 15 seconds to get a response, although
after the first try it then comes up quickly:

# SANE_DEBUG_NET=128 scanimage -L
device `epkowa:interpreter:001:011' is a Epson Perfection V370 Photo
flatbed scanner

I have everything in dll.conf commented out except epkowa.  I don't
understand why the rest of the debug messages do not appear.

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.

# lsof -i -n -P |grep 6566
systemd      1     root   17u  IPv4 12903022      0t0  TCP *:6566 (LISTEN)

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.

List of available devices:

# SANE_DEBUG_NET=128 scanimage >/home/bill/dl/test.jpg

... 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.

# lsusb
Bus 001 Device 011: ID 04b8:014a Seiko Epson Corp.

# ls -al /dev/bus/usb/001
total 0

crw-rw-r--+ 1 root root 189, 10 Sep 10 08:04 011

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?

# cat /etc/systemd/system/sockets.target.wants/saned.socket
Description=saned incoming socket



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/sane-devel/attachments/20200910/054c1d96/attachment.html>

More information about the sane-devel mailing list