ejeklint / weathernode

Weather data logger compatible with Oregon Scientific USB weather stations

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Weather data logger

This weather data logger is compatible with Oregon Scientific USB weather stations, like WMR100, WMRS200 and a couple of others. It tries to log same data as Oregon Scientific's own software, which is Windows only and just awful, but as the data protocol is available only under NDA, and they refused to let me get it, this implementation is based on reversed engineering so some tiny things might differ.

weathernode uses the excellent node-hid by Hans Hübner. It's the perfect thing to handle USB HID devices in node.

Requirement

  • Interest in weather data
  • An Oregon Scientific weather station with USB that acts as a HID device, like WMR100, RMS300 or WMRS200
  • node.js version >= 0.8 and npm (bundled with node.js)
  • Build tools. On OS X you need to install Xcode to build hidapi
  • An account at Xively if you want to log data to it
  • An account at Pusher or Pubnub if you want to push real time updates through websockets.

Installation

If you're on Linux, make sure that libusb.h is available, you might need to install libudev-dev and libusb-1.0-0-dev for this. Then clone this repo, cd into it and just do

npm install

Write a config.json with your own API keys. You can use the example one as a start.

Make sure you have the weather station plugged in before running weathernode, then run it with

node index.js

Or even better, run it with forever and it will be restarted automagically should it crash. And it will crash, deliberately, at times when the connection to Xively or Pusher or Pubnub goes down. Here's how I run it:

forever start -o log.txt --spinSleepTime 1000 index.js

meaning that it starts, logs to log.txt and wait 1000 ms before restarting after a termination. This works very well for me.

wheathernode is compatible with node 0.8 and higher.

What does it log?

weathernode logs all available data to Xively (formerly called Cosm (formerly called Pachube)) once every minute. See weather data at my summer house for a list of all available measurements.

It will also push the same measurements as real time updates to either Pubnub or Pusher, if they are configured, as soon as these values trickle in.

An example site using this data

Here's is an overview of all weatherdata at my summer house. The graphs are generated by Cosm, and the real-time updates comes from Pusher via a websocket connection. High tech! The site is build with Express.js.

About

Weather data logger compatible with Oregon Scientific USB weather stations


Languages

Language:JavaScript 100.0%