RFID card Reader
есть устройство RFID не знаю как называется названия нет, вот похожее на него но собсно суть не в этом, подключается оно по usb.
проблема вот в чем, при подключении устройства оно работает, но коды считывает не стабильно, само по себе перезгружается, выключается вообще, пищит в разные промежутки времени, это происходит до тех пор пока я не дам команду rmmod usbhid, после этого устройство работает прекрасно, поднесли карточку считал айдишник. без глюков, при этом отрубается мышь юсб)) а это как то не хорошо,
сделал вывод парочки команд и понял в чем дело
это когда модуль usbhid подключен
dmesg
[ 4003.140032] usb 7-2: new low speed USB device using uhci_hcd and address 42
[ 4003.297103] usb 7-2: config 1 has an invalid interface number: 1 but max is 0
[ 4003.297110] usb 7-2: config 1 has 2 interfaces, different from the descriptor's value: 1
[ 4003.315106] usb 7-2: string descriptor 0 read error: -32
[ 4003.318684] input: USB HIDBP Keyboard a88a:3005 as /devices/pci0000:00/0000:00:1d.2/usb7/7-2/7-2:1.0/input/input588
[ 4003.540341] input: HID a88a:3005 as /devices/pci0000:00/0000:00:1d.2/usb7/7-2/7-2:1.1/input/input589
[ 4003.540606] generic-usb 0003:A88A:3005.0020: input,hidraw2: USB HID v1.10 Keyboard [HID a88a:3005] on usb-0000:00:1d.2-2/input1
[ 4004.948035] usb 7-2: reset low speed USB device using uhci_hcd and address 42[/glow]
особое внимание строкам
[ 4003.318684] input: USB HIDBP Keyboard a88a:3005 as /devices/pci0000:00/0000:00:1d.2/usb7/7-2/7-2:1.0/input/input588
[ 4003.540341] input: HID a88a:3005 as /devices/pci0000:00/0000:00:1d.2/usb7/7-2/7-2:1.1/input/input589
почему два модуля?
lsusb
Bus 008 Device 003: ID 062a:0000 Creative Labs Optical mouse
Bus 008 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 003: ID 04a9:10d2 Canon, Inc.
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
dmesg | tail
[13335.820042] usb 7-2: device descriptor read/64, error -71
[13336.044053] usb 7-2: device descriptor read/64, error -71
[13336.260048] usb 7-2: new low speed USB device using uhci_hcd and address 70
[13336.380032] usb 7-2: device descriptor read/64, error -71
[13336.604053] usb 7-2: device descriptor read/64, error -71
[13336.820046] usb 7-2: new low speed USB device using uhci_hcd and address 71
[13337.228041] usb 7-2: device not accepting address 71, error -71
[13337.340044] usb 7-2: new low speed USB device using uhci_hcd and address 72
[13337.748044] usb 7-2: device not accepting address 72, error -71
[13337.748068] hub 7-0:1.0: unable to enumerate USB device on port 2
lsusb -t
/: Bus 08.Port 1: Dev 1, Class=root_hub, Driver=uhci_hcd/2p, 12M
|__ Port 1: Dev 2, If 0, Class=HID, Driver=usbhid, 1.5M
/: Bus 07.Port 1: Dev 1, Class=root_hub, Driver=uhci_hcd/2p, 12M
|__ Port 2: Dev 42, If 0, Class=HID, Driver=usbkbd, 1.5M
|__ Port 2: Dev 42, If 1, Class=HID, Driver=usbhid, 1.5M
/: Bus 06.Port 1: Dev 1, Class=root_hub, Driver=uhci_hcd/2p, 12M
/: Bus 05.Port 1: Dev 1, Class=root_hub, Driver=uhci_hcd/2p, 12M
|__ Port 2: Dev 2, If 0, Class=HID, Driver=usbhid, 1.5M
/: Bus 04.Port 1: Dev 1, Class=root_hub, Driver=uhci_hcd/2p, 12M
/: Bus 03.Port 1: Dev 1, Class=root_hub, Driver=uhci_hcd/2p, 12M
/: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=ehci_hcd/8p, 480M
|__ Port 3: Dev 3, If 0, Class=print, Driver=usblp, 480M
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=ehci_hcd/4p, 480M
тут опять же Dev 42 присутствуют оба драйвера hid И kbd
пришел к выводу что при подключении онного устройства используется модуль usbhid, соответственно если его вырубить rmmod usbhid, то устройство начинает работать через модуль usbkbd.
вопрос, как заставить его работать сразу с нужным модулем? не отрубая при этом usbhid
жду советов.)))
Обещаю перейти на генту))))
- Для комментирования войдите или зарегистрируйтесь

есть устройство RFID не знаю
Лучше давайте-ка lsusb -v
Ответ: с помощью правил udev.
lsusb -v Bus 005 Device 001:
lsusb -v
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Device Descriptor: bLength 18 bDescriptorType 1 bcdUSB 1.10 bDeviceClass 9 Hub bDeviceSubClass 0 Unused bDeviceProtocol 0 Full speed (or root) hub bMaxPacketSize0 64 idVendor 0x1d6b Linux Foundation idProduct 0x0001 1.1 root hub bcdDevice 2.06 iManufacturer 3 Linux 2.6.38-8-generic uhci_hcd iProduct 2 UHCI Host Controller iSerial 1 0000:00:1d.3 bNumConfigurations 1 Configuration Descriptor: bLength 9 bDescriptorType 2 wTotalLength 25 bNumInterfaces 1 bConfigurationValue 1 iConfiguration 0 bmAttributes 0xe0 Self Powered Remote Wakeup MaxPower 0mA Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 0 bAlternateSetting 0 bNumEndpoints 1 bInterfaceClass 9 Hub bInterfaceSubClass 0 Unused bInterfaceProtocol 0 Full speed (or root) hub iInterface 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x81 EP 1 IN bmAttributes 3 Transfer Type Interrupt Synch Type None Usage Type Data wMaxPacketSize 0x0002 1x 2 bytes bInterval 255 Hub Descriptor: bLength 9 bDescriptorType 41 nNbrPorts 2 wHubCharacteristic 0x000a No power switching (usb 1.0) Per-port overcurrent protection bPwrOn2PwrGood 1 * 2 milli seconds bHubContrCurrent 0 milli Ampere DeviceRemovable 0x00 PortPwrCtrlMask 0xff Hub Port Status: Port 1: 0000.0100 power Port 2: 0000.0100 power Device Status: 0x0003 Self Powered Remote Wakeup Enabled Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Device Descriptor: bLength 18 bDescriptorType 1 bcdUSB 1.10 bDeviceClass 9 Hub bDeviceSubClass 0 Unused bDeviceProtocol 0 Full speed (or root) hub bMaxPacketSize0 64 idVendor 0x1d6b Linux Foundation idProduct 0x0001 1.1 root hub bcdDevice 2.06 iManufacturer 3 Linux 2.6.38-8-generic uhci_hcd iProduct 2 UHCI Host Controller iSerial 1 0000:00:1d.2 bNumConfigurations 1 Configuration Descriptor: bLength 9 bDescriptorType 2 wTotalLength 25 bNumInterfaces 1 bConfigurationValue 1 iConfiguration 0 bmAttributes 0xe0 Self Powered Remote Wakeup MaxPower 0mA Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 0 bAlternateSetting 0 bNumEndpoints 1 bInterfaceClass 9 Hub bInterfaceSubClass 0 Unused bInterfaceProtocol 0 Full speed (or root) hub iInterface 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x81 EP 1 IN bmAttributes 3 Transfer Type Interrupt Synch Type None Usage Type Data wMaxPacketSize 0x0002 1x 2 bytes bInterval 255 Hub Descriptor: bLength 9 bDescriptorType 41 nNbrPorts 2 wHubCharacteristic 0x000a No power switching (usb 1.0) Per-port overcurrent protection bPwrOn2PwrGood 1 * 2 milli seconds bHubContrCurrent 0 milli Ampere DeviceRemovable 0x00 PortPwrCtrlMask 0xff Hub Port Status: Port 1: 0000.0100 power Port 2: 0000.0100 power Device Status: 0x0003 Self Powered Remote Wakeup Enabled Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Device Descriptor: bLength 18 bDescriptorType 1 bcdUSB 1.10 bDeviceClass 9 Hub bDeviceSubClass 0 Unused bDeviceProtocol 0 Full speed (or root) hub bMaxPacketSize0 64 idVendor 0x1d6b Linux Foundation idProduct 0x0001 1.1 root hub bcdDevice 2.06 iManufacturer 3 Linux 2.6.38-8-generic uhci_hcd iProduct 2 UHCI Host Controller iSerial 1 0000:00:1d.1 bNumConfigurations 1 Configuration Descriptor: bLength 9 bDescriptorType 2 wTotalLength 25 bNumInterfaces 1 bConfigurationValue 1 iConfiguration 0 bmAttributes 0xe0 Self Powered Remote Wakeup MaxPower 0mA Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 0 bAlternateSetting 0 bNumEndpoints 1 bInterfaceClass 9 Hub bInterfaceSubClass 0 Unused bInterfaceProtocol 0 Full speed (or root) hub iInterface 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x81 EP 1 IN bmAttributes 3 Transfer Type Interrupt Synch Type None Usage Type Data wMaxPacketSize 0x0002 1x 2 bytes bInterval 255 Hub Descriptor: bLength 9 bDescriptorType 41 nNbrPorts 2 wHubCharacteristic 0x000a No power switching (usb 1.0) Per-port overcurrent protection bPwrOn2PwrGood 1 * 2 milli seconds bHubContrCurrent 0 milli Ampere DeviceRemovable 0x00 PortPwrCtrlMask 0xff Hub Port Status: Port 1: 0000.0100 power Port 2: 0000.0100 power Device Status: 0x0003 Self Powered Remote Wakeup Enabled Bus 002 Device 003: ID a88a:3005 Device Descriptor: bLength 18 bDescriptorType 1 bcdUSB 1.10 bDeviceClass 0 (Defined at Interface level) bDeviceSubClass 0 bDeviceProtocol 0 bMaxPacketSize0 8 idVendor 0xa88a idProduct 0x3005 bcdDevice 1.10 iManufacturer 1 iProduct 2 iSerial 0 bNumConfigurations 1 Configuration Descriptor: bLength 9 bDescriptorType 2 wTotalLength 59 bNumInterfaces 1 bConfigurationValue 1 iConfiguration 0 bmAttributes 0xa0 (Bus Powered) Remote Wakeup MaxPower 100mA Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 0 bAlternateSetting 0 bNumEndpoints 1 bInterfaceClass 3 Human Interface Device bInterfaceSubClass 1 Boot Interface Subclass bInterfaceProtocol 1 Keyboard iInterface 0 HID Device Descriptor: bLength 9 bDescriptorType 33 bcdHID 1.10 bCountryCode 33 US bNumDescriptors 1 bDescriptorType 34 Report wDescriptorLength 65 Report Descriptors: ** UNAVAILABLE ** Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x81 EP 1 IN bmAttributes 3 Transfer Type Interrupt Synch Type None Usage Type Data wMaxPacketSize 0x0008 1x 8 bytes bInterval 10 Device Status: 0x0000 (Bus Powered) Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Device Descriptor: bLength 18 bDescriptorType 1 bcdUSB 1.10 bDeviceClass 9 Hub bDeviceSubClass 0 Unused bDeviceProtocol 0 Full speed (or root) hub bMaxPacketSize0 64 idVendor 0x1d6b Linux Foundation idProduct 0x0001 1.1 root hub bcdDevice 2.06 iManufacturer 3 Linux 2.6.38-8-generic uhci_hcd iProduct 2 UHCI Host Controller iSerial 1 0000:00:1d.0 bNumConfigurations 1 Configuration Descriptor: bLength 9 bDescriptorType 2 wTotalLength 25 bNumInterfaces 1 bConfigurationValue 1 iConfiguration 0 bmAttributes 0xe0 Self Powered Remote Wakeup MaxPower 0mA Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 0 bAlternateSetting 0 bNumEndpoints 1 bInterfaceClass 9 Hub bInterfaceSubClass 0 Unused bInterfaceProtocol 0 Full speed (or root) hub iInterface 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x81 EP 1 IN bmAttributes 3 Transfer Type Interrupt Synch Type None Usage Type Data wMaxPacketSize 0x0002 1x 2 bytes bInterval 255 Hub Descriptor: bLength 9 bDescriptorType 41 nNbrPorts 2 wHubCharacteristic 0x000a No power switching (usb 1.0) Per-port overcurrent protection bPwrOn2PwrGood 1 * 2 milli seconds bHubContrCurrent 0 milli Ampere DeviceRemovable 0x00 PortPwrCtrlMask 0xff Hub Port Status: Port 1: 0000.0100 power Port 2: 0000.0303 lowspeed power enable connect Device Status: 0x0003 Self Powered Remote Wakeup Enabled Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Device Descriptor: bLength 18 bDescriptorType 1 bcdUSB 2.00 bDeviceClass 9 Hub bDeviceSubClass 0 Unused bDeviceProtocol 0 Full speed (or root) hub bMaxPacketSize0 64 idVendor 0x1d6b Linux Foundation idProduct 0x0002 2.0 root hub bcdDevice 2.06 iManufacturer 3 Linux 2.6.38-8-generic ehci_hcd iProduct 2 EHCI Host Controller iSerial 1 0000:00:1d.7 bNumConfigurations 1 Configuration Descriptor: bLength 9 bDescriptorType 2 wTotalLength 25 bNumInterfaces 1 bConfigurationValue 1 iConfiguration 0 bmAttributes 0xe0 Self Powered Remote Wakeup MaxPower 0mA Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 0 bAlternateSetting 0 bNumEndpoints 1 bInterfaceClass 9 Hub bInterfaceSubClass 0 Unused bInterfaceProtocol 0 Full speed (or root) hub iInterface 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x81 EP 1 IN bmAttributes 3 Transfer Type Interrupt Synch Type None Usage Type Data wMaxPacketSize 0x0004 1x 4 bytes bInterval 12 Hub Descriptor: bLength 11 bDescriptorType 41 nNbrPorts 8 wHubCharacteristic 0x000a No power switching (usb 1.0) Per-port overcurrent protection bPwrOn2PwrGood 10 * 2 milli seconds bHubContrCurrent 0 milli Ampere DeviceRemovable 0x00 0x00 PortPwrCtrlMask 0xff 0xff Hub Port Status: Port 1: 0000.0100 power Port 2: 0000.0100 power Port 3: 0000.0100 power Port 4: 0000.0100 power Port 5: 0000.0100 power Port 6: 0000.0100 power Port 7: 0000.0100 power Port 8: 0000.0100 power Device Status: 0x0003 Self Powered Remote Wakeup EnabledА где именно? в каком файле? нашел только как изменить имя девайса в /dev, даже не стал пробовать, т.к какой толк от того что имя поменяется
Demolitionman
Судя по VID:PID с этой махровой китайщиной никто в интернете не сталкивался...
Правила udev помещаются в /etc/udev/rules.d/ название файла начинается с двух цифр, которые обозначают порядок применения правил. Что и как писать в правилах — можно найти в man udev, и в интернете. После добавления правил необходимо дать команду перечитать правила: udevadm control --reload-rules, а проследить, правильно ли выполняется правило можно с помощью udevadm monitor (посмотрите man udevadm чтобы узнать значение различных опций). Следует помнить, что лучше обращаться к /sys/bus/usb/devices/.../driver/unbind, чем к /proc/bus (которого в убунте по умолчанию нет)...
P.S. Судя по всему прошивка устройства сделана несколько коряво, или плохо работает с данным хабом, о чём свидетельствуют ошибки чтения дескрипторов интерфейсов. Лучше всего посмотреть с помощью USB-сниффера как это устройство работает с родными драйверами от производителя, и попытаться исправить ситуацию в линуксе.
Попробуй воспользоваться этим
Попробуй воспользоваться этим советом:
Подсмотрел тут: http://www.linuxquestions.org/questions/programming-9/driver-development-usbhid-is-blocking-custom-device-driver-850287/
Огромное Спасибо, это
Огромное Спасибо, это помогло. usbhid отстал от моего ридера, а на его место встал usbkbd.
вот только если честно я не понял в чем суть, если можно объясните пожалуйста, а то как то в неведении ходить не охото, вдруг в будущем опять пригадится.
И еще, как бы это все автоматизировать? т.е после ребута системы приходится опять тоже самое вводить.
Ну так суть в том и состоит,
Ну так суть в том и состоит, чтобы сказать модулю usbhid не использовать данное устройство. Если номер вида
2-3:1.0для данного устройства остается постоянным, можно просто прописать вышеуказанную команду в/etc/local.d/rfid.start. Если нет, придется написать правило для udev, по которому udev запустит скрипт, который определит этот номер. Как — пока сказать не могу. Под рукой нет hid-устройств, чтоб поэкспериментировать. С другой стороны, надо почитать документацию по usbhid: может можно ему через параметры при загрузке указать через vid:pid не подхватывать это устройство.Еще, как вариант, покопаться в исходниках usbhid.
В любом случае, я бы на твоем месте сходил на ядерную багзиллу...