[rrd-users] Measuring rain from weatherstation

Alex van den Bogaerdt alex at vandenbogaerdt.nl
Sat Dec 6 12:21:12 CET 2014


----- Original Message ----- 
From: "Kurt Sejr Hansen" <kurt at sejr-hansen.dk>
To: <rrd-users at lists.oetiker.ch>
Sent: Saturday, December 06, 2014 11:24 AM
Subject: [rrd-users] Measuring rain from weatherstation


> Dear allI’m using rrd with a weather station (Sirius) from TFA, get data
> every 5 minutes,  and an Raspberry PI for producing graph and upload them 
> to
> a web server – interested see  here <http://sejr-hansen.dk/vejr/vejr.htm>

Expect some more tips later, i'm a bit in a hurry now

> (Encrypted in Danish) Raincounter from the TFA weather station is a
> “counter” in rrd language, and my problem is that I can’t figure out how 
> to
> produce graphs and can’t see how I get data the tells about e.g. rain the
> last  week, day or one hour. I found  this

Are you sure it is COUNTER ?  I'm not saying it's wrong, I am only asking 
it!
I would expect it to be ABSOLUTE instead of counter.

> <https://lists.oetiker.ch/pipermail/rrd-users/2000-November/001697.html> 
> :
> and has tried to copy this to this shell
> script---------#!/bin/bashDIR="/home/pi/rrd/"#Rain the last hourrrdtool
> graph dummy --start -1h
> \DEF:rain=$DIR/hjemmedatabase.rrd:raincounter:AVERAGE
> \CDEF:totalrain=rain,1,3600,*,* \PRINT:totalrain:AVERAGE:"%4.2lf mm"#Reain
> last 24 hourrrdtool graph dummy --start -1d

<snip>

I see "start -1h" which means it should show roughly one hour.

> \DEF:rain=$DIR/hjemmedatabase.rrd:raincounter:AVERAGE
> \CDEF:totalrain=rain,1,86400,*,* \PRINT:totalrain:AVERAGE:"%4.2lf mm"#rain
> the last weekrrdtool graph dummy --start -1w

and here you try to define "rain" another time, so I expect to see an error.

Don't copy stuff from the internet without understanding what it is supposed 
to do.  You may end up with a pretty picture, not representing your data at 
all.

While debugging this problem, make sure you keep track of the numbers you 
get from your device. It would, for instance, be useful to know what the 
values are during some rain. Do not just keep the values, also keep the 
corresponding timestamps.

Understand the different options to RRDtool.  My tutorial and website may 
help, or find another source of information. It is especially necessary to 
have the right input data type. If that's wrong, it's hard or impossible to 
fix in rrdtool graph.

First step is to make sure data going into RRDtool is processed correctly, 
so that you end up with <something-per-second>. Then later worry about 
translating this during "rrdtool graph" into useful output.  You cannot 
produce useful output if your database contains gibberish.

As your graph shows rain in megameters, I don't trust your current database. 
But don't delete it yet, it could be something weird in your graph 
statements. First things first, show the output of "rrdtool info" and gather 
some data to post here.

cheers,
alex



More information about the rrd-users mailing list