我需要能够与USB扫描仪(特别是Epson Perfection V550)连接。我曾尝试ImageScanner,它似乎并没有找到我的设备(我也尝试安装twain,但有说访问USB扫描仪
Could not find any downloads that satisfy the requirement twain.)
所以不是我转身PyUSB,可以看到,设备出现的问题,是有这个问题我现在是,我不知道我需要发送的设备为它扫描和送我回的图片
下面是代码,我已经运行:
import usb.core
import usb.util
import sys
venderID = 0x04B8
productID = 0x013B
dev = usb.core.find(idVendor=venderID, idProduct=productID)
for cfg in dev:
print cfg
和输出到那是:
CONFIGURATION 1: 2 mA ====================================
bLength : 0x9 (9 bytes)
bDescriptorType : 0x2 Configuration
wTotalLength : 0x20 (32 bytes)
bNumInterfaces : 0x1
bConfigurationValue : 0x1
iConfiguration : 0x0
bmAttributes : 0xc0 Self Powered
bMaxPower : 0x1 (2 mA)
INTERFACE 0: Vendor Specific ===========================
bLength : 0x9 (9 bytes)
bDescriptorType : 0x4 Interface
bInterfaceNumber : 0x0
bAlternateSetting : 0x0
bNumEndpoints : 0x2
bInterfaceClass : 0xff Vendor Specific
bInterfaceSubClass : 0xff
bInterfaceProtocol : 0xff
iInterface : 0x0
ENDPOINT 0x81: Bulk IN ===============================
bLength : 0x7 (7 bytes)
bDescriptorType : 0x5 Endpoint
bEndpointAddress : 0x81 IN
bmAttributes : 0x2 Bulk
wMaxPacketSize : 0x200 (512 bytes)
bInterval : 0xff
ENDPOINT 0x2: Bulk OUT ===============================
bLength : 0x7 (7 bytes)
bDescriptorType : 0x5 Endpoint
bEndpointAddress : 0x2 OUT
bmAttributes : 0x2 Bulk
wMaxPacketSize : 0x200 (512 bytes)
bInterval : 0xff
你是明确地试图在代码中做到这一点,或者你会满意与工作的应用程序?我一直很高兴与我的富士通ScanSnap S1500 vuescan。适用于USB扫描仪的Linux和Windows,但可能不是您的。 – hughdbrown
明确地试图用Python做到这一点。我可以通过它附带的默认软件访问扫描器,但这不是此项目的目标。 – NightHallow
PyUSB只允许您访问原始USB描述符/端点。为了让你的扫描仪运行,你必须在Python中实现你自己的驱动程序,这是很多工作。你会更适合试图让TWAIN工作。 – jbaiter