Re: [libhid-discuss] problems with libhid and Oregon Scientific weather station WMRS203 (interrupt read)
On Tue, Jul 28, 2009 at 1:42 PM, Jordi Puigsegurjordi.puigse...@gmail.com wrote: I am trying to use libhid to acces a Oregon Scientific weather station (model WMRS200). It is recognised as a hid device. Using code similar to test_hid.c and with ideas borrowed from the following web page: Linux Oregon Scientific WMR100 I am able to force open it, but cannot read the information from the interrupt... What am I doing wrong? The system is a Ubuntu Jaunty. If there is any other information I can provide, please let me know. Google found the following and maybe they can help. 1) Oregon WMR200 Driver (Under Dev.), using libusb 0.1.12 http://www.sdic.ch/innovation/contributions 2) You can also try this thread http://www.weather-watch.com/smf/index.php?topic=28307.msg226828 http://www.weather-display.com/downloadfiles/WeatherDlinux.zip -- Xiaofan http://mcuee.blogspot.com ___ libhid-discuss mailing list libhid-discuss@lists.alioth.debian.org http://lists.alioth.debian.org/mailman/listinfo/libhid-discuss http://libhid.alioth.debian.org/
Re: [libhid-discuss] problems with libhid and Oregon Scientific weather station WMRS203 (interrupt read)
Ok. But I get the same result: TRACE: hid_interrupt_read(): retrieving interrupt report from device 004/003[0] ... WARNING: hid_interrupt_read(): failed to get interrupt read from device 004/003[0]: could not claim interface 0: Device or resource busy hid_interrupt_read 21 Jordi. 2009/7/28 Charles Lepple clep...@ghz.cc On Jul 28, 2009, at 1:42 AM, Jordi Puigsegur wrote: What am I doing wrong? This does not seem right: ret = hid_interrupt_read(hid, USB_ENDPOINT_OUT+1, (void*)packet, sizeof(packet), 1000); The _OUT direction is relative to the PC, so a _read needs to have an _IN endpoint, and a _write needs a _OUT endpoint. Given the following section in lsusb, it should probably be USB_ENDPOINT_IN+1: Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x81 EP 1 IN bmAttributes3 Transfer TypeInterrupt Synch Type None Usage Type Data wMaxPacketSize 0x0008 1x 8 bytes bInterval 1 output.txt.gz Description: GNU Zip compressed data test.c.gz Description: GNU Zip compressed data ___ libhid-discuss mailing list libhid-discuss@lists.alioth.debian.org http://lists.alioth.debian.org/mailman/listinfo/libhid-discuss http://libhid.alioth.debian.org/
Re: [libhid-discuss] problems with libhid and Oregon Scientific weather station WMRS203 (interrupt read)
On Tue, Jul 28, 2009 at 2:18 PM, Jordi Puigsegurjordi.puigse...@gmail.com wrote: Ok. But I get the same result: TRACE: hid_interrupt_read(): retrieving interrupt report from device 004/003[0] ... WARNING: hid_interrupt_read(): failed to get interrupt read from device 004/003[0]: could not claim interface 0: Device or resource busy hid_interrupt_read 21 The device may still be claimed by the usbhid driver that automatically claims HID devices on Ubuntu. 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. There is probably a more permanent and sustainable solution to this issue, e.g. a way to prevent usbhid from claiming your interface automatically. I'm open to suggestions on how to do that if anyone else has some ideas. Cheers, Jaeden ___ libhid-discuss mailing list libhid-discuss@lists.alioth.debian.org http://lists.alioth.debian.org/mailman/listinfo/libhid-discuss http://libhid.alioth.debian.org/