Permalink
Browse files

Initial import

  • Loading branch information...
barnybug committed Dec 20, 2009
0 parents commit d2f8b6746208d65e937d15a7539ae56f42fc6317
Showing with 584 additions and 0 deletions.
  1. +2 −0 .gitignore
  2. +4 −0 Makefile
  3. +42 −0 README.markdown
  4. +9 −0 udev/README
  5. +7 −0 udev/wmr100.rules
  6. +520 −0 wmr100.c
@@ -0,0 +1,2 @@
+wmr100
+data.log
@@ -0,0 +1,4 @@
+CPPFLAGS += `pkg-config libhid --cflags`
+LDFLAGS += `pkg-config libhid --libs`
+
+wmr100: wmr100.c
@@ -0,0 +1,42 @@
+Oregon Scientific WMR100 client for Linux/BSD/etc.
+==================================================
+
+Introduction
+------------
+
+The WMR100/200 use a proprietary protocol for their USB
+connection. It's very useful for enthusiasts running a headless Linux
+box to collect and analyze data from this link, but unfortunately the
+protocol isn't openly documented, nor are clients provided for this
+platform.
+
+This simple C program handles the USB protocol of the WMR100, and
+translates it an ASCII line-format, easy for parsing/analysing.
+
+You'll need to setup the udev rules (see udev/README) if you want to
+run this not as root. This is due to how libhid accesses the USB
+ports.
+
+Requisites
+----------
+
+libhid-dev (or similarly named) packages installed.
+
+Building
+--------
+
+Run 'make'.
+
+To install, copy wmr100 to your path.
+
+Usage
+-----
+
+I'd suggest you run ./wmr100, which will dump data to data.log as well
+as stdout. You can then process periodically data.log with a script in
+python/perl/ruby/your language of choice, and frob with the data that
+way.
+
+Alternativally you could adapt the original C code to write to a
+database directly instead, but that's more pain that I'm willing to
+endure. :-)
@@ -0,0 +1,9 @@
+Add group 'weather':
+# addgroup weather
+# addgroup <user> weather
+
+Copy wmr100.rules into /etc/udev and symlink:
+# cp wmr100.rules /etc/udev
+# cd etc/udev/rules.d; ln -s ../wmr100.rules 025_wmr100.rules
+
+Run wmr100.
@@ -0,0 +1,7 @@
+# udev rule to create nodes with correct membership and permissions for
+# all PTP cameras; must be run before udev.rules
+#
+
+ACTION=="add", SUBSYSTEM=="usb_device", ATTRS{idProduct}=="ca01", ATTRS{idVendor}=="0fde", \
+ PROGRAM="/bin/sh -c 'K=%k; K=$${K#usbdev}; printf bus/usb/%%03i/%%03i $${K%%%%.*} $${K#*.}'", \
+ NAME="%c", MODE="0660", GROUP="weather"
Oops, something went wrong.

0 comments on commit d2f8b67

Please sign in to comment.