1

I would like to install a scanserver on my Raspberry Pi 3 following these instructions. The operating system is the current Raspberry OS: "2021-10-30-raspios-bullseye-armhf-lite".

The step sudo scanimage >/tmp/out.pnm give the following result:

Output format is not set, using pnm as a default.
scanimage: no SANE devices found

When trying the step sudo scanimage -L I get the following result:

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

The result from sudo sane-find-scanner is the following (skipping the comments):

found USB scanner (vendor=0x04c5 [Fujitsu], product=0x132b [ScanSnap iX500]) at libusb:001:005
found USB scanner (vendor=0x0424, product=0xec00) at libusb:001:003

An internet search gave me some advice to add the scanner in /etc/udev/rules.d which unfortunately does not solve the problem at all. Here are two links:

The scanner itself is up to date and scans nicely when connected to a windows machine.

Do you have any hints?

Thanks you very much!

Additional information

$ scanimage --version
scanimage (sane-backends) 1.0.31-debian; backend version 1.0.31

and

$ SANE_DEBUG_DLL=128  scanimage -L 2>&1 | grep -i fuj
[11:36:59.869511] [dll] add_backend: adding backend `fujitsu'
[11:37:04.079736] [dll] load: searching backend `fujitsu' in `/usr/lib/arm-linux-gnueabihf/sane:/usr/lib/sane:/usr/lib64/sane'
[11:37:04.079790] [dll] load: trying to load `/usr/lib/arm-linux-gnueabihf/sane/libsane-fujitsu.so.1'
[11:37:04.079862] [dll] load: dlopen()ing `/usr/lib/arm-linux-gnueabihf/sane/libsane-fujitsu.so.1'
[11:37:04.081730] [dll] init: initializing backend `fujitsu'
[11:37:04.081885] [dll] init: backend `fujitsu' is version 1.0.136
[11:37:06.613099] [dll] sane_exit: calling backend `fujitsu's exit function

Next step:

$ SANE_DEBUG_FUJITSU=15 scanimage -L
[13:49:54.374247] [fujitsu] sane_get_devices: looking for 'usb 0x04c5 0x132b'
[13:49:54.374332] [fujitsu] attach_one: start
[13:49:54.374408] [fujitsu] attach_one: looking for 'libusb:001:005'
[13:49:54.374498] [fujitsu] connect_fd: start
[13:49:54.374576] [fujitsu] connect_fd: opening USB device
[13:49:54.374921] [fujitsu] connect_fd: could not open device: 3
[13:49:54.375006] [fujitsu] connect_fd: finish
[13:49:54.375093] [fujitsu] sane_get_devices: looking for 'usb 0x04c5 0x132c'
... many 'usb 0x04c5 0x1***'
[13:49:54.378605] [fujitsu] sane_get_devices: looking for 'usb 0x04c5 0x160b'
[13:49:54.378724] [fujitsu] sane_get_devices: found 0 scanner(s)
[13:49:54.378809] [fujitsu] sane_get_devices: finish

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).
[13:49:56.842368] [fujitsu] sane_exit: start
[13:49:56.842498] [fujitsu] sane_exit: finish
$ SANE_USB_WORKAROUND=1 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).

Now with sudo:

$ sudo SANE_DEBUG_FUJITSU=15 scanimage -L
[11:49:00.589654] [sanei_debug] Setting debug level of fujitsu to 15.
[11:49:00.589850] [fujitsu] sane_init: start
[11:49:00.589909] [fujitsu] sane_init: fujitsu backend 1.0.136, from sane-backends 1.0.31-debian
[11:49:00.589969] [fujitsu] sane_init: finish
[11:49:00.590022] [fujitsu] sane_get_devices: start
[11:49:00.590718] [fujitsu] sane_get_devices: reading config file fujitsu.conf
[11:49:00.590815] [fujitsu] sane_get_devices: setting "buffer-size" to 65536
[11:49:00.590878] [fujitsu] sane_get_devices: looking for 'scsi FUJITSU'
[11:49:00.591023] [fujitsu] sane_get_devices: looking for 'usb 0x04c5 0x1041'
... many 'usb 0x04c5 0x1***'
[11:49:00.592099] [fujitsu] sane_get_devices: looking for 'usb 0x04c5 0x114a'
[11:49:00.592161] [fujitsu] sane_get_devices: config option "buffer-size" (262144) is > 65536, warning!
[11:49:00.592215] [fujitsu] sane_get_devices: setting "buffer-size" to 262144
[11:49:00.592271] [fujitsu] sane_get_devices: looking for 'usb 0x04c5 0x114d'
... many 'usb 0x04c5 0x1***'
[11:49:00.593516] [fujitsu] sane_get_devices: looking for 'usb 0x04c5 0x132b'
[11:49:00.593573] [fujitsu] attach_one: start
[11:49:00.593628] [fujitsu] attach_one: looking for 'libusb:001:004'
[11:49:00.593688] [fujitsu] connect_fd: start
[11:49:00.593741] [fujitsu] connect_fd: opening USB device
[11:49:00.593974] [fujitsu] connect_fd: could not open device: 3
[11:49:00.594033] [fujitsu] connect_fd: finish
[11:49:00.594088] [fujitsu] sane_get_devices: looking for 'usb 0x04c5 0x132c'
... many 'usb 0x04c5 0x1***'
[11:49:00.596646] [fujitsu] sane_get_devices: looking for 'usb 0x04c5 0x160b'
[11:49:00.596733] [fujitsu] sane_get_devices: found 0 scanner(s)
[11:49:00.596791] [fujitsu] sane_get_devices: finish

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).
[11:49:03.108786] [fujitsu] sane_exit: start
[11:49:03.108919] [fujitsu] sane_exit: finish

After installing lsof via apt-get I have these following results. There is no difference with or without sudo. The other number (1, 2, 3, 5) give no response.

$ sudo lsof /dev/bus/usb/001/004
lsof: status error on /dev/bus/usb/001/004: No such file or directory
lsof 4.93.2
 latest revision: https://github.com/lsof-org/lsof
 latest FAQ: https://github.com/lsof-org/lsof/blob/master/00FAQ
 latest (non-formatted) man page: https://github.com/lsof-org/lsof/blob/master/Lsof.8
 usage: [-?abhKlnNoOPRtUvVX] [+|-c c] [+|-d s] [+D D] [+|-E] [+|-e s] [+|-f[gG]]
 [-F [f]] [-g [s]] [-i [i]] [+|-L [l]] [+m [m]] [+|-M] [-o [o]] [-p s]
 [+|-r [t]] [-s [p:s]] [-S [t]] [-T [t]] [-u s] [+|-w] [-x [fl]] [--] [names]

Here is the result of a different USB cable and the old cable at different ports.

$ sudo lsof /dev/bus/usb/001/006
COMMAND PID  USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
scanbd  418 saned    9u   CHR  189,5      0t0  424 /dev/bus/usb/001/006
$ sudo lsof /dev/bus/usb/001/008
COMMAND PID  USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
scanbd  418 saned    9u   CHR  189,7      0t0  428 /dev/bus/usb/001/008

However, the debug print and workaround return the same results.

18
  • Are the sane-backends installed? Does /etc/sane.d/fujitsu.conf contain the line usb 0x04c5 0x132b (should be in a normal distribution)? What happens if you add usb 0x0424 0xec00 to that file? Nov 13, 2021 at 12:58
  • 1
    and also SANE_DEBUG_DLL=128 scanimage -L 2>&1 | grep -i fuj? (add the answer to your question) Nov 13, 2021 at 17:14
  • 1
    That means that the fujitsu-backend (needed for this scanner) works, but it cannot recognize the scanner. Next step would be to see what the Fujitsu-backend sees at the problem. Try SANE_DEBUG_FUJITSU=15 scanimage -L. This will produce a lot of output. We're interested in the part that follows [fujitsu] sane_get_devices: looking for 'usb 0x04c5 0x132b'; you can drop anything before that. Nov 14, 2021 at 12:18
  • 1
    You'll need to re-check the scanner-ID if lsof cannot find it. The 001/004 came from the 'libusb:001:004' in the scanimage -L output. Been searching a bit, but it looks more and more like an USB issue. Try different cables, without, or with hub, other USB ports. Nov 16, 2021 at 15:05
  • 1
    Been away a bit, sorry. Your usb-device is locked by scanbd, and that seems the reason that scanimage cannot open it. Try sudo systemctl stop scanbd before scanning with scanimage. Nov 29, 2021 at 9:56

1 Answer 1

1

We used the following method to search for the problem.

Step 1: verify, that the back-end is installed and enabled. In this case, the scanner was found by sudo sane-find-scanner. The venor an product ID were present in /etc/sane.d/fujitsu.conf, which is the config file for the applicable backend.

Step 2: The correct backend is tested during start-up. We verified this with SANE_DEBUG_DLL=128 scanimage -L 2>&1 | grep -i fuj

Step 3: Check why the Fujitsu backend failed to recognize the scanner with SANE_DEBUG_FUJITSU=15 scanimage -L. This produced a lot of output, but the most important part was:

[11:49:00.593516] [fujitsu] sane_get_devices: looking for 'usb 0x04c5 0x132b'
[11:49:00.593573] [fujitsu] attach_one: start
[11:49:00.593628] [fujitsu] attach_one: looking for 'libusb:001:004'
[11:49:00.593688] [fujitsu] connect_fd: start
[11:49:00.593741] [fujitsu] connect_fd: opening USB device
[11:49:00.593974] [fujitsu] connect_fd: could not open device: 3
[11:49:00.594033] [fujitsu] connect_fd: finish

The backend could not open the device for some reason. Most of the times, this is a permission problem, but here, the problem also manifested when scanning as root. It might be, that a different process is holding the device.

Step 4: Is there some process that is holding the device? With sudo lsof /dev/bus/usb/001/006 (the scanner was device 6 on bus 1. which can be found with lsusb). The output revealed that

COMMAND PID  USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
scanbd  418 saned    9u   CHR  189,5      0t0  424 /dev/bus/usb/001/006

the process scanbd is holding the device. Killing scanbd freed the scanner and scanimage was able to provide a scan.

On a system with a properly configured scanbd, it should be possible to scan with scanimage using the net-backend. I have never tried this though.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.