[sane-devel] Help with using Avahi for saned

John Scott jscott at posteo.net
Sun Nov 27 15:16:06 GMT 2022


Hi,

I'm having a hard time using saned with Avahi and would appreciate some
help. I'm running saned on a machine we'll refer to as T450, and to
publish it over Avahi/Zeroconf/Bonjour/what-cha-ma-call-it I'm running
the following command (of course, I'll make this permanent later in a
configuration file):

$ avahi-publish-service "saned" _sane-port._tcp 6566

From inspecting the source code (since this seems to be poorly
documented at the moment), it seems like saned has support for
publishing its presence on its own, including setting the TXT
information appropriately. If anyone knows how to do this, please inform
me, but I don't think it's the cause of my issues below. (Again, by
inspecting the source code, I determined that the net backend doesn't
use the TXT information for anything right now.)

On my other machine, M93z (the client), it is able to connect to saned
and successfully scan when the hostname is specified. As you can see
from this command output, it seems to be picking up on Avahi, but for
some odd reason finding no scanners when we rely on Avahi alone:

john at M93z:~$ SANE_DEBUG_NET=128 scanimage -vvL
[10:04:15.929012] [sanei_debug] Setting debug level of net to 128.
[10:04:15.929101] [net] sane_init: authorize != null, version_code != null
[10:04:15.929123] [net] sane_init: SANE net backend version 1.0.14 (AF-indep+IPv6) from sane-backends 1.1.1-debian
[10:04:15.929194] [net] sane_init: Client has little endian byte order
[10:04:15.929263] [net] sane_init: searching for config file
[10:04:15.929346] [net] sane_init: done reading config
[10:04:15.929397] [net] sane_init: evaluating environment variable SANE_NET_HOSTS
[10:04:15.929444] [net] sane_init: evaluating environment variable SANE_NET_TIMEOUT
[10:04:15.936456] [net] sane_init: done
[10:04:15.936644] [net] sane_get_devices: local_only = 0
[10:04:15.936691] [net] sane_get_devices: finished (0 devices)
[10:04:15.947171] [net] net_avahi_browse_callback: NEW: service 'saned' of type '_sane-port._tcp' in domain 'local'
[10:04:15.947532] [net] net_avahi_browse_callback: NEW: service 'saned' of type '_sane-port._tcp' in domain 'local'
[10:04:15.947846] [net] net_avahi_browse_callback: CACHE_EXHAUSTED
[10:04:15.947864] [net] net_avahi_resolve_callback: service 'saned' of type '_sane-port._tcp' in domain 'local':
[10:04:15.947879] [net] 	T450.local:6566 (fdf3:2fad:e98f::cfb)
	TXT=
	cookie is 0
	is_local: 0
	our_own: 0
	wide_area: 0
	multicast: 1
	cached: 1
[10:04:15.947892] [net] add_device: adding backend T450.local
[10:04:15.949433] [net] add_device: backend T450.local added
[10:04:15.949820] [net] net_avahi_resolve_callback: service 'saned' of type '_sane-port._tcp' in domain 'local':
[10:04:15.949835] [net] 	T450.local:6566 (192.168.10.150)
	TXT=
	cookie is 0
	is_local: 0
	our_own: 0
	wide_area: 0
	multicast: 1
	cached: 1
[10:04:15.949849] [net] add_device: adding backend T450.local
[10:04:15.949856] [net] add_device: already in list
[10:04:16.949156] [net] net_avahi_browse_callback: ALL_FOR_NOW

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).
Calling sane_exit
[10:04:16.960050] [net] sane_exit: exiting
[10:04:16.960112] [net] net_avahi_cleanup: stopping thread
[10:04:16.961437] [net] net_avahi_cleanup: done
[10:04:16.961465] [net] sane_exit: closing dev 0x7f1978002050, ctl=-1
[10:04:16.961494] [net] sane_exit: finished.
scanimage: finished

If you look at the third-to-last line, it looks like it's closing a
device even though it claimed to find none! Anywho, SANE does find the
scanners when I manually specify the server:

john at M93z:~$ SANE_NET_HOSTS=T450.local scanimage -L
device `net:T450.local:fujitsu:ScanSnap S1500:157926' is a FUJITSU ScanSnap S1500 scanner
device `net:T450.local:escl:ScanSnap S1500:157926' is a FUJITSU ScanSnap S1500 scanner
device `net:T450.local:canon_lide70:libusb:002:042' is a CANON CanoScan LiDE 70 flatbed scanner

I'm running Debian Bookworm (testing) which I'm pretty sure has the
latest SANE. I'm running saned in care of systemd (as opposed to inetd).
I've added sane to the scanner group and am unsure with how to proceed.

Any advice would be appreciated.

Thanks for making SANE great!

Sincerely,
John

P.S. Some of you might ask why I'm bothering with Avahi when I clearly
know the server hostname and could just hard-code it. That's because I
want the scanners to be accessible to other devices as they come in to
the network, such as if I have guests come over, or so I can scan easily
from my smartphone.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 252 bytes
Desc: This is a digitally signed message part
URL: <http://alioth-lists.debian.net/pipermail/sane-devel/attachments/20221127/3c693d2a/attachment.sig>


More information about the sane-devel mailing list