我正试图使用与GBA ST2 Bill进行通信.所有东西在Windows上都能正常工作(然后设备连接到一个COM端口上),但在Linux上就不行了(到目前为止,Ubuntu14.04、16.04和Debian 8)。
默认情况下,使用cdc_acm驱动程序--它附加到/dev/ttyACMx,但它不响应任何请求。(然而,当请求时,在睡眠模式下,它会立即醒来)。
dmesg和lsusb的相关输出
$ dmesg
[26600.821389] usb 2-1: new full-speed USB device number 37 using ohci-pci
[26601.307233] usb 2-1: New USB device found, idVendor=16f9, idProduct=0003
[26601.307237] usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[26601.307239] usb 2-1: Product: GBA ST2
[26601.307240] usb 2-1: Manufacturer: Astrosystems
[26601.307242] usb 2-1: SerialNumber: 06010010001
[26601.316173] cdc_acm 2-1:1.0: ttyACM0: USB ACM device
$ lsusb -t
/: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=ohci-pci/12p, 12M
|__ Port 1: Dev 37, If 0, Class=Communications, Driver=cdc_acm, 12M
|__ Port 1: Dev 37, If 1, Class=CDC Data, Driver=cdc_acm, 12M
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=ehci-pci/12p, 480M当迫使设备使用usbserial驱动程序时,我可以在Linux (托管在Windows上的Virtualbox)下使用它,但不能在普通Linux机器上使用它。我使用了以下命令来使用usbserial驱动程序:
sudo modprobe -r cdc_acm
sudo modprobe usbserial vendor=0x16f9 product=0x0003相关的dmesg和lsusb产出:
$ sudo dmesg
[26022.203166] usbserial: USB Serial support registered for generic
[26022.203188] usbserial_generic 2-1:1.0: Generic device with no bulk out, not allowed.
[26022.206497] usbserial_generic: probe of 2-1:1.0 failed with error -5
[26022.206530] usbserial_generic 2-1:1.1: The "generic" usb-serial driver is only for testing and one-off prototypes.
[26022.206532] usbserial_generic 2-1:1.1: Tell linux-usb@vger.kernel.org to add your device to a proper driver.
[26022.206533] usbserial_generic 2-1:1.1: generic converter detected
[26022.207075] usb 2-1: generic converter now attached to ttyUSB0
lsusb -t
/: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=ohci-pci/12p, 12M
|__ Port 1: Dev 35, If 0, Class=Communications, Driver=, 12M
|__ Port 1: Dev 35, If 1, Class=CDC Data, Driver=usbserial_generic, 12M
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=ehci-pci/12p, 480M如何在Linux下与此设备通信?任何想法都将不胜感激。
发布于 2017-04-06 17:07:24
这取决于账单验证器目前使用的协议,根据http://www.intelligentvending.co.uk/payment-systems-telemetry/banknote-readers-note-stackers/gba-st2.htm,它能够通过ccTalk、MDB、并行、脉冲、串行、SSP进行通信。
您可以使用socat与CDC ACM设备通信。使用socat发送AT命令的示例是在https://unix.stackexchange.com/questions/97242/how-to-send-at-commands-to-a-modem-in-linux上
socat建立连接,您必须发送的命令序列取决于票据验证器的当前协议.
https://stackoverflow.com/questions/43260886
复制相似问题