rfid_app icon indicating copy to clipboard operation
rfid_app copied to clipboard

libusb_set_configuration error -6

Open ghost opened this issue 6 years ago • 7 comments

I'm trying to read/write a chinese "203-ID-RW" device. The lsusb -v output is the same of what reported in the idrw_linux.c file.

This is the dmesg output:

[  602.657079] usb 1-1.3: new full-speed USB device number 8 using dwc_otg
[  602.844249] usb 1-1.3: New USB device found, idVendor=6688, idProduct=6850
[  602.844265] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  602.844274] usb 1-1.3: Product: 203-ID-RW
[  602.844282] usb 1-1.3: Manufacturer: CTX
[  602.883640] hid-generic 0003:6688:6850.0004: hiddev96,hidraw0: USB HID v1.10 Device [CTX 203-ID-RW] on usb-3f980000.usb-1.3/input0

Here the output of your program:

# ./idrw_linux -v -r
Successfully found the RFID R/W device
libusb_set_configuration error -6

and here some further output in dmesg;

[ 608.765459] usb 1-1.3: usbfs: interface 0 claimed by usbhid while 'idrw_linux' sets config #1

Even issuying lsusb -v does nothing. I tried also as a root. Is there something I could try to do?

UPDATE: Just to be sure, I tried to exclude usbhid using this rule:

SUBSYSTEMS=="usb", DRIVERS=="usbhid", ACTION=="add", ATTR{authorized}="0"

now the error is different:

Successfully found the RFID R/W device
libusb_claim_interface error -4

ghost avatar Jan 04 '19 10:01 ghost

I have no direct idea what to do. Maybe unload the usbhid module before.

merbanan avatar Apr 25 '19 08:04 merbanan

Try to check if the following udev rules has been installed:

ATTR{idVendor}=="6688", ATTR{idProduct}=="6850", MODE="664", GROUP="plugdev"

And your user must be in plugdev group

667bdrm avatar Apr 25 '19 16:04 667bdrm

I've the same issue about :

./idrw_linux -v -r
Successfully found the RFID R/W device
libusb_set_configuration error -6

Even if I copy the 20-rwrfid.rules in /dev/udev/rules.d and restart it... ( "lsusb" is showing the device properly ... )

The "dmesg" related output is :

[1748531.170474] usb 7-1: new full-speed USB device number 9 using ohci-platform
[1748531.399532] usb 7-1: New USB device found, idVendor=ffff, idProduct=0035, bcdDevice= 1.00
[1748531.399551] usb 7-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[1748531.399564] usb 7-1: Product: IC Reader
[1748531.399575] usb 7-1: Manufacturer: IC Reader
[1748531.399586] usb 7-1: SerialNumber: 08FF20171101
[1748531.418295] input: IC Reader IC Reader as /devices/platform/soc/1c1c400.usb/usb7/7-1/7-1:1.0/0003:FFFF:0035.0008/input/input9
[1748531.476114] hid-generic 0003:FFFF:0035.0008: input,hidraw0: USB HID v1.10 Keyboard [IC Reader IC Reader] on usb-1c1c400.usb-1/input0
[1748531.477869] usbhid 7-1:1.1: couldn't find an input interrupt endpoint
[1748533.962295] usb 7-1: usbfs: interface 0 claimed by usbhid while 'idrw_linux' sets config #1

EDIT : The previous tests are done on my Ubuntu 14.04 desktop, but this morning, I did the same tests on an OrangePiPCPlus with Armbian Stetch Linux 5.1.0-rc7, and the results were exactly the same ...

martinayotte avatar May 03 '19 21:05 martinayotte

Same here. Dmesg:

[512698.471138] usb 3-2.2: new full-speed USB device number 11 using xhci_hcd
[512698.589460] usb 3-2.2: New USB device found, idVendor=6688, idProduct=6850, bcdDevice= 1.01
[512698.589464] usb 3-2.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[512698.589466] usb 3-2.2: Product: 203-ID-RW
[512698.589468] usb 3-2.2: Manufacturer: CTX
[512698.598802] hid-generic 0003:6688:6850.000F: hiddev1,hidraw5: USB HID v1.10 Device [CTX 203-ID-RW] on usb-0000:07:00.0-2.2/input0
[dinux@dinux rfid_app]$ sudo ./rfid_app -l
Error while opening /dev/ttyUSB0

Related with https://github.com/merbanan/rfid_app/issues/14 but tried three different USB ports

Tried this https://github.com/merbanan/rfid_app/issues/3#issuecomment-325515951 Result:

[dinux@dinux rfid_app]$ sudo ./rfid_app -d /dev/bus/usb/003/012 -l
Unknown or no device found:�fPh	)

idrw_linux command returns:

[dinux@dinux rfid_app]$ sudo ./idrw_linux -r
libusb_claim_interface error -4

Windows application works as expected. Link http://download.5yoa.com/IDW02.zip

dinuxlt avatar Jun 05 '19 17:06 dinuxlt

Hi,

I'm having exactly the same issue, using Kali linux. Does anyone know how to disable the lock that hid puts on the device?

OrYaYo avatar Oct 08 '19 09:10 OrYaYo

Try commenting out the libusb_claim_interface call in the code.

merbanan avatar Oct 08 '19 09:10 merbanan

Hi,

When I uncomment the libusb_claim_interface call (the whole section), I get the same error:

./idrw_linux -v -r
Successfully found the RFID R/W device
libusb_set_configuration error -6

If I do what has been mentioned by Mark-81, which is the following:

SUBSYSTEM=="usb", DRIVERS=="usbhid", ACTION=="add", ATTR{authorized}="0"

without removing the libusb_claim_interface call, I would get the error:

Successfully found the RFID R/W device
libusb_claim_interface error -4

This is expected.

When removing the libusb_claim_interface call, I get the follwing error:

# ./idrw_linux -v -r
Successfully found the RFID R/W device
CMD_GET_SNR
CRC_OK = 0x26
Outgoing packet, pkt_pl_unk = 0x08
STX OK 0xaa
ETX OK 0xbb
CMD_GET_SNR: 0x00 0x00

Control Out error -4

I have to say that the compiled binary now waits for the USB device to read the tag, but one the tag is read, it displays the error shown.

Any ideas?

OrYaYo avatar Oct 10 '19 12:10 OrYaYo