December 2016

252627282930 31

Page Summary

Style Credit

Expand Cut Tags

No cut tags

October 18th, 2015

tony_osp: (Default)
Sunday, October 18th, 2015 06:30 pm
As planned, I just finished converting logging display to the new format, and changed graphing to provide more high-level information.

New graphing tab in "Logs" page shows three basic graphs:

1. Historical watering times for selected time period
2. Historical overall water usage for selected time period
3. Water usage by Zone (again for selected time period)

Water Usage by Zone

I find these graphs more interesting and useful rather than original sprinklers_pi graphs of watering by time of day, or day of week etc, because usually you would want to either see actual log records (and new schedules-based watering log provides it), or you want to see aggregated metrics data, or you want to get insights into which zones are the most "costly" in terms of water consumption. New logs views provide exactly that.

Also I've re-written the visualization UI. Original sprinklers_pi UI was relying on the back-end to filter and package the data for the right view, which makes sense if you have reasonably powerful MCU (and MySql handy), but this approach became royal pain in the neck if you have to rely on low-power Arduino MCU with files-based storage. Good thing is that modern browsers allow offloading data manipulations to the client JavaScript.

New visualization code retrieves basic, plain logs data (the same format as what is used to power other log views), and then produces right information for visualization using JavaScript. Also I changed the graphing library to Highcharts instead of Flot - I like Highcharts powerful and sleek UIs, also Highcharts are used in other parts of the SmartGarden UI and use of the same library speeds up things quite a bit (typically library will be already loaded by the time you hit Logs page).

Overall I'm quite happy with the result.

At this stage SmartGarden v1.5 is nearly-ready. The only remaining planned software work is to add support for Thermistor-based temp sensor, but other than that it is done (barring possible bugs etc). Adding thermistor support is not hard, it is essentially a variation of the Analog temp sensor SmartGarden already supports, main extra piece is to add translation table - typical thermistor requires rather complex non-linear conversion to produce temperature reading, and you have to use either expensive floating point expression or translation lookup table. But conceptually it is fairly easy to do.