1

I have a smart card reader called SK-284. It support two communication methods, RS232 and USB. In my case only USB is enable. When I connect this device to my Linux laptop, via USB, It wont get detected. I run '$dmesg' command to check on which ttyUSB port it get detected, I got following output,

[ 2321.208330] usb 2-1.2: new full-speed USB device number 7 using ehci_hcd
[ 2321.384628] generic-usb 0003:8203:8288.0003: hiddev0,hidraw1: USB HID v1.10 Device [\xffffffe6\xffffffb7\xffffffb1\xffffffb7\xffffffb1\xffffffe5\xffffff9c\xffffffb3\xffffff9c\xffffffb3\xffffffe5\xffffff88\xffffff9b\xffffff88\xffffff9b\xffffffe8\xffffff87\xffffffaa\xffffff87\xffffffaa\xffffffe6\xffffff8a\xffffff80\xffffff8a\xffffff80\xffffffe6\xffffff9c\xffffffaf\xffffff9c\xffffffaf\xffffffe6\xffffff9c\xffffff89\xffffff9c\xffffff89\xffffffe9\xffffff99\xffffff90\xffffff99\xffffff90\xffffffe5\xffffff85\xffffffac\xffffff85\xffffffac\xffffffe5\xffffff8f\xffffffb8\xffffff8f\xffffffb8 CRT450  USB 1.1] on usb-0000:00:1d.0-1.2/input0
[ 2326.634925] usb 2-1.2: USB disconnect, device number 7
[ 2326.855479] usb 2-1.2: new full-speed USB device number 8 using ehci_hcd
[ 2326.954303] usb 2-1.2: config index 0 descriptor too short (expected 9, got 0)
[ 2326.954310] usb 2-1.2: can't read configurations, error -22
[ 2327.027211] usb 2-1.2: new full-speed USB device number 9 using ehci_hcd
[ 2327.171371] generic-usb 0003:CEA0:2840.0004: hiddev0,hidraw1: USB HID v1.10 Device [\xffffffe6\xffffffb7\xffffffb1\xffffffb7\xffffffb1\xffffffe5\xffffff9c\xffffffb3\xffffff9c\xffffffb3\xffffffe5\xffffff88\xffffff9b\xffffff88\xffffff9b\xffffffe8\xffffff87\xffffffaa\xffffff87\xffffffaa\xffffffe6\xffffff8a\xffffff80\xffffff8a\xffffff80\xffffffe6\xffffff9c\xffffffaf\xffffff9c\xffffffaf\xffffffe6\xffffff9c\xffffff89\xffffff9c\xffffff89\xffffffe9\xffffff99\xffffff90\xffffff99\xffffff90\xffffffe5\xffffff85\xffffffac\xffffff85\xffffffac\xffffffe5\xffffff8f\xffffffb8\xffffff8f\xffffffb8 CRT284 USB 1.1] on usb-0000:00:1d.0-1.2/input0

My laptop specification: OS: Ubuntu 12.04 Kernel: 3.2.0-54-generic-pae

When I connect same device to Windows 7 and run device manager, It got detected under Human Interface Device (HID). and some test applications are running fine.

My task is to write a small code on Linux to detect the smart card by device. So where do I get to know on which ttyUSB port is used by this device, or any other method to get connected to this device.

Thanks in advance.

4

1 回答 1

0

您可以尝试更改 usbcore 模块中的一些参数:

echo y > /sys/module/usbcore/parameters/old_scheme_first

然后重新插入你的USB设备。

由于它是全速设备(不是高速),您也可以这样做:

rmmod ehci-hcd
insmod uhci-hcd
insmod ohci-hcd

好像usb通讯有问题。可能在 usb-device 端,因为 usb-host 需要 9 个字节,但 usb-device 发送 0 个字节。

于 2013-10-19T08:44:08.213 回答