2017-04-06 59 views
0

我正嘗試使用USB串行連接與GBA ST2 Bill Validator進行通信。一切正常工作在Windows(該設備然後連接到COM端口),但不是在Linux上(到目前爲止與Ubuntu 14.04,16.04和Debian 8)。USB串行通信在Linux上不起作用(Bill Validator GBA ST2)

默認情況下,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 VM(VirtualBox虛擬託管在Windows上) ,但不是在普通的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 [email protected] 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下該設備進行通信?任何想法將不勝感激。

+0

Stack Overflow是編程和開發問題的網站。這個問題似乎與題目無關,因爲它不涉及編程或開發。請參閱幫助中心的[我可以詢問哪些主題](http://stackoverflow.com/help/on-topic)。也許[超級用戶](http://superuser.com/)或[Unix&Linux堆棧交換](http://unix.stackexchange.com/)會是一個更好的地方。另請參閱[我在哪裏發佈有關Dev Ops的問題?](http://meta.stackexchange.com/q/134306) – jww

+0

我問自己同樣的問題。我選擇最後在這裏發佈我的問題,因爲這個問題可能與程序方面有關(如使用的驅動程序)。我會嘗試另一個更合適的地方。 –

回答

0

取決於什麼協議的紙幣識別器使用的時刻,根據http://www.intelligentvending.co.uk/payment-systems-telemetry/banknote-readers-note-stackers/gba-st2.htm它能夠在ccTalkMDB,溝通並行脈衝串行SSP

您可以使用socat與CDC ACM設備進行通信。使用socat發送AT命令的例子是https://unix.stackexchange.com/questions/97242/how-to-send-at-commands-to-a-modem-in-linux

socat建立你有什麼命令序列發送連接取決於紙幣鑑別本協議......