0

我正在尝试使用连接到运行 DietPi 8.1.2 的 pi zero w 的 Canon CanoScan LiDE 110 设置扫描站。最初我saned跑步并且效果很好。

scanimage -L列出了我的扫描仪,我能够使用 xsane 从联网系统进行扫描。

我决定尝试使用scanbd扫描仪上的按钮使扫描更容易。

在此处此处关注文档

我安装了 scanbd 包,

将原始配置复制到 /etc/scanbd/sane.d

root@cscan:/etc/scanbd/sane.d# egrep -v '^#|^$' {dll,net}.conf
dll.conf:genesys

为良好的措施创建了一个符号链接

root@cscan:/var/log# ls -la /usr/local/etc/scanbd
lrwxrwxrwx 1 root root 12 Feb  7 08:53 /usr/local/etc/scanbd -> /etc/scanbd/

修改了现有的 saned 配置以指向 net only 和 localhost,这样它就不会尝试直接连接到扫描仪,

root@cscan:/etc/sane.d# egrep -v '^#|^$' {net,dll}.conf
net.conf: connect_timeout = 3
net.conf: localhost
dll.conf:net

启用并启动 systemd 的东西

root@cscan:/var/log# systemctl status {scanbd,scanbm.socket}
? scanbd.service - Scanner button polling Service
   Loaded: loaded (/lib/systemd/system/scanbd.service; enabled; vendor preset: enabled)
   Active: active (running) since Mon 2022-02-07 08:53:41 EST; 36min ago
 Main PID: 2438 (scanbd)
    Tasks: 5 (limit: 991)
   CGroup: /system.slice/scanbd.service
           ??2438 /usr/sbin/scanbd -f -c /etc/scanbd/scanbd.conf

Feb 07 08:53:41 cscan systemd[1]: Started Scanner button polling Service.
Feb 07 08:53:41 cscan scanbd[2438]: /usr/sbin/scanbd: dbus match type='signal',interface='or
g.freedesktop.Hal.Manager'
Feb 07 08:57:59 cscan scanbd[2438]: /usr/sbin/scanbd: trigger action for scan for device gen
esys:libusb:001:003 with script test.script
Feb 07 08:58:00 cscan scanbd[2475]: /usr/share/scanbd/scripts/test.script: Begin of scan for
 device genesys:libusb:001:003
Feb 07 08:58:00 cscan scanbd[2478]: /usr/share/scanbd/scripts/test.script: End   of scan for
 device genesys:libusb:001:003

? scanbm.socket - scanbd/saned incoming socket
   Loaded: loaded (/lib/systemd/system/scanbm.socket; enabled; vendor preset: enabled)
   Active: active (listening) since Mon 2022-02-07 08:53:49 EST; 36min ago
   Listen: [::]:6566 (Stream)
 Accepted: 5; Connected: 0;
    Tasks: 0 (limit: 991)
   CGroup: /system.slice/scanbm.socket

Feb 07 08:53:49 cscan systemd[1]: Listening on scanbd/saned incoming socket.

似乎扫描按钮正在按预期启动 test.script(见上文),但 scanbd -f 似乎没有连接到我的扫描仪。

root@cscan:/etc/scanbd# scanbd -d7 -f
scanbd: foreground
scanbd: reading config file /etc/scanbd/scanbd.conf
scanbd: debug on: level: 7
scanbd: dropping privs to uid saned
scanbd: dropping privs to gid scanner
scanbd: group scanner has member:
scanbd: saned
scanbd: drop privileges to gid: 115
scanbd: Running as effective gid 115
scanbd: drop privileges to uid: 108
scanbd: Running as effective uid 108
scanbd: dbus_init
scanbd: dbus match type='signal',interface='org.freedesktop.Hal.Manager'
scanbd: SANE_CONFIG_DIR not set
scanbd: sane version 1.0
scanbd: Scanning for local-only devices
scanbd: start_sane_threads
scanbd: no devices, not starting any polling thread
scanbd: start dbus thread
scanbd: Not Primary Owner (2)
scanbd: udev init
scanbd: get udev monitor
scanbd: udev fd is non-blocking, now setting to blocking mode
scanbd: start udev thread
scanbd: timeout: 500 ms
scanbd: Iteration on dbus call
scanbd: udev thread started
scanbd: Iteration on dbus call

SANE_CONFIG_DIR 变量似乎在 scanbd.conf 中定义

root@cscan:/etc/scanbd# grep -r SANE_CONFIG_DIR
scanbd.conf:            saned_env  = { "SANE_CONFIG_DIR=/etc/scanbd" } # list of environment vars for saned

而且, scanimage -L 确实可以在本地工作,但不能在远程工作

root@cscan:~# scanimage -L
device `net:localhost:genesys:libusb:001:002' is a Canon LiDE 110 flatbed scanner

user@desktop:/etc/sane.d $ 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).

在这一点上,我已经没有想法了。有没有人可以帮助我解决这个问题?我的最终目标是能够通过saned使用 xsane 和 saneTwain 进行网络扫描,并使用前面板按钮来执行脚本魔术。

4

0 回答 0