除非 sudo'ed,否则 scanimage 不会找到扫描仪,但会显示 sane-find-scanner (Raspbian)

use*_*411 8 debian sane scanner raspbian

我有一个连接到运行最新 Raspbian 的 Raspberry Pi 的 Epson 多功能设备。正如您在下面的输出中看到的那样,如果我使用 sudo,scanimage 只会找到我的扫描仪,但 sane-find 扫描仪在没有 sudo 的情况下也能找到它。我已经检查过设备权限设置是否正确...... saned 是 lp 组的成员,它是 USB 设备的组。是什么赋予了?

richard@raspberrypi ~ $ scanimage > image.pnm
scanimage: no SANE devices found

richard@raspberrypi ~ $ sane-find-scanner

...

found USB scanner (vendor=0x04b8, product=0x0839) at libusb:001:004
found USB scanner (vendor=0x0424, product=0xec00) at libusb:001:003

...

richard@raspberrypi ~ $ sudo scanimage > image.pnm

richard@raspberrypi ~ $ sudo su -s /bin/bash - saned
X11 connection rejected because of wrong authentication.
No directory, logging in with HOME=/

saned@raspberrypi:/$ lsusb
Bus 001 Device 002: ID 0424:9512 Standard Microsystems Corp. 
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. 
Bus 001 Device 004: ID 04b8:0839 Seiko Epson Corp. CX8300/CX8400/DX8400

saned@raspberrypi:/$ ls -l /dev/bus/usb/001
total 0
crw-rw-r-T  1 root root 189, 0 Feb 12 02:23 001
crw-rw-r-T  1 root root 189, 1 Jan  1  1970 002
crw-rw-r-T  1 root root 189, 2 Jan  1  1970 003
crw-rw-r--+ 1 root lp   189, 3 Feb 12 02:24 004

saned@raspberrypi:/$ groups
saned lp scanner
Run Code Online (Sandbox Code Playgroud)

use*_*411 6

解决了我的问题,感谢在这里找到的教程:

http://www.johndstech.com/2016/linux/raspberry-pi/geek-friday-setting-up-epson-scanning-on-raspberry-pi/

我不得不创建 /etc/udev/rules.d/55-libsane.rules 说:

SYSFS{idVendor}=="04b8", MODE="0666", GROUP="scanner", ENV{libsane_matched}="yes"
Run Code Online (Sandbox Code Playgroud)

和 /etc/saned/epson2.conf 以反映供应商和产品 ID:

usb <0x04b8> <0x0839>
Run Code Online (Sandbox Code Playgroud)