3

I have a Brother 7055 Printer/Scanner and a Raspberry Pi, I'm trying to turn both into a print and scan server. Unfortunately, Brother doesn't provide any ARM drivers. I run into this blog post about QEMU emulation on the Raspberry Pi and indeed I've managed to install the x86 printer drivers using this approach, I'm sharing it via CUPS and all good. Now I'm trying to make the scanner work and the Brother software is installed without any errors but the scanner doesn't show up when I run scanimage -L

The scanner is connected:

dporobic@raspberrypi:~ $ lsusb
Bus 001 Device 005: ID 04f9:0248 Brother Industries, Ltd DCP-7055 scanner/printer
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp. 
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

But can't see the scanner:

dporobic@raspberrypi:~ $ 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).

sane-find-scanner does see something but can't make it work as brother uses it's own sane drivers.

porobic@raspberrypi:~ $ sudo sane-find-scanner 

  # 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.
  # Also you need support for SCSI Generic (sg) in your operating system.
  # If using Linux, try "modprobe sg".

found USB scanner (vendor=0x04f9, product=0x0248) at libusb:001:005
found USB scanner (vendor=0x0424, product=0xec00) at libusb:001:003
  # Your USB scanner was (probably) detected. It may or may not be supported by
  # SANE. Try scanimage -L and read the backend's manpage.

  # Not checking for parallel port scanners.

  # Most Scanners connected to the parallel port or other proprietary ports
  # can't be detected by this program.

Debugging scanimage gives me following output, it looks like the brother4 lib can't be loaded:

dporobic@raspberrypi:~ $ sudo SANE_DEBUG_DLL=255 scanimage -L
[sanei_debug] Setting debug level of dll to 255.
[dll] sane_init: SANE dll backend version 1.0.13 from sane-backends 1.0.24
[dll] sane_init/read_dlld: attempting to open directory `./dll.d'
[dll] sane_init/read_dlld: attempting to open directory `/etc/sane.d/dll.d'
[dll] sane_init/read_dlld: using config directory `/etc/sane.d/dll.d'
[dll] sane_init/read_dlld: considering /etc/sane.d/dll.d/libsane-extras
[dll] sane_init/read_config: reading dll.d/libsane-extras
[dll] sane_init/read_dlld: done.
[dll] sane_init/read_config: reading dll.conf
[dll] add_backend: adding backend `brother4'
[dll] sane_get_devices
[dll] load: searching backend `brother4' in `/usr/lib/arm-linux-gnueabihf/sane:/usr/lib/sane'
[dll] load: trying to load `/usr/lib/arm-linux-gnueabihf/sane/libsane-brother4.so.1'
[dll] load: dlopen()ing `/usr/lib/arm-linux-gnueabihf/sane/libsane-brother4.so.1'
**[dll] load: dlopen() failed (/usr/lib/arm-linux-gnueabihf/sane/libsane-brother4.so.1: cannot open shared object file: No such file or directory)**
[dll] sane_get_devices: found 0 devices

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).
[dll] sane_exit: exiting
[dll] sane_exit: finished

The lib files are there but it looks like the files can't be opened or accessed:

dporobic@raspberrypi:~ $ ls -l /usr/lib/arm-linux-gnueabihf/sane/ | grep brother
-rwxr-xr-x 1 root root 129696 Jan  8 11:08 libsane-brother4.so
-rwxr-xr-x 1 root root 129696 Jan  8 11:08 libsane-brother4.so.1
-rwxr-xr-x 1 root root 129696 Jan  8 11:08 libsane-brother4.so.1.0.7

Maybe some dependencies of the libsane-brother4.so lib are missing but running objdump -x and looking under the dynamic section gives me following output (I'm not very familiar with objdump so I hope I'm interpreting this correctly):

dporobic@raspberrypi:~ $ objdump -x /usr/lib/arm-linux-gnueabihf/sane/libsane-brother4.so | grep NEEDED
  NEEDED               libpthread.so.0
  NEEDED               libnsl.so.1
  NEEDED               libusb-0.1.so.4
  NEEDED               libm.so.6
  NEEDED               libdl.so.2
  NEEDED               libc.so.6

And I seem to have those libraries on my Pi, only one of those is only available as ARM version and not as i386, all other come in both:

dporobic@raspberrypi:~ $ sudo ldconfig -p | grep -E 'libpthread.so.0|libnsl.so.1|libusb-0.1.so.4|libm.so.6|libdl.so.2|libc.so.6'
        libusb-0.1.so.4 (libc6,hard-float) => /lib/arm-linux-gnueabihf/libusb-0.1.so.4
        libusb-0.1.so.4 (libc6,hard-float) => /usr/lib/arm-linux-gnueabihf/libusb-0.1.so.4
        libpthread.so.0 (libc6,hard-float, OS ABI: Linux 2.6.32) => /lib/arm-linux-gnueabihf/libpthread.so.0
        libpthread.so.0 (libc6, OS ABI: Linux 2.6.32) => /lib/i386-linux-gnu/libpthread.so.0
        libnsl.so.1 (libc6,hard-float, OS ABI: Linux 2.6.32) => /lib/arm-linux-gnueabihf/libnsl.so.1
        libnsl.so.1 (libc6, OS ABI: Linux 2.6.32) => /lib/i386-linux-gnu/libnsl.so.1
        libm.so.6 (libc6,hard-float, OS ABI: Linux 2.6.32) => /lib/arm-linux-gnueabihf/libm.so.6
        libm.so.6 (libc6, OS ABI: Linux 2.6.32) => /lib/i386-linux-gnu/libm.so.6
        libdl.so.2 (libc6,hard-float, OS ABI: Linux 2.6.32) => /lib/arm-linux-gnueabihf/libdl.so.2
        libdl.so.2 (libc6, OS ABI: Linux 2.6.32) => /lib/i386-linux-gnu/libdl.so.2
        libc.so.6 (libc6,hard-float, OS ABI: Linux 2.6.32) => /lib/arm-linux-gnueabihf/libc.so.6
        libc.so.6 (ELF, OS ABI: Linux 2.6.32) => /lib/i386-linux-gnu/libc.so.6

But the one lib that I need is not listed, probably that's why it can't be loaded:

dporobic@raspberrypi:~ $ sudo ldconfig -p | grep libsane-brother4.so
dporobic@raspberrypi:~ $

Originally the borther4 lib was located in /usr/lib/sane, I've added this path to /etc/ld.so.conf.d/libsane-brother.conf and run sudo ldconfig but I only get this libsane.so.1 lib when I check in ldconfig -v:

dporobic@raspberrypi:~ $ sudo ldconfig -v 2>/dev/null | grep brother -B1
/usr/lib/sane:
        libsane.so.1 -> libsane-brother4.so.1.0.7

Can't make the libsane-brother.so.1 lib appear in the ld cache...

Update

It seems to be unrelated to dlconfig, on my opensuse machine where the scanner is working the libsane-brother.so.1 lib is not showing in the ldconfig cache, just like on the Pi but there the lib is loaded without any problem.

dporobic@latitude:~> sudo ldconfig -v 2>/dev/null | grep -E 'sane|brother'
        libksane.so.0 -> libksane.so.0.2.0
        libsane.so.1 -> libsane.so.1.0.24

Loading correctly, no error:

dporobic@latitude:~> sudo SANE_DEBUG_DLL=255 scanimage -L
[sanei_debug] Setting debug level of dll to 255.
[dll] sane_init: SANE dll backend version 1.0.13 from sane-backends 1.0.24
[dll] sane_init/read_dlld: attempting to open directory `./dll.d'
[dll] sane_init/read_dlld: attempting to open directory `/etc/sane.d/dll.d'
[dll] sane_init/read_dlld: opendir failed: No such file or directory
[dll] sane_init/read_config: reading dll.conf
[dll] add_backend: adding backend `brother4'
[dll] sane_get_devices
[dll] load: searching backend `brother4' in `/usr/lib64/sane'
[dll] load: trying to load `/usr/lib64/sane/libsane-brother4.so.1'
**[dll] load: dlopen()ing `/usr/lib64/sane/libsane-brother4.so.1'**
[dll] init: initializing backend `brother4'
[dll] init: backend `brother4' is version 1.0.1
[dll] sane_get_devices: found 1 devices
device `brother4:bus2;dev1' is a Brother DCP-7055 USB scanner
[dll] sane_exit: exiting
[dll] sane_exit: calling backend `brother4's exit function
[dll] sane_exit: finished

So the question is now why Sane can't open libsane-brother.so.1 lib even though it's in the correct path...

Note: The same scanner directly connected to my OpenSuse machine and with same drivers installed does show up when I run scanimage -L so it must be working with sane, the onyl questionable thing here is the Pi.

migrated from superuser.com Jan 10 '17 at 2:45

This question came from our site for computer enthusiasts and power users.

  • I didn't check your qestion exactly, but you may take a lool here: lhinderberger.de/pi/2016/01/27/… – Mohammed Noureldin Jan 9 '17 at 23:24
  • Hey Mohammed, thanks for commenting. This is exactly the link where I got the QEMU emulation from, I have linked it above in my post "I run into this blog post about QEMU...". Unfortunately, Lucas didn't have a scanner, he only had a brother Printer (spoke with him already) and this works so far, even with CUPS, therefor I though eventually this could work with Scanner too. – Damir Porobic Jan 10 '17 at 7:12
  • @DamirPorobic - Did you ever solve this? – Anjan Apr 13 '18 at 12:50
  • I didn't look into this further as I was quite busy but @Dieter had an interesting idea that might be worth trying. – Damir Porobic Apr 15 '18 at 7:51
1

Last year I solved similar challenge. On arm (with Armbian, Raspian is the same) I had first to install with help of qemu printing on this machine (mfc 795cw). Scanner is not working, but it was necessary to install failed scanning Driver on this arm linux. For scanning i set up a chroot environment. You need an Linux-Version which was used at year related to Brother Linux Driver. Therefore I used Lubuntu 10.04. Take care that you do not deinstall lpr!. You have to run in this chroot environment brother linux installer. Printing works then in arm-Linux, scanning in chroot i368 Linux. I set up a script for scanning to start chroot (mounting -o bind, qemu, ....,) using scanimage.

  • That is in interesting idea. do you have more details on how you implemented this? I believe a lot of people would be interested in such a hack. – Damir Porobic Mar 16 '17 at 7:33
0

This is due to the fact that the used sane (armhf) not i383 architecture. If you install sane of architecture i386 you load drivers libsane-brother4.so.1. But at this point I encountered a problem that sane (i386) does not work with libusb (armhf). This is the kernel module rather than the user level. I do not understand how to get around this problem.

  • Probably there is no way passed that but you never know, maybe someone has a good idea or workaround. – Damir Porobic Jan 30 '17 at 18:32
0

This would require qemu system emulation, so probably running e.g. DSL guest with cups and saned sharing usb printer/scanner with host raspbian re-sharing it with the rest of world (or your local network). It's just an idea, I don't know if practical.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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