1
0
Fork 0
forked from wezm/wezm.net
wezm.net/v1/content/technical/2010/09/weather-station-software.html

39 lines
1.9 KiB
HTML
Raw Normal View History

2010-09-26 07:19:40 +00:00
Two weeks ago when I [installed my weather station][install] I setup the wview
software to log the current conditions and generate and upload
2018-03-16 23:48:48 +00:00
HTML and graphs to [the weather page][weather]. wview seemed like the
2010-09-26 07:19:40 +00:00
perfect tool for the job but unfortunately it proved unreliable, even with the
built in process monitoring. After a few hours of running fine it appeared the
HTML generation process would hang, preventing any further updates to the
website.
[install]: /personal/2010/09/weather-station/
2018-03-16 23:48:48 +00:00
[weather]: /weather/
2010-09-26 07:19:40 +00:00
wview has a lot of functionality and thus a lot of code, which turned me
off trying to track down the bug. I looked around for
alternatives and found [Open2300][open2300], which is a core collection of
functions for communicating with a LaCrosse WS-23xx weather station and a set
of tools. wview logged its observations to an SQLite database, which seemed
appropriate for this application. There were tools in Open2300 to log current
conditions to MySQL and PostgreSQL databases but not SQLite. So last weekend
2013-01-13 01:20:55 +00:00
I spent some of the afternoon learning enough of the SQLite C API to add
2010-09-26 07:19:40 +00:00
such a tool. The result is in my
[git mirror of the Open2300 SVN repo][open2300git]. Once the SQLite tool is
tidied up a bit more I'll submit it upstream.
[open2300]: http://www.lavrsen.dk/foswiki/bin/view/Open2300/WebHome
[open2300git]: http://github.com/wezm/open2300
Now I had a database of observations I needed to replace the HTML pages
that wview was previously generated. To do this I wrote a small
[Lua tool][weather-tools]
to query the database and output the results to a [JSON][json] file. The
JSON is used on the new [weather page][weather], which is largely populated
2013-01-13 01:20:55 +00:00
by Javascript and uses the [flot][flot] and [dygraphs][dygraphs] libraries
visualise the weather data.
2010-09-26 07:19:40 +00:00
[json]: http://www.json.org/
[flot]: http://code.google.com/p/flot/
2013-01-13 01:20:55 +00:00
[dygraphs]: http://dygraphs.com/
[weather-tools]: http://github.com/wezm/weather-tools