Weather Station Software - by Wesley Moore

Weather Station Software

Published on

Two weeks ago when I installed my weather station I setup the wview software to log the current conditions and generate and upload HTML and graphs to the weather page. wview seemed like the 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.

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, 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 I spent some of the afternoon learning enough of the SQLite C API to add such a tool. The result is in my git mirror of the Open2300 SVN repo. Once the SQLite tool is tidied up a bit more I’ll submit it upstream.

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 to query the database and output the results to a JSON file. The JSON is used on the new weather page, which is largely populated by Javascript and uses the flot and dygraphs libraries visualise the weather data.

Comment icon Stay in touch!

Follow me on Twitter or Mastodon, subscribe to the feed, or send me an email.