for several days I am struggling with access to a Brother DCP-J315W via SANE, that works well with Win10, but I cannot get it running under Ubuntu 24.04.
After reading tons of forum articles and checking commands like
friedrich@friedrich-xyz-Laptop-15-cs3xxx:~$ brsaneconfig3 -q
0 "DCP-195C"
...
26 "DCP-J315W"
...
97 "MFC-8890DW"
Devices on network
0 DCPJ315W "DCP-J315W" I:192.168.178.23
friedrich@friedrich-xyz-Laptop-15-cs3xxx:~$ ping 192.168.178.23
PING 192.168.178.23 (192.168.178.23) 56(84) bytes of data.
64 bytes from 192.168.178.23: icmp_seq=1 ttl=255 time=4.07 ms
64 bytes from 192.168.178.23: icmp_seq=2 ttl=255 time=2.56 ms
64 bytes from 192.168.178.23: icmp_seq=3 ttl=255 time=2.72 ms
64 bytes from 192.168.178.23: icmp_seq=4 ttl=255 time=3.00 ms
64 bytes from 192.168.178.23: icmp_seq=5 ttl=255 time=2.80 ms
64 bytes from 192.168.178.23: icmp_seq=6 ttl=255 time=3.27 ms
^C
--- 192.168.178.23 ping statistics ---
6 packets transmitted, 6 received, 0% packet loss, time 5008ms
rtt min/avg/max/mdev = 2.557/3.069/4.065/0.498 ms
friedrich@friedrich-xyz-Laptop-15-cs3xxx:~$ scanimage -L
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).
friedrich@friedrich-xyz-Laptop-15-cs3xxx:~$
and configuration files I found out that the saned.service fails during start. No further actions (restart, stop) seem to have any effect on it.
friedrich@friedrich-xyz-Laptop-15-cs3xxx:~$ sudo systemctl status saned.service
× saned.service - LSB: SANE network scanner server
Loaded: loaded (/etc/init.d/saned; generated)
Active: failed (Result: exit-code) since Fri 2025-01-31 06:05:51 CET; 44min ago
Docs: man:systemd-sysv-generator(8)
Process: 19072 ExecStart=/etc/init.d/saned start (code=exited, status=1/FAILURE)
CPU: 26ms
Jan 31 06:05:51 friedrich-xyz-Laptop-15-cs3xxx saned[19072]: * Starting SANE network scanner server saned
Jan 31 06:05:51 friedrich-xyz-Laptop-15-cs3xxx saned[19079]: saned (AF-indep+IPv6) from sane-backends 1.2.1-debian starting up
Jan 31 06:05:51 friedrich-xyz-Laptop-15-cs3xxx saned[19079]: do_bindings: [1] bind failed: Address already in use
Jan 31 06:05:51 friedrich-xyz-Laptop-15-cs3xxx saned[19079]: do_bindings: [0] bind failed: Address already in use
Jan 31 06:05:51 friedrich-xyz-Laptop-15-cs3xxx saned[19079]: do_bindings: couldn't bind an address. Exiting.
Jan 31 06:05:51 friedrich-xyz-Laptop-15-cs3xxx saned[19079]: FATAL ERROR; bailing out, waiting for children...
Jan 31 06:05:51 friedrich-xyz-Laptop-15-cs3xxx saned[19079]: bail_out: all children exited
Jan 31 06:05:51 friedrich-xyz-Laptop-15-cs3xxx systemd[1]: saned.service: Control process exited, code=exited, status=1/FAILURE
Jan 31 06:05:51 friedrich-xyz-Laptop-15-cs3xxx systemd[1]: saned.service: Failed with result 'exit-code'.
Jan 31 06:05:51 friedrich-xyz-Laptop-15-cs3xxx systemd[1]: Failed to start saned.service - LSB: SANE network scanner server.
friedrich@friedrich-xyz-Laptop-15-cs3xxx:~$ sudo systemctl status saned.socket
● saned.socket - saned incoming socket
Loaded: loaded (/etc/systemd/system/saned.socket; enabled; preset: enabled)
Active: active (listening) since Fri 2025-01-31 04:38:59 CET; 2h 11min ago
Listen: [::]:6566 (Stream)
Accepted: 6; Connected: 0;
Tasks: 0 (limit: 18842)
Memory: 8.0K (peak: 268.0K)
CPU: 3ms
CGroup: /system.slice/saned.socket
Jan 31 04:38:59 friedrich-xyz-Laptop-15-cs3xxx systemd[1]: Listening on saned.socket - saned incoming socket.
friedrich@friedrich-xyz-Laptop-15-cs3xxx:~$ sudo systemctl restart saned.service
Job for saned.service failed because the control process exited with error code.
See "systemctl status saned.service" and "journalctl -xeu saned.service" for details.
friedrich@friedrich-xyz-Laptop-15-cs3xxx:~$ sudo systemctl stop saned.service
friedrich@friedrich-xyz-Laptop-15-cs3xxx:~$ sudo systemctl restart saned.service
Job for saned.service failed because the control process exited with error code.
See "systemctl status saned.service" and "journalctl -xeu saned.service" for details.
friedrich@friedrich-xyz-Laptop-15-cs3xxx:~$ sudo systemctl stop saned.service
friedrich@friedrich-xyz-Laptop-15-cs3xxx:~$ sudo systemctl status saned.service
× saned.service - LSB: SANE network scanner server
Loaded: loaded (/etc/init.d/saned; generated)
Active: failed (Result: exit-code) since Fri 2025-01-31 06:54:07 CET; 15s ago
Docs: man:systemd-sysv-generator(8)
Process: 27668 ExecStart=/etc/init.d/saned start (code=exited, status=1/FAILURE)
CPU: 29ms
Jan 31 06:54:07 friedrich-xyz-Laptop-15-cs3xxx saned[27668]: * Starting SANE network scanner server saned
Jan 31 06:54:07 friedrich-xyz-Laptop-15-cs3xxx saned[27675]: saned (AF-indep+IPv6) from sane-backends 1.2.1-debian starting up
Jan 31 06:54:07 friedrich-xyz-Laptop-15-cs3xxx saned[27675]: do_bindings: [1] bind failed: Address already in use
Jan 31 06:54:07 friedrich-xyz-Laptop-15-cs3xxx saned[27675]: do_bindings: [0] bind failed: Address already in use
Jan 31 06:54:07 friedrich-xyz-Laptop-15-cs3xxx saned[27675]: do_bindings: couldn't bind an address. Exiting.
Jan 31 06:54:07 friedrich-xyz-Laptop-15-cs3xxx saned[27675]: FATAL ERROR; bailing out, waiting for children...
Jan 31 06:54:07 friedrich-xyz-Laptop-15-cs3xxx saned[27675]: bail_out: all children exited
Jan 31 06:54:07 friedrich-xyz-Laptop-15-cs3xxx systemd[1]: saned.service: Control process exited, code=exited, status=1/FAILURE
Jan 31 06:54:07 friedrich-xyz-Laptop-15-cs3xxx systemd[1]: saned.service: Failed with result 'exit-code'.
Jan 31 06:54:07 friedrich-xyz-Laptop-15-cs3xxx systemd[1]: Failed to start saned.service - LSB: SANE network scanner server.
friedrich@friedrich-xyz-Laptop-15-cs3xxx:~$
During that learning phase I understood that the port 6566 is held by the init process as long as there is no "job" for the saned.service.
Although knowing that the service is just waiting to be triggered by an incoming packet through saned.socket it should not "hang" in this state. Maybe I am wrong and do not understand the way how the application, the systemd and the saned.service interoperate.
Update #1 related to @graham question:
friedrich@friedrich-xyz-Laptop-15-cs3xxx:~$ sudo sane-find-scanner
[sudo] Passwort für friedrich:
sane-find-scanner will now attempt to detect your scanner. If the
result is different from what you expected, first make sure your
scanner is powered up and properly connected to your computer.
No SCSI scanners found. If you expected something different, make sure that
you have loaded a kernel SCSI driver for your SCSI adapter.
No USB scanners found. If you expected something different, make sure that
you have loaded a kernel driver for your USB host controller and have setup
the USB system correctly. See man sane-usb for details.
Not checking for parallel port scanners.
Most Scanners connected to the parallel port or other proprietary ports
can't be detected by this program.
friedrich@friedrich-HP-Pavilion-Laptop-15-cs3xxx:~$
friedrich@friedrich-xyz-Laptop-15-cs3xxx:~$ scanimage -L
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).
friedrich@friedrich-HP-Pavilion-Laptop-15-cs3xxx:~$
friedrich@friedrich-xyz-Laptop-15-cs3xxx:~$ sudo simple-scan
friedrich@friedrich-xyz-Laptop-15-cs3xxx:~$
Simple-Scan output for the single Brother DCP-J315W scanner in the system
Update #2 related to apt packet listings in other questions - see below:
Question where @WinEunuuchs2Unix pointed to
Is it possible that there are some conflicts in the installed packets?
friedrich@friedrich-xyz-Laptop-15-cs3xxx:~$ apt list *sane*
Auflistung… Fertig
gir1.2-libinsane-1.0/noble 1.0.10-1build3 amd64
iamerican-insane/noble,noble 3.4.06-1 all
ibritish-insane/noble,noble 3.4.06-1 all
libimage-sane-perl/noble,now 5-2build3 amd64 [Installiert,automatisch]
libinsane-dev/noble 1.0.10-1build3 amd64
libinsane-doc/noble,noble 1.0.10-1build3 all
libinsane1/noble 1.0.10-1build3 amd64
libkf5sane-data/noble,noble 23.08.5-0ubuntu3 all
libkf5sane-dev/noble 23.08.5-0ubuntu3 amd64
libkf5sane5/noble 23.08.5-0ubuntu3 amd64
libksanecore-dev/noble 23.08.5-0ubuntu3 amd64
libksanecore1/noble 23.08.5-0ubuntu3 amd64
libsane-common/noble,noble,now 1.2.1-7build4 all [Installiert,automatisch]
libsane-dev/noble,now 1.2.1-7build4 amd64 [installiert] # LOOK HERE!
libsane-dev/noble 1.2.1-7build4 i386 # LOOK HERE!
libsane-hpaio/noble,now 3.23.12+dfsg0-0ubuntu5 amd64 [Installiert,automatisch]
libsane1/noble,now 1.2.1-7build4 amd64 [Installiert,automatisch]
libsane1/noble 1.2.1-7build4 i386
libsane/now 1.0.28 all [Installiert,lokal]
node-sane/noble,noble 4.1.0+~cs18.17.38-2 all
pike8.0-sane/noble 8.0.1738-1.3ubuntu1 amd64
python3-numpysane/noble,noble 0.40-3 all
python3-sane/noble 2.9.1-3build1 amd64
python3-saneyaml/noble,noble 0.3-2 all
sane-airscan/noble,now 0.99.29-0ubuntu4 amd64 [Installiert,automatisch]
sane-utils/noble,now 1.2.1-7build4 amd64 [installiert] # LOOK HERE!
sane-utils/noble 1.2.1-7build4 i386 # LOOK HERE!
sane/noble,now 1.0.14-18 amd64 [installiert]
wamerican-insane/noble,noble 2020.12.07-2 all
wbritish-insane/noble,noble 2020.12.07-2 all
wcanadian-insane/noble,noble 2020.12.07-2 all
xsane-common/noble,noble,now 0.999-12ubuntu4 all [Installiert,automatisch]
xsane/noble,now 0.999-12ubuntu4 amd64 [installiert]
friedrich@friedrich-xyz-Laptop-15-cs3xxx:~$
Update #3 focus on the core issue:
To make the understanding of the problem easier I collect here the main actions journalctl of the service start, a restart, a stop and a start action.
friedrich@friedrich-xyz-Laptop-15-cs3xxx:~$ journalctl -u saned.service
Jan 29 01:46:06 friedrich-xyz-Laptop-15-cs3xxx systemd[1]: Starting saned.service - LSB: SANE network scanner server...
Jan 29 01:46:06 friedrich-xyz-Laptop-15-cs3xxx saned[33355]: * Starting SANE network scanner server saned
Jan 29 01:46:06 friedrich-xyz-Laptop-15-cs3xxx saned[33362]: saned (AF-indep+IPv6) from sane-backends 1.2.1-debian starting up
Jan 29 01:46:06 friedrich-xyz-Laptop-15-cs3xxx saned[33362]: do_bindings: [1] bind failed: Address already in use
Jan 29 01:46:06 friedrich-xyz-Laptop-15-cs3xxx saned[33362]: do_bindings: [0] bind failed: Address already in use
Jan 29 01:46:06 friedrich-xyz-Laptop-15-cs3xxx saned[33362]: do_bindings: couldn't bind an address. Exiting.
Jan 29 01:46:06 friedrich-xyz-Laptop-15-cs3xxx saned[33362]: FATAL ERROR; bailing out, waiting for children...
Jan 29 01:46:06 friedrich-xyz-Laptop-15-cs3xxx saned[33362]: bail_out: all children exited
Jan 29 01:46:06 friedrich-xyz-Laptop-15-cs3xxx systemd[1]: saned.service: Control process exited, code=exited, status=1/FAILURE
Jan 29 01:46:06 friedrich-xyz-Laptop-15-cs3xxx systemd[1]: saned.service: Failed with result 'exit-code'.
Jan 29 01:46:06 friedrich-xyz-Laptop-15-cs3xxx systemd[1]: Failed to start saned.service - LSB: SANE network scanner server.
friedrich@friedrich-xyz-Laptop-15-cs3xxx:~$ sudo systemctl restart saned.service
Job for saned.service failed because the control process exited with error code.
See "systemctl status saned.service" and "journalctl -xeu saned.service" for details.
friedrich@friedrich-xyz-Laptop-15-cs3xxx:~$ sudo systemctl stop saned.service
friedrich@friedrich-xyz-Laptop-15-cs3xxx:~$ sudo systemctl start saned.service
Job for saned.service failed because the control process exited with error code.
See "systemctl status saned.service" and "journalctl -xeu saned.service" for details.
friedrich@friedrich-xyz-Laptop-15-cs3xxx:~$
Due to the binding errors I am directed to the port TCP 6566 being used ...
friedrich@friedrich-xyz-Laptop-15-cs3xxx:~$ sudo netstat -tulpn
Aktive Internetverbindungen (Nur Server)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.54:53 0.0.0.0:* LISTEN 1437/systemd-resolv
tcp 0 0 10.253.61.1:53 0.0.0.0:* LISTEN 6498/dnsmasq
tcp 0 0 10.46.38.1:53 0.0.0.0:* LISTEN 4670/dnsmasq
tcp 0 0 127.0.0.1:8461 0.0.0.0:* LISTEN 2677/python3
tcp 0 0 127.0.0.53:53 0.0.0.0:* LISTEN 1437/systemd-resolv
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 690821/cupsd
tcp6 0 0 :::8080 :::* LISTEN 6260/java
tcp6 0 0 :::6566 :::* LISTEN 1/init
tcp6 0 0 127.0.0.1:8101 :::* LISTEN 6260/java
tcp6 0 0 127.0.0.1:37353 :::* LISTEN 6260/java
tcp6 0 0 ::1:631 :::* LISTEN 690821/cupsd
tcp6 0 0 :::5007 :::* LISTEN 6260/java
tcp6 0 0 fd42:47ab:11bd:385d::53 :::* LISTEN 6498/dnsmasq
tcp6 0 0 :::8443 :::* LISTEN 6260/java
tcp6 0 0 :::8444 :::* LISTEN 5245/lxd
udp 0 0 0.0.0.0:45527 0.0.0.0:* 2658/avahi-daemon:
udp 0 0 0.0.0.0:5353 0.0.0.0:* 2658/avahi-daemon:
udp 0 0 0.0.0.0:54925 0.0.0.0:* 8430/brscan-skey-ex
udp 0 0 10.253.61.1:53 0.0.0.0:* 6498/dnsmasq
udp 0 0 10.46.38.1:53 0.0.0.0:* 4670/dnsmasq
udp 0 0 127.0.0.54:53 0.0.0.0:* 1437/systemd-resolv
udp 0 0 127.0.0.53:53 0.0.0.0:* 1437/systemd-resolv
udp 0 0 0.0.0.0:67 0.0.0.0:* 6498/dnsmasq
udp 0 0 0.0.0.0:67 0.0.0.0:* 4670/dnsmasq
udp6 0 0 192.168.178.91:60898 :::* 6260/java
udp6 0 0 :::5353 :::* 6260/java
udp6 0 0 :::5353 :::* 6260/java
udp6 0 0 :::5353 :::* 6260/java
udp6 0 0 :::5353 :::* 2658/avahi-daemon:
udp6 0 0 :::56035 :::* 2658/avahi-daemon:
udp6 0 0 fd42:47ab:11bd:385d::53 :::* 6498/dnsmasq
udp6 0 0 :::547 :::* 6498/dnsmasq
udp6 0 0 :::1900 :::* 6260/java
udp6 0 0 :::1902 :::* 6260/java
friedrich@friedrich-xyz-Laptop-15-cs3xxx:~$ sudo lsof -i :6566
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
systemd 1 root 172u IPv6 23330 0t0 TCP *:sane-port (LISTEN)
friedrich@friedrich-xyz-Laptop-15-cs3xxx:~$
This looks quite OK, true?
Update #4 debugging of SANE:
starting and stimulation with debugged scanimage:
SANE_DEBUG_DLL=255 SANE_DEBUG_BROTHER3=255 SANE_DEBUG_SANEI_TCP=255 scanimage -L &> discovery_output
excerpt of the output discovery_output ... backend brother3 is added to dll.conf:
[22:52:00.597862] [dll] add_backend: adding backend `avision'
[22:52:00.597872] [dll] add_backend: adding backend `bh'
[22:52:00.597883] [dll] add_backend: adding backend `brother3'
[22:52:00.597892] [dll] add_backend: adding backend `canon'
[22:52:00.597901] [dll] add_backend: adding backend `canon630u'
Failure in trial to load the backend brother3:
[22:52:06.474474] [dll] load: searching backend `brother3' in `/usr/lib/x86_64-linux-gnu/sane:/usr/lib/sane:/usr/lib64/sane'
[22:52:06.474483] [dll] load: trying to load `/usr/lib/x86_64-linux-gnu/sane/libsane-brother3.so.1'
[22:52:06.474496] [dll] load: dlopen()ing `/usr/lib/x86_64-linux-gnu/sane/libsane-brother3.so.1'
[22:52:06.474703] [dll] load: dlopen() failed (libusb-0.1.so.4: cannot open shared object file: No such file or directory)
Although the scanner is linked via Wireless/TCP-IP the check is done for a USB-Device - and of course fails.
In the sane_exit phase the backend brother3 is omitted:
[22:52:11.649758] [dll] sane_exit: calling backend `canon630u's exit function
[22:52:11.649853] [dll] sane_exit: calling backend `canon's exit function
[22:52:11.649902] [dll] sane_exit: calling backend `bh's exit function
[22:52:11.649956] [dll] sane_exit: calling backend `avision's exit function
[22:52:11.650041] [dll] sane_exit: calling backend `artec_eplus48u's exit function
What can be the root-cause or even a solution?
Best regards
FrSch