raspberry-pi – 带有QEMU和SANE的Raspberry Pi上的Brother x86扫描仪驱动程序

我有一台Brother 7055打印机/扫描仪和一个Raspberry Pi,我正试图将它们变成打印和扫描服务器.不幸的是,Brother不提供任何ARM驱动程序.我在Raspberry Pi上遇到关于QEMU仿真的this博文,实际上我已经设法使用这种方法安装x86打印机驱动程序,我通过CUPS分享它并且一切都很好.现在我正在尝试使扫描仪正常工作并安装Brother软件没有任何错误但是当我运行scanimage -L时扫描仪没有显示

扫描仪已连接:

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

但是看不到扫描仪:

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确实看到了一些但却无法使它工作,因为兄弟使用它自己的理智驱动程序.

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.

调试scanimage给我以下输出,看起来像兄弟4 lib无法加载:

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

lib文件在那里,但看起来无法打开或访问文件:

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

也许libsane-brother4.so lib的某些依赖项缺失了,但运行objdump -x并查看动态部分会给我以下输出(我对objdump不太熟悉,所以我希望我正确地解释这个):

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

我似乎在我的Pi上有这些库,其中只有一个只能作为ARM版本而不是i386,所有其他都有:

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

但我没有列出我需要的一个库,可能这就是为什么它无法加载:

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

最初borther4 lib位于/usr/lib / sane中,我已将此路径添加到/etc/ld.so.conf.d/libsane-brother.conf并运行sudo ldconfig但我只获得此libsane.so.我签入ldconfig -v时1 lib:

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

无法使libsane-brother.so.1 lib出现在ld缓存中…

更新

它似乎与dlconfig无关,在我的opensuse机器上,扫描仪工作的libsane-brother.so.1 lib没有显示在ldconfig缓存中,就像在Pi上一样,但是加载了lib没有任何问题.

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

正确加载,没有错误:

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

所以现在的问题是为什么Sane无法打开libsane-brother.so.1 lib,即使它在正确的路径中……

注意:直接连接到我的OpenSuse机器并且安装了相同驱动程序的扫描仪确实会在我运行scanimage -L时出现,所以它必须与sane一起工作,这里的onyl问题是Pi.

最佳答案
去年我解决了类似的挑战.在手臂上(与Armbian,Raspian是相同的)我首先在这台机器(mfc 795cw)上帮助qemu打印安装.扫描仪无法正常工作,但有必要在此arm linux上安装失败的扫描驱动程序.对于扫描,我设置了一个chroot环境.您需要一个与Brother Linux Driver相关的Linux版本.因此我使用了Lubuntu 10.04.请注意不要卸载lpr !.你必须在这个chroot环境兄弟linux安装程序中运行.然后打印工作在Linux-Linux中,在chroot i368 Linux中扫描.我设置了一个扫描脚本,使用scanimage启动chroot(挂载-o bind,qemu,….).

转载注明原文:raspberry-pi – 带有QEMU和SANE的Raspberry Pi上的Brother x86扫描仪驱动程序 - 代码日志