简体   繁体   English

USB串行通信在Linux上不起作用(Bill Validator GBA ST2)

[英]USB-Serial communication not working on Linux (Bill Validator GBA ST2)

I am trying to communicate with a GBA ST2 Bill Validator using a USB-Serial connection. 我正在尝试使用USB串行连接与GBA ST2账单验证器进行通信。 Everything works fine on Windows (the device is then attached to a COM port) but not on Linux (so far with Ubuntu 14.04, 16.04 and Debian 8). 在Windows上一切正常(然后将设备连接到COM端口),但在Linux上一切正常(到目前为止,对于Ubuntu 14.04、16.04和Debian 8)。

By default the cdc_acm drivers are used it is attached to /dev/ttyACMx, but it does not answer any request. 默认情况下,使用cdc_acm驱动程序,该驱动程序附加在/ dev / ttyACMx上,但不回答任何请求。 (However when requested while in sleep mode it wakes up instantly). (但是,当在睡眠模式下被请求时,它会立即唤醒)。

Related output of dmesg and lsusb : dmesglsusb的相关输出:

$ 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

When forcing the device to use the usbserial driver, I was able to use it under a Linux VM (Virtualbox hosted on Windows), but not on a plain Linux machine. 当强制设备使用USB驱动程序时,我可以在Linux VM(Windows上托管的Virtualbox)下使用它,但不能在普通的Linux计算机上使用它。 I used the following commands to use the usbserial driver: 我使用以下命令来使用usbserial驱动程序:

sudo modprobe -r cdc_acm
sudo modprobe usbserial vendor=0x16f9 product=0x0003

Related dmesg and lsusb output: 相关的dmesglsusb输出:

$ 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

How can I communicate with this device under Linux? 在Linux下如何与该设备通信? Any idea would be appreciated. 任何想法将不胜感激。

depends on what protocol the bill validator uses at the moment, according to http://www.intelligentvending.co.uk/payment-systems-telemetry/banknote-readers-note-stackers/gba-st2.htm it is able to communicate over ccTalk , MDB , Parallel , Pulse , Serial , SSP 要看什么协议的纸币识别器使用的时刻,根据http://www.intelligentvending.co.uk/payment-systems-telemetry/banknote-readers-note-stackers/gba-st2.htm它是能够沟通在ccTalk上MDB并行脉冲串行SSP

you can communicate with a CDC ACM device using socat . 您可以使用socat与CDC ACM设备进行通信。 an example for using socat to send AT commands is on https://unix.stackexchange.com/questions/97242/how-to-send-at-commands-to-a-modem-in-linux https://unix.stackexchange.com/questions/97242/how-to-send-at-commands-to-a-modem-in-linux上使用socat发送AT命令的示例

socat establishes the connection what command sequences you have to send depends on the present protocol of the bill validator... socat建立连接,您必须发送的命令序列取决于票据验证器的当前协议...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM