| INTRODUCTION · PROGRAMS · NEWS · HARDWARE · DOCUMENTS · DOWNLOAD · MISCELLANEOUS · LINKS |
There are several ways you might plot data collected by Oww:
owwlog, and run a separate utility to plot them.postlog facility to write an SQL database,
and plot from this with, for example, php.postlog facility to write an rrdtool round-robin database,
and plot from this with rrdtool called from php.If you'd like to try the last of these I have put together a package
of files that should help. You will need rrdtool
(version 1.2.10 or later) and a php-enabled Web server.
I am using an NSLU2 "slug", with the unslung firmware. In this case, obtaining the necessary software is simply a case of:
ipkg install php-thttpd ipkg install rrdtool
On a main-stream platform, your usual server, e.g. Apache, should be fine.
Download and unpack the oww_plotter archive. It should contain the following files:
createRRDcs.shsetupNGpostlog entry from my setupNG
file. Copy it to your setup or setupNG file,
remembering to change the filename to suit.wx_plot.phpwx_plots.phpwx_plot.php.If you're using unslung you can simply create the database and put
it into /opt/share,
put the postlog in your /opt/share/setupNG,
and copy the php scripts to /opt/share/www.
There is an example plot page here.
You may notice an entry to select alternative formats. This is especially useful when running on an NSLU2, since currently rrdtool takes about 5 seconds to produce each png plot. Other formats are much quicker. Browser support for svg is becoming more wide-spread. It looks good in konqueror (linux) and opera renders it too.
It pays to think hard about your database before settling on a design. It is very difficult to change later, without losing all your data collected so far. If you may add more sensors in the future, allow for them from the start – you don't have to plot them.
The plots are mostly trivial to construct. The exception is the wind direction plot. Simple averaging will not work here. For example if the direction is alternately just east and just west of north, this will average to south!
So, the data collection stage has to resolve the wind direction
and speed into separate notherly and easterly components
using cos and sin functions,
which are then averaged separately. At plot time these are converted
to an angle with the atan2 function I added to rrdtool.
|
| SUMMARY · PROJECTS · SIMON · MELHUISH.INFO |