#!/bin/csh -f # Weather station web page generation # # Copyright (C) 2011-2013 Jiri Pittner # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # # set serial=1 #this was losing data due to unreliable connection #it is necessary to accumulate the data locally #scp -p meteo@fox:/usr/local/alarm/meteo$serial/'*' /usr/local/www/pittnerovi/htdocs/meteo$serial/ set chataok=`/usr/sbin/fping vpnrpi1|grep -c alive` if ( $chataok == 0 ) then touch /tmp/chata_fail #we must not gather old data with current timestamp to historic list, so better exit now exit 1 else touch /tmp/chata_ok endif rm -f alldata.last scp -p meteo@vpnrpi1:/usr/local/alarm/meteo$serial/'*' /usr/local/www/pittnerovi/htdocs/meteo$serial/ umask 022 set zone=`date +%Z` set zoneshift=`date +%z` set zonesec=`echo $zoneshift|awk '{print $1*36}'` cd /usr/local/www/pittnerovi/htdocs/meteo$serial/ cat <index.html Meteostanice Blovice

Weather station Blovice

(Located at Rohata close to Blovice, N49.5946675, E13.5196881, 417m altitude, Timezone $zone)


Temperature = ! cat temperature >>index.html echo ' C measured on ' >>index.html ls -l temperature|awk '{print $6,$7,$8}' >>index.html cat <>index.html
Relative Humidity = ! cat humidity >>index.html echo ' % measured on ' >>index.html ls -l humidity|awk '{print $6,$7,$8}' >>index.html cat <>index.html
Dew Point = ! cat dewpoint >>index.html echo ' C measured on ' >>index.html ls -l dewpoint|awk '{print $6,$7,$8}' >>index.html cat <>index.html
Pressure (sea level corrected) = ! cat pressurecorr >>index.html echo ' hPa measured on ' >>index.html ls -l pressurecorr|awk '{print $6,$7,$8}' >>index.html cat <>index.html
Wind speed average = ! awk '{print $2}' < wind >>index.html echo 'm/s, gusts = ' >>index.html awk '{print $2}' < windgusts >>index.html echo 'm/s, azimuth = ' >>index.html awk '{print $1}' < wind >>index.html echo 'degs measured on ' >>index.html ls -l wind|awk '{print $6,$7,$8}' >>index.html cat <>index.html
Rain intensity = ! cat rain >>index.html echo ' mm/h measured on ' >>index.html ls -l rain|awk '{print $6,$7,$8}' >>index.html cat <>index.html
Time of last precipitation = ! ls -l rainlast|awk '{print $6,$7,$8}' >>index.html echo '' >>index.html cat <>index.html
Rain cumulative daily = ! cat raindaily >>index.html echo ' mm measured on ' >>index.html ls -l raindaily|awk '{print $6,$7,$8}' >>index.html cat <>index.html
Rain cumulative weekly = ! cat rainweekly >>index.html echo ' mm measured on ' >>index.html ls -l rainweekly|awk '{print $6,$7,$8}' >>index.html cat <>index.html
Temperature inside the rain gauge = ! cat temprain >>index.html echo ' C measured on ' >>index.html ls -l temprain|awk '{print $6,$7,$8}' >>index.html cat <>index.html
Illuminance (of a vertical surface in shadow) = ! cat light >>index.html echo ' lx measured on ' >>index.html ls -l light|awk '{print $6,$7,$8}' >>index.html cat <>index.html

We contribute data to the www.JAKBUDE.net and www.IN-POCASI.cz projects.

CHMI radar and amateur meteodata over Google maps

Links to professional local forecast services: CHMI , MEDARD , METEOPRESS ,

My favorite global forecast service YR.NO .

! #for in-pocasi, e-pocasi echo -n `date '+%d.%m.%y|%H:%M|'` >in-pocasi.html (cat temperature; echo -n '|'; cat humidity; echo -n '|';cat pressurecorr; echo -n '|'; awk '{printf("%s|%s",$2,$1);}' > in-pocasi.html #add a record (date +%s; cat temperature; echo ' '; cat humidity; echo ' ';cat pressurecorr; echo ' ';cat light; echo ' ';cat dewpoint; echo ' '; cat wind; echo ' '; cat windgusts; echo ' '; cat rain; echo ' '; cat raindaily; echo ' '; echo '0 '; cat temprain; echo ' '; cat temperature_IN; echo ' '; cat water1; echo ' '; cat water2; echo ' '; ) | /usr/local/bin/collect 19 >>alldata.last awk < alldata.last 'NF == 19' | sort -n -k 1,1 > record #merge the recent data to historic records set lasttime=`tail -1 alldata |awk '{print $1}'` awk < record >> alldata '$1 > '$lasttime #generate graphics (filter out lines where some field was missing due to lack of file locking) tail -n 3400 alldata |awk 'NF>=14' >alldata.dat chmod 600 alldata.dat gnuplot <gnuplot.log set terminal gif size 1280,512 set xlabel 'Date/Time' set xdata time set timefmt "%s" set grid set ylabel 'Temperature [C]' set output 'temperature.gif' plot "alldata.dat" using (\$1+$zonesec):2 title 'Temperature' with lines, "alldata.dat" using (\$1+$zonesec):6 title 'Dew Point' with lines set output 'temperature_rg.gif' plot "alldata.dat" using (\$1+$zonesec):14 title 'Temperature in the Rain Gauge' with lines set output 'humidity.gif' set ylabel 'Relative Humidity [%]' plot "alldata.dat" using (\$1+$zonesec):3 title 'Humidity' with lines set output 'pressure.gif' set ylabel 'Pressure [hPa]' plot "alldata.dat" using (\$1+$zonesec):4 title 'Pressure' with lines set output 'windspeed.gif' set ylabel 'Wind speed [m/s]' plot "alldata.dat" using (\$1+$zonesec):8 title 'Wind speed (average)' with lines, "alldata.dat" using (\$1+$zonesec):10 title 'Wind speed (gusts)' with lines set output 'winddirection.gif' set ylabel 'Wind azimuth [degrees]' plot "alldata.dat" using (\$1+$zonesec):7 title 'Wind azimuth' with lines set output 'rain.gif' set ylabel 'Precipitation (intensity) [mm(/h)]' set yrange [0:] plot "alldata.dat" using (\$1+$zonesec):11 title 'Precipitation intensity' with lines, "alldata.dat" using (\$1+$zonesec):12 title 'Precipitation cumulative daily' with lines set output 'illuminance.gif' set ylabel 'Illuminance [lx]' #set logscale y #set yrange [0.1:] plot "alldata.dat" using (\$1+$zonesec):5 title 'Illuminance' with lines ! #link graphics to html cat <>index.html









! #end index file cat <>index.html

Meteostation technical data: home-brew construction, controlled by Atmel ATmega128, using Sensirion SHT75 temperature and humidity sensor, Motorola MPX4115A pressure sensor, LDR07-10 photoresistors, La Crosse TX20 anemometer (not heated - under certain conditions azimuth or speed can freeze), and rain gauge based on the TFA 47.3003 with self-made heating, with 433MHz wireless transmission to an embedded linux server.
Description of the meteostation construction and firmware source code can be found here , together with other electronic constructions.

My hobby page
TOP ! #prepare picture for internal use cd /usr/local/www/meteo gnuplot <gnuplot.log1 set terminal gif size 1280,512 set xlabel 'Date/Time' set xdata time set timefmt "%s" set grid set ylabel 'Temperature [C]' set output 'chatatemp.gif' plot "/usr/local/www/pittnerovi/htdocs/meteo$serial/alldata.dat" using (\$1+$zonesec):15 title 'Chata inside' with lines set output 'studna.gif' set ylabel 'Volume [m3]' plot "/usr/local/www/pittnerovi/htdocs/meteo$serial/alldata.dat" using (\$1+$zonesec):17 title 'Studna' with lines ! scp chatatemp.gif studna.gif meteo@fox:/usr/local/alarm/www/127.6.6.6/alarm.pittnerovi.com/htdocs rm -f alldata.dat