Weather station software
Weather station software 1 Gr eg Lehey, 18 May 2010
Fine Offset WH-1080 and WH-1081
Gr eg “gr oggy” [email protected]@[email protected], 18 May 2010
Weather observation devices
Weather station software 2 Gr eg Lehey, 18 May 2010
• Old style: thermometer, hygr ometer, bar ometer andrain gauge.
• Digital devices start with inside/outside thermometerand inside hygrometer.
• Cost: about $30.
• Wireless versions include outside hydrometer, costabout $40.
• All of these are standalone devices.
Computer connected devices
Weather station software 3 Gr eg Lehey, 18 May 2010
• All include outside thermometer, hygr ometer,bar ometer and wind gauge.
• Other features may be inside measurements andsunshine detectors.
• Used to be quite expensive.
• Older devices usually have async serial interfaces.
• Newer devices from China are muchcheaper, have USB interface.
WH-1080 and WH-1081
Weather station software 4 Gr eg Lehey, 18 May 2010
• Made by Fine Offset.
• Marketed under many names.
• One of many products.
• WH-1080 has DCF receiver, not useful in Australia.
• WH-1081 has no DCF receiver, sold in Australia.
• Available on eBay for prices between $115 and$280.
• Search for Weather stations USB.
• Available from JayCar for currently $179.
•
WH-1081 features
Weather station software 5 Gr eg Lehey, 18 May 2010
• Exter nal unit with wireless transmitter.
• Not clear if two can coexist.
• Ther mometer, resolution 0.1°.
• Hydr ometer, resolution 1%.
• Wind speed gauge, resolution 0.1 m/s.
• Wind direction measurement, resolution 22.5°.
• Appears to report only in incrementsof 45°.
• Rain gauge, resolution 0.3 mm.
WH-1081 external unit
Weather station software 6 Gr eg Lehey, 18 May 2010
WH-1081 internal unit
Weather station software 7 Gr eg Lehey, 18 May 2010
WH-1081 internal unit
Weather station software 8 Gr eg Lehey, 18 May 2010
• Includes USB interface to computer.
• Displays temperatures, percentage humidity, airpr essur e, wind speed and direction.
• Displays some kind of rainfall average.
• Attempts weather forecast.
• Includes clock.
• Touch screen communication.
• Very low contrast.
• Pr etty much useless as a display.
Softwar e
Weather station software 9 Gr eg Lehey, 18 May 2010
• Supplied with Easyweather software, runs on Mi-cr osoft only.
• Not supported out of the box by any free software.
• Steve Woodford adapted earlier code to wview.
• Only works on wview release 4.
• I adapted it to wview release 5.
Weather web sites
Weather station software 10 Greg Lehey, 18 May 2010
• A couple of world-wide weather sites on the web.
• CWOP (Citizens Weather Observer Program),http://www.wxqa.com/
• Not investigated yet.
• Wundergr ound seems less US-centric.http://www.wunderground.com/
• Has map feature.
Wundergr ound Der eel weather
Weather station software 11 Greg Lehey, 18 May 2010
Wunder map Ballarat area
Weather station software 12 Greg Lehey, 18 May 2010
wview (1)
Weather station software 13 Greg Lehey, 18 May 2010
• Written for a limited number of serial-connectweather stations.
• Thinks in American units, makes a half-hearted, in-accurate attempt to display metric units.
• Continually changing.
wview (2)
Weather station software 14 Greg Lehey, 18 May 2010
wview (3)
Weather station software 15 Greg Lehey, 18 May 2010
• Runs a number of processes.
• Emetic code.
• Communication by the Three Ugly Sisters (MSG,SEM, SHM).
• Stor es readings in (undocumented) custom format(version 4) or sqlite (version 5).
• Fr equently hangs, difficult to get start-ed again.
Hardwar e issues: WH-1081 (1)
Weather station software 16 Greg Lehey, 18 May 2010
• No documentation of interface from manufacturer.
• Flaky interface.
• Fr equently retur ns invalid data.
• Game of catch-up recognizing invalid data.
• Doesn’t like NiMH batteries.
Hardwar e issues: WH-1081 (2)
Weather station software 17 Greg Lehey, 18 May 2010
• Code we got was written for libusb, first version (0or 1, depending).
• Code had “just growed” and did all sorts of undocu-mented things.
• No easy way to get incorrect readings out of thewview database.
Powercor to the rescue
Weather station software 18 Greg Lehey, 18 May 2010
• We have frequent power failures.
• On 11 November 2008, had a 5 hour failure.
• One computer and inside unit of weather stationdamaged.
• Many invalid readings.
• Couldn’t remove them from the record.
• Decided to write something more mal-leable.
My code (1)
Weather station software 19 Greg Lehey, 18 May 2010
• Still evolving.
• Uses web browser as primary display.
• USB interface based on Steve Woodford’s code.
• One process reads the data and stores in a MySQLdatabase.
• One process generates data for the web pages.
My code (2)
Weather station software 20 Greg Lehey, 18 May 2010
• Cr on jobs synchronize data from remote weatherstations and generate graphs.
• One process sends reports to Wundergr ound.
• No CWOP support (yet).
WH-1081 internals
Weather station software 21 Greg Lehey, 18 May 2010
• 64 kB memory.
• 32 byte “pages”, addressed by USB code
• 16 byte entries containing weather information.
• All entries related to metric units.
• Page 0 contains magic numbers and a pointer tocurr ent page.
• Page 1 contains absolute and relativepr essur e.
• Rest unknown or unused.
• Purpose of pressur e infor mation inpage 1 is unclear.
WH-1081 accuracy
Weather station software 22 Greg Lehey, 18 May 2010
• Temperatur e accuracy seems to be OK.
• Pr essur e measur ements seem to have a random off-set.
• Appears to be a frequent problem with weather sta-tions.
• Wind speed measurements appear to be very low.
• No way to confirm.
WH-1081 accuracy: rain gauge
Weather station software 23 Greg Lehey, 18 May 2010
• Measur es in units of 0.3 mm.
• Doesn’t match well with my manual rain gauge.
• Vibration or wind might cause too high a reading.
• Spiders nest in the gauge, obstructing the bucketsand causing too low a reading.
Rain gauge (1)
Weather station software 24 Greg Lehey, 18 May 2010
Rain gauge (2)
Weather station software 25 Greg Lehey, 18 May 2010
OS-r elated pr oblems
Weather station software 26 Greg Lehey, 18 May 2010
• Fr eeBSD often retur ns ENODEV reading the device.
• Pr oblem is not recoverable. Process must stop.
• New process normally works OK.
• Sometimes takes up to a minute.
• libusb retur ns bogus error indications under Linux.
• Not investigated further.
Main page
Weather station software 27 Greg Lehey, 18 May 2010
Inside and outside temperature
Weather station software 28 Greg Lehey, 18 May 2010
5 day comparison
Weather station software 29 Greg Lehey, 18 May 2010
Relative humidity
Weather station software 30 Greg Lehey, 18 May 2010
Wind speed
Weather station software 31 Greg Lehey, 18 May 2010
Bar ometric pr essur e
Weather station software 32 Greg Lehey, 18 May 2010
Rainfall
Weather station software 33 Greg Lehey, 18 May 2010
Temperatur es: BoM and Dereel
Weather station software 34 Greg Lehey, 18 May 2010
Pr essur es: BoM and Dereel
Weather station software 35 Greg Lehey, 18 May 2010
Comparisons page
Weather station software 36 Greg Lehey, 18 May 2010
• These measurements leave some questions open.
• Is my data correct? How do I know?
• How does the weather here dif fer fr om the sur-rounding area?
• Thus the comparisons page.
• Alr eady helped calibrate the barometer.
• Curr ently only for current day.
Comparisons page
Weather station software 37 Greg Lehey, 18 May 2010
Comparisons: temperatures
Weather station software 38 Greg Lehey, 18 May 2010
Comparisons: dewpoint
Weather station software 39 Greg Lehey, 18 May 2010
Comparisons: humidity
Weather station software 40 Greg Lehey, 18 May 2010
Comparisons: barometric pressur e
Weather station software 41 Greg Lehey, 18 May 2010
Comparisons: wind
Weather station software 42 Greg Lehey, 18 May 2010
Comparisons: wind gust
Weather station software 43 Greg Lehey, 18 May 2010
To do
Weather station software 44 Greg Lehey, 18 May 2010
• Lots of things.
• Replicate MySQL database to remote site.
• Find a more general way of generating graphs (alsoknown as “I hate gnuplot”).
• Fix myriads of bugs.
• Think out more featur es.
• Make it easy for other people to install.
Refer ences: exter nal
Weather station software 45 Greg Lehey, 18 May 2010
• Manufactur er Fine Offset http://www.fos-hk.com/en/products/show.asp?id=41
• wview softwar ehttp://www.wviewweather.com/
Refer ences: my site
Weather station software 46 Greg Lehey, 18 May 2010
• These slides athttp://www.lemis.com/grog/Pa-pers/WH-1080.pdf
• Power outages athttp://tinyurl.com/powercor
• My code athttp://www.lemis.com/grog/pro-grams/WH1080.tar.gz
• Der eel weather observations athttp://tinyurl.com/dereel-weather