Discussion:
[libhid-discuss] problems with libhid and Oregon Scientific weather station WMRS203 (interrupt read)
Jordi Puigsegur
2009-07-28 05:42:25 UTC
Permalink
Hi,

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<http://mono.kmc.gr.jp/%7Ewalkure/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.

I attach the lsusb output, the test c code and its output.

Thanks,
Jordi.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/libhid-discuss/attachments/20090728/16d733ea/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lsusb.txt.gz
Type: application/x-gzip
Size: 921 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/libhid-discuss/attachments/20090728/16d733ea/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.c.gz
Type: application/x-gzip
Size: 680 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/libhid-discuss/attachments/20090728/16d733ea/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: output.txt.gz
Type: application/x-gzip
Size: 1165 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/libhid-discuss/attachments/20090728/16d733ea/attachment-0002.bin>
Charles Lepple
2009-07-28 11:31:54 UTC
Permalink
Post by Jordi Puigsegur
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
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0008 1x 8 bytes
bInterval 1
Jordi Puigsegur
2009-07-28 19:18:30 UTC
Permalink
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 <clepple at ghz.cc>
Post by Jordi Puigsegur
What am I doing wrong?
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
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 1
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/libhid-discuss/attachments/20090728/7ffd88ad/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: output.txt.gz
Type: application/x-gzip
Size: 1158 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/libhid-discuss/attachments/20090728/7ffd88ad/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.c.gz
Type: application/x-gzip
Size: 700 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/libhid-discuss/attachments/20090728/7ffd88ad/attachment-0001.bin>
Jaeden Amero
2009-07-28 22:31:37 UTC
Permalink
On Tue, Jul 28, 2009 at 2:18 PM, Jordi
? 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
Xiaofan Chen
2009-07-29 00:05:16 UTC
Permalink
Post by Jaeden Amero
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.
Just submit a patch to the Linux hid maintainer
(Jiri Kosina) and add the device to the blacklist.

Example: I submitted a patch to add PICkit 1 and 2 to the
blacklist.
https://kerneltrap.org/mailarchive/git-commits-head/2008/5/20/1885084
--
Xiaofan http://mcuee.blogspot.com
Jordi Puigsegur
2009-07-29 17:43:36 UTC
Permalink
Hi all,
Post by Jaeden Amero
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:

root at 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

root at 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/libhid-discuss/attachments/20090729/371f65a7/attachment.htm>
Jordi Puigsegur
2009-07-30 20:26:53 UTC
Permalink
I found another directory under sys/bus where the device does appear:

root at 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

root at puigmal:/sys/bus/hid/drivers/generic-usb# echo -n "0003:0FDE:CA01.0001"
Post by Jaeden Amero
unbind
root at puigmal:/sys/bus/hid/drivers/generic-usb# ls
0003:047D:1062.0002 bind module uevent unbind

jordi at 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 <jordi.puigsegur at gmail.com>
Post by Jaeden Amero
Hi all,
Post by Jaeden Amero
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.
root at puigmal:/sys/bus/usb# ls -R
devices drivers drivers_autoprobe drivers_probe uevent
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
btusb hiddev hub usb usbfs usbhid
3-1:1.0 3-1:1.1 bind module new_id uevent unbind
bind module new_id uevent unbind
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
3-1 4-1 4-2 bind uevent unbind usb1 usb2 usb3 usb4 usb5 usb6
bind module new_id uevent unbind
4-1:1.0 4-2:1.0 bind module new_id uevent unbind
root at 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/libhid-discuss/attachments/20090730/a1ce81c6/attachment.htm>
Jordi Puigsegur
2009-07-30 21:06:18 UTC
Permalink
Sorry for cluttering the list, but I just woudl like to make this work ...

jordi at puigmal:~$ dmesg | grep usb
[ 0.602419] usbcore: registered new interface driver usbfs
[ 0.602419] usbcore: registered new interface driver hub
[ 0.602419] usbcore: registered new device driver usb
[ 3.524080] usb usb1: configuration #1 chosen from 1 choice
[ 3.544076] usb usb2: configuration #1 chosen from 1 choice
[ 3.544430] usb usb3: configuration #1 chosen from 1 choice
[ 3.544714] usb usb4: configuration #1 chosen from 1 choice
[ 3.544998] usb usb5: configuration #1 chosen from 1 choice
[ 3.545283] usb usb6: configuration #1 chosen from 1 choice
[ 4.140028] usb 3-1: new full speed USB device using uhci_hcd and address
2
[ 4.306669] usb 3-1: configuration #1 chosen from 1 choice
[ 4.548452] usb 4-2: new low speed USB device using uhci_hcd and address
2
[ 4.702786] usb 4-2: configuration #1 chosen from 1 choice
[ 10.772854] usbcore: registered new interface driver btusb
[ 11.110766] usbcore: registered new interface driver hiddev
[ 11.123978] input: HID 047d:1062 as
/devices/pci0000:00/0000:00:1d.0/usb4/4-2/4-2:1.0/input/input5
[ 11.125694] generic-usb 0003:047D:1062.0001: input,hidraw0: USB HID v1.00
Mouse [HID 047d:1062] on usb-0000:00:1d.0-2/input0
[ 11.125715] usbcore: registered new interface driver usbhid
[ 11.125718] usbhid: v2.6:USB HID core driver
[ 78.544058] usb 4-1: new low speed USB device using uhci_hcd and address
3
[ 78.718640] usb 4-1: configuration #1 chosen from 1 choice
[ 78.735138] generic-usb 0003:0FDE:CA01.0002: hiddev96,hidraw1: USB HID
v1.10 Device [Universal Bridge] on usb-0000:00:1d.0-1/input0

The last three lines appear when the weather station is plugged in the
computer. Someone has pointed me out that in Ubuntu Jaunty the usbserial is
built-in in the kernel, however I don't see it in dmesg. I suppose that is
not the problem.

Jordi.

2009/7/30 Jordi Puigsegur <jordi.puigsegur at gmail.com>
Post by Jordi Puigsegur
root at 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
root at puigmal:/sys/bus/hid/drivers/generic-usb# echo -n
"0003:0FDE:CA01.0001" > unbind
root at puigmal:/sys/bus/hid/drivers/generic-usb# ls
0003:047D:1062.0002 bind module uevent unbind
jordi at 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 <jordi.puigsegur at gmail.com>
Hi all,
Post by Jordi Puigsegur
Post by Jaeden Amero
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
root at puigmal:/sys/bus/usb# ls -R
devices drivers drivers_autoprobe drivers_probe uevent
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
btusb hiddev hub usb usbfs usbhid
3-1:1.0 3-1:1.1 bind module new_id uevent unbind
bind module new_id uevent unbind
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
3-1 4-1 4-2 bind uevent unbind usb1 usb2 usb3 usb4 usb5 usb6
bind module new_id uevent unbind
4-1:1.0 4-2:1.0 bind module new_id uevent unbind
root at 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/libhid-discuss/attachments/20090730/8d9f9324/attachment-0001.htm>
Peter Stuge
2009-07-30 21:59:00 UTC
Permalink
[ 78.544058] usb 4-1: new low speed USB device using uhci_hcd and address 3
[ 78.718640] usb 4-1: configuration #1 chosen from 1 choice
[ 78.735138] generic-usb 0003:0FDE:CA01.0002: hiddev96,hidraw1: USB HID v1.10 Device [Universal Bridge] on usb-0000:00:1d.0-1/input0
The last three lines appear when the weather station is plugged in
the computer. Someone has pointed me out that in Ubuntu Jaunty the
usbserial is built-in in the kernel, however I don't see it in
dmesg. I suppose that is not the problem.
If I were you I would just program the hidraw API directly to begin
with. Then maybe look into making a hidraw backend for libhid.

Is portability across many operating systems important for you?


//Peter
Jordi Puigsegur
2009-07-31 13:39:30 UTC
Permalink
My plans are to add support for this type of weather station to an existing
open source weather server, wview. The software runs on a variety of *nix
operating systems and I would like to take an approach that is most standard
and more likely to work on many *nix systems. The sofware also runs on SBC
computers like NLSU, Sheeva plug, etc.

Therefore my goal should be to take the aproach that will be more likely to
work on any *nix system. So far I see that there are several options:

* user space solution: libusb + libhid

* hidraw driver API
I suppose that most *nix have this driver loaded on the kernel. What I don't
understand is what you suggest about the possibility of writting a backend
for libhid using hidraw driver.

* usbserial
I don't know much about this option and I don't know if this specific device
can run using this driver. Data is received through an interrupt but it
seems that the reset command is transfered using control_data, not a write
interrupt.


Thanks,
Jordi.

2009/7/30 Peter Stuge <peter at stuge.se>
Post by Jordi Puigsegur
[ 78.544058] usb 4-1: new low speed USB device using uhci_hcd and
address 3
Post by Jordi Puigsegur
[ 78.718640] usb 4-1: configuration #1 chosen from 1 choice
[ 78.735138] generic-usb 0003:0FDE:CA01.0002: hiddev96,hidraw1: USB HID
v1.10 Device [Universal Bridge] on usb-0000:00:1d.0-1/input0
Post by Jordi Puigsegur
The last three lines appear when the weather station is plugged in
the computer. Someone has pointed me out that in Ubuntu Jaunty the
usbserial is built-in in the kernel, however I don't see it in
dmesg. I suppose that is not the problem.
If I were you I would just program the hidraw API directly to begin
with. Then maybe look into making a hidraw backend for libhid.
Is portability across many operating systems important for you?
//Peter
_______________________________________________
libhid-discuss mailing list
libhid-discuss at lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/libhid-discuss
http://libhid.alioth.debian.org/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/libhid-discuss/attachments/20090731/04dfb65e/attachment.htm>
Jordi Puigsegur
2009-08-01 15:00:25 UTC
Permalink
Where can I find information on the hidraw API and how to use it?

Thanks,
Jordi.

2009/7/31 Jordi Puigsegur <jordi.puigsegur at gmail.com>
Post by Jordi Puigsegur
My plans are to add support for this type of weather station to an existing
open source weather server, wview. The software runs on a variety of *nix
operating systems and I would like to take an approach that is most standard
and more likely to work on many *nix systems. The sofware also runs on SBC
computers like NLSU, Sheeva plug, etc.
Therefore my goal should be to take the aproach that will be more likely to
* user space solution: libusb + libhid
* hidraw driver API
I suppose that most *nix have this driver loaded on the kernel. What I
don't understand is what you suggest about the possibility of writting a
backend for libhid using hidraw driver.
* usbserial
I don't know much about this option and I don't know if this specific
device can run using this driver. Data is received through an interrupt but
it seems that the reset command is transfered using control_data, not a
write interrupt.
Thanks,
Jordi.
2009/7/30 Peter Stuge <peter at stuge.se>
Post by Jordi Puigsegur
[ 78.544058] usb 4-1: new low speed USB device using uhci_hcd and
address 3
Post by Jordi Puigsegur
[ 78.718640] usb 4-1: configuration #1 chosen from 1 choice
[ 78.735138] generic-usb 0003:0FDE:CA01.0002: hiddev96,hidraw1: USB
HID v1.10 Device [Universal Bridge] on usb-0000:00:1d.0-1/input0
Post by Jordi Puigsegur
The last three lines appear when the weather station is plugged in
the computer. Someone has pointed me out that in Ubuntu Jaunty the
usbserial is built-in in the kernel, however I don't see it in
dmesg. I suppose that is not the problem.
If I were you I would just program the hidraw API directly to begin
with. Then maybe look into making a hidraw backend for libhid.
Is portability across many operating systems important for you?
//Peter
_______________________________________________
libhid-discuss mailing list
libhid-discuss at lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/libhid-discuss
http://libhid.alioth.debian.org/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/libhid-discuss/attachments/20090801/a7b22d8a/attachment.htm>
Xiaofan Chen
2009-08-01 15:37:34 UTC
Permalink
On Sat, Aug 1, 2009 at 11:00 PM, Jordi
Post by Jordi Puigsegur
Where can I find information on the hidraw API and how to use it?
http://lxr.linux.no/linux+v2.6.30/include/linux/hidraw.h
http://lxr.linux.no/linux+v2.6.30/drivers/hid/hidraw.c

It is for Linux only. I believe you need to configure the
kernel to support hidraw to get it.
http://lxr.linux.no/linux+v2.6.30/drivers/hid/Kconfig
--
Xiaofan http://mcuee.blogspot.com
Charles Lepple
2009-08-01 15:10:15 UTC
Permalink
Post by Jordi Puigsegur
* hidraw driver API
I suppose that most *nix have this driver loaded on the kernel. What
I don't understand is what you suggest about the possibility of
writting a backend for libhid using hidraw driver.
As far as I know, hidraw is specific to Linux. By "*nix" do you mean
BSD and Solaris as well?
Xiaofan Chen
2009-08-02 00:58:22 UTC
Permalink
On Tue, Jul 28, 2009 at 1:42 PM, Jordi
Post by Jordi Puigsegur
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
Jordi Puigsegur
2009-08-02 07:54:07 UTC
Permalink
Hi,

The first link is great. I've done a lot of googling and knew there had to
be somewhere a wmr200log, but haven't found it... So far I've compiled and
run it and seems to be reading data from the weather station. I'll have to
look carefully at the code and see what it is doing which makes it work.

I see that part of it is generated code using a tool (usbsnoop2libusb.pl).
I'll investigate and let everybody knew about the findings. I'll probably
set up a blog where I can gather all documentation/links found.

Thanks!
Jordi.

2009/8/2 Xiaofan Chen <xiaofanc at gmail.com>
Post by Xiaofan Chen
On Tue, Jul 28, 2009 at 1:42 PM, Jordi
Post by Jordi Puigsegur
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
Post by Jordi Puigsegur
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
Post by Jordi Puigsegur
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/libhid-discuss/attachments/20090802/a5606e8e/attachment.htm>
Loading...