Canon PIXMA bjnp_tcp Connection refused
For the time being the issue is fixed. May be it will help somebody else running into that issue.
Some time ago my CANON PIXMA MG3150 (via WLAN) stopped scanning with an error message like "bjnp_tcp Connection refused".
I checked firewalls (ufw), disabled it, purged sane, sane-utils, libsane and reinstalled it, compiled latest backends, twitched /etc/sane.conf, etc. rebooted, switched on and off the scanner, went through the installation instructions of sane.org and other fora several times - nothing helped.
In another issue here I found a command-line beginning with "SANE_DEBUG_PIXMA=11". Not sure but I think I also tried that before. There was a sound indicating something was going on at the scanner. That's why I just tried a second run (see below):
First run:
[sorry, not enough lines in the buffer]
scanimage: stepped read, 2048 bytes... PASS
scanimage: stepped read, 2047 bytes... PASS
scanimage: stepped read, 1023 bytes... PASS
scanimage: stepped read, 511 bytes... PASS
scanimage: stepped read, 255 bytes... PASS
scanimage: stepped read, 127 bytes... PASS
scanimage: stepped read, 63 bytes... PASS
scanimage: stepped read, 31 bytes... PASS
scanimage: stepped read, 15 bytes... PASS
scanimage: stepped read, 7 bytes... PASS
scanimage: stepped read, 3 bytes... PASS
[pixma] OUT T=22.595 len=16
[pixma] 00000000:d4 20 00 00 00 00 00 00 00 00 00 00 00 08 00 08
[pixma]
[pixma] IN T=22.601 len=512
[pixma] 00000000:06 06 00 00 00 00 00 00 00 00 00 00 00 00 c0 00
[pixma] 00000010:f5 fa f3 f3 f9 f2 f4 f7 f2 f5 fb f2 f4 f9 f3 f8
[pixma] 00000020:f9 f1 f6 fa f3 f3 f6 f1 f2 f7 f0 f2 f7 f1 f2 fb
[pixma] 00000030:f2 f7 f9 f3 f3 f8 f4 f5 f4 f1 f6 fa f0 f6 f8 f0
[pixma] 00000040:f6 f8 f0 f5 fa f5 f2 f9 ee f4 f6 f5 ee f4 f2 f4
[pixma] 00000050:f8 f0 f4 f6 f2 f4 fb f1 f5 f6 f4 f5 f2 f2 f7 f6
[pixma] 00000060:f2 f7 f5 f0 f4 f9 f2 f7 f7 f3 f3 f4 f4 f2 f8 f5
[pixma] 00000070:f3 f7 f6 f1 f9 f3 ef f8 f1 f4 fb f4 f8 f9 f3 f2
[pixma] ...
[pixma]
[pixma] IN T=22.632 len=48656
[pixma] 00000000:f6 ef f2 f3 ee f3 f1 f1 f1 f4 f3 f2 f4 ee ef f6
[pixma] 00000010:ee f1 f4 ef f2 ef f0 f5 f6 f0 ef f8 f2 ef f4 ef
[pixma] 00000020:f2 f6 ef f3 f2 f2 f2 f1 f0 f2 f1 ef f0 f4 f3 f3
[pixma] 00000030:f4 f1 f0 f4 f0 ed f1 f0 f0 f2 f0 f1 f3 f5 f2 f3
[pixma] 00000040:f1 f4 f3 ee f3 f8 f1 f3 f5 f2 f6 f1 f2 f2 f9 f1
[pixma] 00000050:f5 f5 f0 f4 f5 f3 f3 f5 f6 f2 f6 ef f4 f6 f2 f7
[pixma] 00000060:f4 f0 f4 f5 f3 f4 f8 f3 f4 fa f2 f7 f8 f3 f3 f9
[pixma] 00000070:f3 f6 fa f5 f6 f8 f2 f5 fb f5 f8 fb f6 f6 fa f3
[pixma] ...
[pixma]
[pixma] *mp150_finish_scan***** abort session *****
[pixma] OUT T=22.635 len=16
[pixma] 00000000:ef 20 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[pixma]
[pixma] IN T=22.637 len=8
[pixma] 00000000:06 06 00 00 00 00 00 00
[pixma]
[pixma] OUT T=22.641 len=262
[pixma] 00000000:3c 3f 78 6d 6c 20 76 65 72 73 69 6f 6e 3d 22 31
[pixma] 00000010:2e 30 22 20 65 6e 63 6f 64 69 6e 67 3d 22 75 74
[pixma] 00000020:66 2d 38 22 20 3f 3e 3c 63 6d 64 20 78 6d 6c 6e
[pixma] 00000030:73 3a 69 76 65 63 3d 22 68 74 74 70 3a 2f 2f 77
[pixma] 00000040:77 77 2e 63 61 6e 6f 6e 2e 63 6f 6d 2f 6e 73 2f
[pixma] 00000050:63 6d 64 2f 32 30 30 38 2f 30 37 2f 63 6f 6d 6d
[pixma] 00000060:6f 6e 2f 22 3e 3c 69 76 65 63 3a 63 6f 6e 74 65
[pixma] 00000070:6e 74 73 3e 3c 69 76 65 63 3a 6f 70 65 72 61 74
[pixma] ...
[pixma]
[pixma] IN T=22.644 len=363
[pixma] 00000000:3c 3f 78 6d 6c 20 76 65 72 73 69 6f 6e 3d 22 31
[pixma] 00000010:2e 30 22 20 65 6e 63 6f 64 69 6e 67 3d 22 75 74
[pixma] 00000020:66 2d 38 22 20 3f 3e 0d 0a 3c 63 6d 64 20 78 6d
[pixma] 00000030:6c 6e 73 3a 69 76 65 63 3d 22 68 74 74 70 3a 2f
[pixma] 00000040:2f 77 77 77 2e 63 61 6e 6f 6e 2e 63 6f 6d 2f 6e
[pixma] 00000050:73 2f 63 6d 64 2f 32 30 30 38 2f 30 37 2f 63 6f
[pixma] 00000060:6d 6d 6f 6e 2f 22 3e 0d 0a 09 3c 69 76 65 63 3a
[pixma] 00000070:63 6f 6e 74 65 6e 74 73 3e 0d 0a 09 09 3c 69 76
[pixma] ...
[pixma]
[pixma] XML message sent to scanner:
<?xml version="1.0" encoding="utf-8" ?><cmd xmlns:ivec="http://www.canon.com/ns/cmd/2008/07/common/"><ivec:contents><ivec:operation>EndJob</ivec:operation><ivec:param_set servicetype="scan"><ivec:jobID>00000001</ivec:jobID></ivec:param_set></ivec:contents></cmd>
[pixma] XML response back from scanner:
<?xml version="1.0" encoding="utf-8" ?>
<cmd xmlns:ivec="http://www.canon.com/ns/cmd/2008/07/common/">
<ivec:contents>
<ivec:operation>EndJobResponse</ivec:operation>
<ivec:param_set servicetype="scan">
<ivec:response>OK</ivec:response>
<ivec:response_detail/>
<ivec:jobID>00000001</ivec:jobID>
</ivec:param_set>
</ivec:contents>
</cmd>
[pixma] pixma_read_image(): cancelled by software
[pixma] Reader task terminated: ECANCELED
[pixma] pixma_close(): Canon PIXMA MG3100
Second run:
$ SANE_DEBUG_PIXMA=11 scanimage > Downloads/scantest
[sanei_debug] Setting debug level of pixma to 11.
[pixma] pixma is compiled with pthread support.
[pixma] pixma version 0.17.37
[pixma] Scanner model found: Name MG3100(Canon PIXMA MG3100) matches MG3100 series
[pixma] pixma_collect_devices() found Canon PIXMA MG3100 at bjnp://192.168.233.12:8612/timeout=1000
[pixma] pixma_find_scanners() found 1 devices
[pixma] Scanner model found: Name MG3100(Canon PIXMA MG3100) matches MG3100 series
[pixma] pixma_collect_devices() found Canon PIXMA MG3100 at bjnp://192.168.233.12:8612/timeout=1000
[pixma] pixma_open(): Canon PIXMA MG3100
[pixma] *mp150_open***** This is a generation 4 scanner. *****
[pixma] Reader task started
[pixma] Reader task id=140064647407360 (threaded)
[pixma]
[pixma] pixma_scan(): start
[pixma] line_size=1914 image_size=1678578 channels=3 depth=8
[pixma] dpi=75x75 offset=(0,0) dimension=638x877
[pixma] gamma_table=0x55b485b12308 source=0
[pixma] threshold=127 threshold_curve=0
[pixma] adf-wait=0
[pixma] ADF page count: 0
[pixma] OUT T=13.179 len=288
[pixma] 00000000:3c 3f 78 6d 6c 20 76 65 72 73 69 6f 6e 3d 22 31
[pixma] 00000010:2e 30 22 20 65 6e 63 6f 64 69 6e 67 3d 22 75 74
[pixma] 00000020:66 2d 38 22 20 3f 3e 3c 63 6d 64 20 78 6d 6c 6e
[pixma] 00000030:73 3a 69 76 65 63 3d 22 68 74 74 70 3a 2f 2f 77
[pixma] 00000040:77 77 2e 63 61 6e 6f 6e 2e 63 6f 6d 2f 6e 73 2f
[pixma] 00000050:63 6d 64 2f 32 30 30 38 2f 30 37 2f 63 6f 6d 6d
[pixma] 00000060:6f 6e 2f 22 3e 3c 69 76 65 63 3a 63 6f 6e 74 65
[pixma] 00000070:6e 74 73 3e 3c 69 76 65 63 3a 6f 70 65 72 61 74
[pixma] ...
[pixma]
[pixma] IN T=13.189 len=365
[pixma] 00000000:3c 3f 78 6d 6c 20 76 65 72 73 69 6f 6e 3d 22 31
[pixma] 00000010:2e 30 22 20 65 6e 63 6f 64 69 6e 67 3d 22 75 74
[pixma] 00000020:66 2d 38 22 20 3f 3e 0d 0a 3c 63 6d 64 20 78 6d
[pixma] 00000030:6c 6e 73 3a 69 76 65 63 3d 22 68 74 74 70 3a 2f
[pixma] 00000040:2f 77 77 77 2e 63 61 6e 6f 6e 2e 63 6f 6d 2f 6e
[pixma] 00000050:73 2f 63 6d 64 2f 32 30 30 38 2f 30 37 2f 63 6f
[pixma] 00000060:6d 6d 6f 6e 2f 22 3e 0d 0a 09 3c 69 76 65 63 3a
[pixma] 00000070:63 6f 6e 74 65 6e 74 73 3e 0d 0a 09 09 3c 69 76
[pixma] ...
[pixma]
[pixma] XML message sent to scanner:
<?xml version="1.0" encoding="utf-8" ?><cmd xmlns:ivec="http://www.canon.com/ns/cmd/2008/07/common/"><ivec:contents><ivec:operation>StartJob</ivec:operation><ivec:param_set servicetype="scan"><ivec:jobID>00000001</ivec:jobID><ivec:bidi>1</ivec:bidi></ivec:param_set></ivec:contents></cmd>
[pixma] XML response back from scanner:
<?xml version="1.0" encoding="utf-8" ?>
<cmd xmlns:ivec="http://www.canon.com/ns/cmd/2008/07/common/">
<ivec:contents>
<ivec:operation>StartJobResponse</ivec:operation>
<ivec:param_set servicetype="scan">
<ivec:response>OK</ivec:response>
<ivec:response_detail/>
<ivec:jobID>00000001</ivec:jobID>
</ivec:param_set>
</ivec:contents>
</cmd>
[pixma] OUT T=13.194 len=390
[pixma] 00000000:3c 3f 78 6d 6c 20 76 65 72 73 69 6f 6e 3d 22 31
[pixma] 00000010:2e 30 22 20 65 6e 63 6f 64 69 6e 67 3d 22 75 74
[pixma] 00000020:66 2d 38 22 20 3f 3e 3c 63 6d 64 20 78 6d 6c 6e
[pixma] 00000030:73 3a 69 76 65 63 3d 22 68 74 74 70 3a 2f 2f 77
[pixma] 00000040:77 77 2e 63 61 6e 6f 6e 2e 63 6f 6d 2f 6e 73 2f
[pixma] 00000050:63 6d 64 2f 32 30 30 38 2f 30 37 2f 63 6f 6d 6d
[pixma] 00000060:6f 6e 2f 22 20 78 6d 6c 6e 73 3a 76 63 6e 3d 22
[pixma] 00000070:68 74 74 70 3a 2f 2f 77 77 77 2e 63 61 6e 6f 6e
[pixma] ...
[pixma]
[pixma] IN T=13.197 len=510
[pixma] 00000000:3c 3f 78 6d 6c 20 76 65 72 73 69 6f 6e 3d 22 31
[pixma] 00000010:2e 30 22 20 65 6e 63 6f 64 69 6e 67 3d 22 75 74
[pixma] 00000020:66 2d 38 22 20 3f 3e 0d 0a 3c 63 6d 64 20 78 6d
[pixma] 00000030:6c 6e 73 3a 69 76 65 63 3d 22 68 74 74 70 3a 2f
[pixma] 00000040:2f 77 77 77 2e 63 61 6e 6f 6e 2e 63 6f 6d 2f 6e
[pixma] 00000050:73 2f 63 6d 64 2f 32 30 30 38 2f 30 37 2f 63 6f
[pixma] 00000060:6d 6d 6f 6e 2f 22 0d 0a 78 6d 6c 6e 73 3a 76 63
[pixma] 00000070:6e 3d 22 68 74 74 70 3a 2f 2f 77 77 77 2e 63 61
[pixma] ...
[pixma]
[pixma] XML message sent to scanner:
<?xml version="1.0" encoding="utf-8" ?><cmd xmlns:ivec="http://www.canon.com/ns/cmd/2008/07/common/" xmlns:vcn="http://www.canon.com/ns/cmd/2008/07/canon/"><ivec:contents><ivec:operation>VendorCmd</ivec:operation><ivec:param_set servicetype="scan"><ivec:jobID>00000001</ivec:jobID><vcn:ijoperation>ModeShift</vcn:ijoperation><vcn:ijmode>1</vcn:ijmode></ivec:param_set></ivec:contents></cmd>
[pixma] XML response back from scanner:
<?xml version="1.0" encoding="utf-8" ?>
<cmd xmlns:ivec="http://www.canon.com/ns/cmd/2008/07/common/"
xmlns:vcn="http://www.canon.com/ns/cmd/2008/07/canon/">
<ivec:contents>
<ivec:operation>VendorCmdResponse</ivec:operation>
<ivec:param_set servicetype="scan">
<ivec:response>OK</ivec:response>
<ivec:response_detail/>
<vcn:ijoperation>ModeShiftResponse</vcn:ijoperation>
<vcn:ijresponse>OK</vcn:ijresponse>
<vcn:ijresponse_detail/>
</ivec:param_set>
</ivec:contents>
</cmd>
[pixma] *mp150_scan***** start scanning *****
[pixma] OUT T=13.204 len=16
[pixma] 00000000:db 20 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[pixma]
[pixma] IN T=13.206 len=8
[pixma] 00000000:06 06 00 00 00 00 00 00
[pixma]
[pixma] OUT T=13.211 len=2072
[pixma] 00000000:ee 20 00 00 00 00 00 00 00 00 00 00 00 00 08 08
[pixma] 00000010:10 00 08 04 00 00 0b 0b 0f 0f 12 12 15 15 17 17
[pixma] 00000020:19 19 1a 1a 1c 1c 1e 1e 1f 1f 20 20 22 22 23 23
[pixma] 00000030:24 24 25 25 27 27 28 28 29 29 2a 2a 2b 2b 2c 2c
[pixma] 00000040:2d 2d 2d 2d 2e 2e 2f 2f 30 30 31 31 32 32 32 32
[pixma] 00000050:33 33 34 34 35 35 36 36 36 36 37 37 38 38 38 38
[pixma] 00000060:39 39 3a 3a 3a 3a 3b 3b 3c 3c 3c 3c 3d 3d 3e 3e
[pixma] 00000070:3e 3e 3f 3f 3f 3f 40 40 41 41 41 41 42 42 42 42
[pixma] ...
[pixma]
[pixma] IN T=13.214 len=8
[pixma] 00000000:06 06 00 00 00 00 00 00
[pixma]
[pixma] OUT T=13.217 len=2072
[pixma] 00000000:ee 20 00 00 00 00 00 00 00 00 00 00 00 00 08 08
[pixma] 00000010:10 00 08 04 00 00 0b 0b 0f 0f 12 12 15 15 17 17
[pixma] 00000020:19 19 1a 1a 1c 1c 1e 1e 1f 1f 20 20 22 22 23 23
[pixma] 00000030:24 24 25 25 27 27 28 28 29 29 2a 2a 2b 2b 2c 2c
[pixma] 00000040:2d 2d 2d 2d 2e 2e 2f 2f 30 30 31 31 32 32 32 32
[pixma] 00000050:33 33 34 34 35 35 36 36 36 36 37 37 38 38 38 38
[pixma] 00000060:39 39 3a 3a 3a 3a 3b 3b 3c 3c 3c 3c 3d 3d 3e 3e
[pixma] 00000070:3e 3e 3f 3f 3f 3f 40 40 41 41 41 41 42 42 42 42
[pixma] ...
[pixma]
[pixma] IN T=13.219 len=8
[pixma] 00000000:06 06 00 00 00 00 00 00
[pixma]
[pixma] OUT T=13.222 len=2072
[pixma] 00000000:ee 20 00 00 00 00 00 00 00 00 00 00 00 00 08 08
[pixma] 00000010:10 00 08 04 00 00 0b 0b 0f 0f 12 12 15 15 17 17
[pixma] 00000020:19 19 1a 1a 1c 1c 1e 1e 1f 1f 20 20 22 22 23 23
[pixma] 00000030:24 24 25 25 27 27 28 28 29 29 2a 2a 2b 2b 2c 2c
[pixma] 00000040:2d 2d 2d 2d 2e 2e 2f 2f 30 30 31 31 32 32 32 32
[pixma] 00000050:33 33 34 34 35 35 36 36 36 36 37 37 38 38 38 38
[pixma] 00000060:39 39 3a 3a 3a 3a 3b 3b 3c 3c 3c 3c 3d 3d 3e 3e
[pixma] 00000070:3e 3e 3f 3f 3f 3f 40 40 41 41 41 41 42 42 42 42
[pixma] ...
[many similar lines]
[pixma] IN T=23.157 len=363
[pixma] 00000000:3c 3f 78 6d 6c 20 76 65 72 73 69 6f 6e 3d 22 31
[pixma] 00000010:2e 30 22 20 65 6e 63 6f 64 69 6e 67 3d 22 75 74
[pixma] 00000020:66 2d 38 22 20 3f 3e 0d 0a 3c 63 6d 64 20 78 6d
[pixma] 00000030:6c 6e 73 3a 69 76 65 63 3d 22 68 74 74 70 3a 2f
[pixma] 00000040:2f 77 77 77 2e 63 61 6e 6f 6e 2e 63 6f 6d 2f 6e
[pixma] 00000050:73 2f 63 6d 64 2f 32 30 30 38 2f 30 37 2f 63 6f
[pixma] 00000060:6d 6d 6f 6e 2f 22 3e 0d 0a 09 3c 69 76 65 63 3a
[pixma] 00000070:63 6f 6e 74 65 6e 74 73 3e 0d 0a 09 09 3c 69 76
[pixma] ...
[pixma]
[pixma] XML message sent to scanner:
<?xml version="1.0" encoding="utf-8" ?><cmd xmlns:ivec="http://www.canon.com/ns/cmd/2008/07/common/"><ivec:contents><ivec:operation>EndJob</ivec:operation><ivec:param_set servicetype="scan"><ivec:jobID>00000001</ivec:jobID></ivec:param_set></ivec:contents></cmd>
[pixma] XML response back from scanner:
<?xml version="1.0" encoding="utf-8" ?>
<cmd xmlns:ivec="http://www.canon.com/ns/cmd/2008/07/common/">
<ivec:contents>
<ivec:operation>EndJobResponse</ivec:operation>
<ivec:param_set servicetype="scan">
<ivec:response>OK</ivec:response>
<ivec:response_detail/>
<ivec:jobID>00000001</ivec:jobID>
</ivec:param_set>
</ivec:contents>
</cmd>
[pixma] pixma_read_image():completed
[pixma] Reader task terminated
[pixma] pixma_close(): Canon PIXMA MG3100
And now the file scantest was not empty any more. Now it works without the "SANE_DEBUG_PIXMA=11" environment, default config files and a running firewall.
systemctl still shows
saned.service loaded failed failed LSB: SANE network scanner
apt list sane*
Auflistung... Fertig
sane-utils/stable,now 1.0.27-3.2 amd64 [installiert]
sane/stable,now 1.0.14-13+b1 amd64 [installiert]
root:~# apt list libsane*
Auflistung... Fertig
libsane-common/stable,testing,now 1.0.27-3.2 all [installiert]
libsane-dev/stable,now 1.0.27-3.2 amd64 [installiert]
libsane-hpaio/stable 3.18.12+dfsg0-2 amd64
libsane/stable,now 1.0.27-3.2 amd64 [installiert]
uname -a
Linux name 5.5.0-2-amd64 #1 SMP Debian 5.5.17-1 (2020-04-15) x86_64 GNU/Linux
$ inxi -SMCIi
System: Host: name Kernel: 5.5.0-2-amd64 x86_64 bits: 64 Desktop: Xfce 4.12.4 Distro: Debian GNU/Linux 10 (buster)
Machine: Type: Desktop System: Micro-Star product: MS-7A32 v: 1.0 serial: <root required>
Mobo: Micro-Star model: X370 GAMING PRO CARBON AC (MS-7A32) v: 1.0 serial: <root required>
UEFI: American Megatrends v: 2.IQ date: 11/29/2019
CPU: Topology: 8-Core model: AMD Ryzen 7 1700X bits: 64 type: MT MCP L2 cache: 4096 KiB
Speed: 3506 MHz min/max: N/A Core speeds (MHz): 1: 3506 2: 3501 3: 3528 4: 3499 5: 3495 6: 3500 7: 3499 8: 3520
9: 3496 10: 3500 11: 3496 12: 3492 13: 3499 14: 3496 15: 3499 16: 3483
Network: Device-1: Intel I211 Gigabit Network driver: igb
IF: eno1 state: up speed: 1000 Mbps duplex: full mac: *:*
IP v4: *.*.*.*/24 type: noprefixroute scope: global
IP v6: *::*/64 type: temporary dynamic scope: global
IP v6: *::*/64 type: dynamic mngtmpaddr noprefixroute scope: global
IP v6: fe80::*/64 type: noprefixroute scope: link
Device-2: Intel Dual Band Wireless-AC 3168NGW [Stone Peak] driver: iwlwifi
IF: wlp35s0 state: down mac: *:*
WAN IP: No WAN IP data found. Connected to the web? SSL issues?
Info: Processes: 376 Uptime: 22h 29m Memory: 31.38 GiB used: 6.72 GiB (21.4%) Shell: bash inxi: 3.0.32
How to get rid of the saned.service failed line in systemctl status?
There is no helpful sane output in journalctl (AFAIK) but if you like something, just tell me.