Comment on page
9.6.图像扫描仪
在尝试配置之前,检查扫描仪是否受 SANE 支持是很重要的。
将扫描仪连接后,运行以下命令以获取所有连接的 USB 设备:
# usbconfig list
输出应该类似于以下内容:
ugen4.2: <LITE-ON Technology USB NetVista Full Width Keyboard.> at usbus4, cfg=0 md=HOST spd=LOW (1.5Mbps) pwr=ON (70mA)
ugen4.3: <Logitech USB Optical Mouse> at usbus4, cfg=0 md=HOST spd=LOW (1.5Mbps) pwr=ON (100mA)
ugen3.2: <HP Deskjet 1050 J410 series> at usbus3, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON (2mA)
运行以下命令以获取
idVendor
和 idProduct
:# usbconfig -d 3.2 dump_device_desc
注意请注意,扫描仪是即插即用设备,更改连接的 USB 端口将更改usbconfig list
的输出。 输出应该类似于以下内容:
ugen3.2: <HP Deskjet 1050 J410 series> at usbus3, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON (2mA)
bLength = 0x0012
bDescriptorType = 0x0001
bcdUSB = 0x0200
bDeviceClass = 0x0000 <Probed by interface class>
bDeviceSubClass = 0x0000
bDeviceProtocol = 0x0000
bMaxPacketSize0 = 0x0040
idVendor = 0x03f0
idProduct = 0x8911
bcdDevice = 0x0100
iManufacturer = 0x0001 <HP>
iProduct = 0x0002 <Deskjet 1050 J410 series>
bNumConfigurations = 0x0001
# pkg install sane-backends
技巧
将以下内容添加到 /usr/local/etc/devd/saned.conf 以创建
saned.conf
文件:notify 100 {
match "system" "USB";
match "subsystem" "INTERFACE";
match "type" "ATTACH";
match "cdev" "ugen[0-9].[0-9]";
match "vendor" "0x03f0"; ①
match "product" "0x8911"; ②
action "chown -L cups:saned /dev/\$cdev && chmod -L 660 /dev/\$cdev";
};
①
vendor
:是通过运行 usbconfig -d 3.2 dump_device_desc
命令获取的 idVendor。②
product
:是通过运行 usbconfig -d 3.2 dump_device_desc
命令获取的 idProduct。# service devd restart
# scanimage -L
输出应该类似于以下内容:
device `hpaio:/usb/Deskjet_1050_J410_series?serial=XXXXXXXXXXXXXX' is a Hewlett-Packard Deskjet_1050_J410_series all-in-one
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).
要激活服务并使其在启动时运行,请执行以下命令:
# sysrc saned_enable="YES