meteolinger logo

Mission

Meteolinger is a project that creates a sofware for weatherstations under Linux. It has two subprojects. First is a development of a driver that reads out a data of a weatherstation, second is a software that collects and presents the data from weatherstation.

What's the name

MeteoLiNGer is a two word compound, where first word is obvious "Meteo" and the second word is some kind of abbreviation of Linux and National Geographics or LiNux? "Graphicer", or just and english word "linger"

Weatherstations

Weather station Topcom265 NE has no included sotware for Linux. At pages http://www.pendec.dk/weatherstation2007.htm we found a wwsr utility able to read back some data from weatherstation. This program had however several problems, which we are trying to fix. According to this page this should work for

  • Topcom National Geographics 265 NE
  • The weather station Watson W-8681(UK)
  • Scientific Sales Pro Touch Screen Weather Station(US)
  • WH-1080PC / WH1080(Denmark / Germany)

this we can not guaratee at the momemnt. We tested it only at

  • Topcom National Geographics 265 NE
  • Watson W-8681

As pendec.dk forum is not sending registrations and original autor seems to be pretty busy, we founded a new project.

What's fixed

Some detail at http://www.lowlevel.cz/log/pivot/entry.php?id=135

  • Rain - we managed to get some info about the rain data. Experiment shows that one sensor flip is 0.3mm of rain. Total counter is updated with every flip. 1h rain value is calculated from stored and immediate value.
  • Temperature below zero - original source was incorrecly interpreting the values of a temperature bellow zero.
  • Parameter -y - prints out data separated by tab for easy post processing.

Getting the source

svn co http://meteolinger.lowlevel.cz/anonsvn

Compiling the driver

gcc /usr/lib/libusb.so wwsr.c -o wwsr

You need to have installed a libusb development library (e.g. in Fedora libusb-devel.i386) and compiler gcc.

Using the Weatherstats

Weatherstats is just a simple perl script that stores the collected data in RRD and creates simple html page and graphs. It should be called every 2 minutes. E.g. every 10th minute you can call it with parameter -g to create graphs. This lowers the load of the machine. At the MAIN you can set parameters like your web page folder and folder where you want to store RRDs and where is your binary for rrdtool. Parameter -a serves to specify the station altitude.

Weatherstats work only with http://meteolinger.lowlevel.cz/anonsvn/driver/wwsr.c driver version! Other versions (like wwsr3.x) are for different tools.

Crontab example:

2,4,6,8,12,14,16,18,22,24,26,28,32,34,36,38,42,44,46,48,52,54,56,58 * * * * cd /home/wwss/; ./weatherstats -a 419
0,10,20,30,40,50 * * * * cd /home/wwss/; ./weatherstats -a 419 -g

Snapshot of the output: weatherstats screenshot

Updating the RRD from 0.4 to 0.5+

You need the latest wwsr.c driver and latest WeatherStats? script.

As one of the most important things why we are using weather stations is to collect the data history, whenever you have to change the software, this means often also converting the format of the data you have already stored. From WeatherStats? 0.4 to 0.5 I changed the RRD format, to store also the MAX value (this is especialy usefull for wind) and changed the internal DS (data set) name of the values. The reason is that I made all the values and RRDs to have more hierarchical name (now Humidity Outdoor instead Outdoor Humidity). Now all RRDs have names like temperature_outdoor and DS name inside the RRD is only "outdoor". Those two things need to be changed "manually" in your old RRD.

1. rename your RRDs

OLD NEW
air_pressure.rrd pressure_air.rrd
indoor_humidity.rrd humidity_indoor.rrd
indoor_temperature.rrd temperature_indoor.rrd
interval.rrd removed *!*
outdoor_humidity.rrd humidity_outdoor.rrd
outdoor_temperature.rrd temperature_outdoor.rrd
rain_total.rrd rain_total.rrd
rain_1h.rrd rain_1h.rrd
wind_direction.rrd wind_direction.rrd
wind_gust.rrd wind_gust.rrd
wind_chill.rrd temperature_feel-out.rrd (former wind chill)
wind_speed.rrd wind_speed.rrd
pressure_air-sea.rrd (new DB, will be created)
temperature_dew-out.rrd (new DB, will be created)

2. Dump your DBs and copy the AVERAGE section <rra></rra> once again into the file, change in the copied section <cf></cf> to MAX. This is not ideal, but you do not have the MAX data so this is cheating. Now modify the <name></name> to be e.g. instead temperature_outdoor only outdoor.

Here is a small script that can automate the section copiing, then it starts editor and you can modify the rest. Then it generates the .rdd. Please first copy all your .rrd files to .rrd_old and of course backup them!

for i in `ls *.rrd_old`
    do
    bn=`basename $i .rrd_old`
    rrdtool dump $i  > $bn.dump
    head -19 $bn.dump  > $bn.head
    head -3338 $bn.dump | tail -3319 > $bn.body
    tail -1 $bn.dump > $bn.tail
    cat $bn.head $bn.body $bn.body $bn.tail > $bn.dumpmod
    joe $bn.dumpmod # your favourite editor
    rrdtool restore $bn.dumpmod $bn.rrd
    rm $bn.head $bn.body $bn.tail $bn.dump $bn.dumpmod~
done

Please change the editor to the one you like and modify dump as described above. It's 5 minutes work.

Older rrdtool versions

In case you are using older rrdtool version like rrdtool-1.0.49 you can experience two problems.

1. there is no -watermark option causing the program to fail

2. rrd names like feels-out with "-" are not correctly interpreted, causing program to fail

Either update rrdtool (tested on rrdtool-1.3.4) or modify the source - remove the watermark option and remove the "-" from $rrdbnt variable at the end of MAIN.

Contact

Adam Pribyl: covex at lowlevel dot cz

Attachments