[sane-devel] scanimage -L does not list net device, yet scanning is possible

Jan Beinersorf sane-devel at janbeinersdorf.de
Thu Nov 24 15:11:46 UTC 2016


Hi,

I think I misconfigured something, but I can't figure out what.

My "server" is running saned. There is an old LaserJet 2840 connected
via network. "Local" scanning (over the hpaio backend (included in
hplip) using the ethernet connection) works fine. Even scanning using
the net backend works perfectly, as long as I specify it on the command
line.

The only thing that is not working is detecting the scanner using
scanimage -L. On the other Linux boxes this is not a problem, as I can
just tell scanimage or xsane which device they should use.

But some of the Windows software I tested so far needs to detect the
scanner by itself. (Scanning from Windows is the reason I'm trying to
get network scanning up and running in the first place as there are no
drivers available for the scanner part of this printer for any Windowses
beyond XP. Linux support on the other hand is still pretty good. And,
yes, it is a strange setup, setting up a networked scanner to be used
with saned over the network, effectively sending twice the data over the
net, but that's what I'm trying to do...) ;-)

I'd settle for using xsane on the windows installations, too. It
actually works with an very old xsane binary I found on archive.org for
testing purposes; I'd have to build something more recent with cygwin or
something. ...but I guess the other users would hang me if they can't
scan directly from their photoshop or paint or whatever... ;-)

Anyways: Here's my configuration (on the server, 192.168.1.1):

/etc/sane.d # cat dll.conf
hpaio
net

/etc/sane.d # cat saned.conf
# data_portrange = 10000 - 10100
192.168.1.1/24

/etc/sane.d # cat net.conf
192.168.1.1
localhost

(On the clients I removed the localhost entry in net.conf.)

/etc/sane.d # SANE_DEBUG_HPAIO=128 SANE_DEBUG_NET=128 saned -d128
[saned] main: starting debug mode (level 128)
[saned] read_config: searching for config file
[saned] read_config: done reading config
[saned] saned (IPv4 only) from sane-backends 1.0.25 starting up
[saned] do_bindings: trying to get port for service "sane-port"
(getservbyname)
[saned] do_bindings: port is 6566
[saned] do_bindings: socket ()
[saned] do_bindings: setsockopt ()
[saned] do_bindings: bind ()
[saned] do_bindings: listen ()
[saned] run_standalone: waiting for control connection
[saned] handle_connection: processing client connection
[saned] check_host: access by remote host: 192.168.1.3
[saned] check_host: remote host is not IN_LOOPBACK
[saned] check_host: local hostname: sauserver
[saned] check_host: local hostname (from DNS): sauserver.sauhaufen
[saned] check_host: local host address (from DNS): 192.168.1.1
[saned] check_host: remote host doesn't have same addr as local
[saned] check_host: opening config file: /etc/hosts.equiv
[saned] check_host: opening config file: saned.conf
[saned] check_host: config file line: `# data_portrange = 10000 - 10100'
[saned] check_host: config file line: `192.168.1.1/24'
[saned] check_host: subnet with base IP = 192.168.1.1, CIDR netmask = 24
[saned] check_host: access granted from IP address 192.168.1.3 (in
subnet 192.168.1.1/24)
[saned] init: access granted
[saned] init: access granted to jan at 192.168.1.3
[saned] process_request: waiting for request
[saned] process_request: got request 1
[sanei_debug] Setting debug level of hpaio to 128.
[hpaio] sane_hpaio_init(): scan/sane/hpaio.c 323
[hpaio] sane_hpaio_get_devices(local=1): scan/sane/hpaio.c 342
[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) from
sane-backends 1.0.25
[net] sane_init: Client has little endian byte order
[net] sane_init: searching for config file
[net] sane_init: trying to add 192.168.1.1
[net] add_device: adding backend 192.168.1.1
[net] add_device: backend 192.168.1.1 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 = 1
[saned] process_request: waiting for request
[saned] process_request: got request 10
[saned] bailing out, waiting for children...
[saned] bail_out: all children exited

~ # 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.24
[net] sane_init: Client has little endian byte order
[net] sane_init: searching for config file
[net] sane_init: trying to add 192.168.1.1
[net] add_device: adding backend 192.168.1.1
[net] add_device: backend 192.168.1.1 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 192.168.1.1
[net] connect_dev: [0] connection succeeded (IPv4)
[net] connect_dev: sanei_w_init
[net] connect_dev: net_init (user=jan, 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)
device `hpaio:/net/HP_Color_LaserJet_2840?ip=192.168.4.252' is a
Hewlett-Packard HP_Color_LaserJet_2840 all-in-one
device `brother3:net1;dev0' is a Brother MFC-5490CN saudrucker
[net] sane_exit: exiting
[net] sane_exit: closing dev 0x15ee880, ctl=99
[net] sane_exit: finished.

As you can see, scanimage -L only detects local scanners (hpaio,
brother3), but not the network scanner. The strange thing is:

~ # scanimage -d
"net:192.168.1.1:hpaio:/net/HP_Color_LaserJet_2840?ip=192.168.4.252" >
test.pnm

...gives me a perfect scan and...

~ #  xsane
"net:192.168.1.1:hpaio:/net/HP_Color_LaserJet_2840?ip=192.168.4.252"

...works like a charm, too.

System
Server: Gentoo Linux on a Raspberry Pi 2
Client: Gentoo Linux on amd64

/etc/sane.d # emerge -pv sane-backends hplip
[..]
These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R    ] media-gfx/sane-backends-1.0.25-r1::gentoo  USE="ipv6
nls snmp -doc (-gphoto2) -systemd -threads -usb -v4l -xinetd -zeroconf"
SANE_BACKENDS="hp net -abaton -agfafocus -apple -artec -artec_eplus48u
-as6e -avision -bh -canon -canon630u -canon_dr (-canon_pp) -cardscan
-coolscan -coolscan2 -coolscan3 -dc210 -dc240 -dc25 -dell1600n_net -dmc
-epjitsu -epson -epson2 -fujitsu -genesys -gt68xx -hp3500 -hp3900
-hp4200 -hp5400 -hp5590 -hpljm1005 (-hpsj5s) -hs2p -ibm -kodak -kodakaio
-kvs1025 -kvs20xx -kvs40xx -leo -lexmark -ma1509 -magicolor -matsushita
-microtek -microtek2 -mustek (-mustek_pp) -mustek_usb -mustek_usb2 -nec
-niash -p5 -pie -pixma -plustek -plustek_pp -pnm (-qcam) -ricoh -rts8891
-s9036 -sceptre -sharp -sm3600 -sm3840 -snapscan -sp15c -st400 -stv680
-tamarack -teco1 -teco2 -teco3 {-test} -u12 -umax -umax1220u -umax_pp
-xerox_mfp" 0 KiB
[ebuild   R    ] net-print/hplip-3.16.3::gentoo  USE="hpcups hpijs
scanner snmp -X -doc -fax (-kde) -libnotify -libusb0 -minimal -parport
-policykit -qt4 -static-ppds" PYTHON_TARGETS="python2_7" 0 KiB
[..]

Does anyone have an idea what's going on here?

Yours

jb



More information about the sane-devel mailing list