I found another directory under sys/bus where the device does appear: r...@puigmal:/sys/bus/hid/drivers/generic-usb$ ls 0003:047D:1062.0002 0003:0FDE:CA01.0001 bind module uevent unbind
However, after doing the unbind, libhid returns the same error r...@puigmal:/sys/bus/hid/drivers/generic-usb# echo -n "0003:0FDE:CA01.0001" > unbind r...@puigmal:/sys/bus/hid/drivers/generic-usb# ls 0003:047D:1062.0002 bind module uevent unbind jo...@puigmal:~/workspace/prova1/Debug$ sudo ./prova1 [...] NOTICE: hid_force_open(): successfully opened USB device 004/002[0]. [...] WARNING: hid_interrupt_read(): failed to get interrupt read from device 004/002[0]: could not claim interface 0: Device or resource busy hid_interrupt_read failed with return code 21 I'll keep trying. I am using ubuntu Jaunty and I just read there are issues with usbserial. Seems that this module has been added to the kernel and has caused some trouble. I'll try to investigate that.. Thanks, Jordi. 2009/7/29 Jordi Puigsegur <[email protected]> > Hi all, > >> >> When I was doing some libusb work, I found that I needed to unbind the >> interface from the driver before I could claim it with libusb. The >> interface will remain unclaimed until the device is connected again. I >> currently run the following commands to unbind the interface whenever >> I need to use the device and libusb can't claim the interface. >> >> # cd /sys/bus/usb/drivers/usbhid >> # echo -n interface > unbind >> "interface" is the name of the interface in the >> /sys/bus/usb/drivers/usbhid folder. For my device, it was something >> like "6-2:1.0". It will look similar for your device. From your lsusb >> output, I'd guess that your interface would have the identifier >> "4-2:1.0". The first part of that identifier varies based on which bus >> and port number your device is plugged into and the second part varies >> with the configuration number (usually always 1) and the interface >> number. >> > > I tried that, and the device doesn't appear in /sys/bus/usb/drivers/usbhid. > Nor does it appear under any /sys/bus/usb/drivers directory: > > r...@puigmal:/sys/bus/usb# ls -R > .: > devices drivers drivers_autoprobe drivers_probe uevent > > ./devices: > 1-0:1.0 3-1 3-1:1.2 4-1 4-2:1.0 usb1 usb4 > 2-0:1.0 3-1:1.0 3-1:1.3 4-1:1.0 5-0:1.0 usb2 usb5 > 3-0:1.0 3-1:1.1 4-0:1.0 4-2 6-0:1.0 usb3 usb6 > > ./drivers: > btusb hiddev hub usb usbfs usbhid > > ./drivers/btusb: > 3-1:1.0 3-1:1.1 bind module new_id uevent unbind > > ./drivers/hiddev: > bind module new_id uevent unbind > > ./drivers/hub: > 1-0:1.0 3-0:1.0 5-0:1.0 bind new_id unbind > 2-0:1.0 4-0:1.0 6-0:1.0 module uevent > > ./drivers/usb: > 3-1 4-1 4-2 bind uevent unbind usb1 usb2 usb3 usb4 usb5 usb6 > > ./drivers/usbfs: > bind module new_id uevent unbind > > ./drivers/usbhid: > 4-1:1.0 4-2:1.0 bind module new_id uevent unbind > > r...@puigmal:/sys/bus/usb# lsusb > Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 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 004: ID 047d:1062 Kensington PocketMouse Max > Bus 004 Device 003: ID 0fde:ca01 > Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub > Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub > Bus 003 Device 002: ID 03f0:171d Hewlett-Packard Wireless (Bluetooth + > WLAN) Interface [Integrated Module] > Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub > > > This was done just after starting the computer and plugging in the weather > station, before running any C program. > > Might there be any other program claiming the interface? How could I check > that? > > Thanks, > Jordi > >
_______________________________________________ libhid-discuss mailing list [email protected] http://lists.alioth.debian.org/mailman/listinfo/libhid-discuss http://libhid.alioth.debian.org/

