And what shall I say?
It does the job like a charme.
Installing ImageMagick was a bit tricky, because
apt-get install imagemagick
apt-get install libc6
did not work.
It always appeared an error message saying that certain packages are not available on the debain security sources.
Then I tried the hard way with make make install.
That worked.
Now meteohub picks up a webcam shot every ten minutes over the internal network and with ImageMagick stamps in sensor value from the weather station.
That´s done automatically with a shell script (below)
You can have a look at the result here:::::>
http://honsolgen.de/
Click on buttons "HEUTE" or "GESTERN"
You will see running webcam shots of today and yesterday with the stamped weather values.
I don´t know, but because of the install problems,
it would be nice if Boris could add ImageMagick to the orginal meteohub image. It only takes about additional 40MB´s, not so much.
Code: Select all
#!/bin/bash
export LANG=de_DE.UTF-8
/usr/bin/ncftpget -C -u user -p password ftp://192.168.1.141/snap_00.jpg /data/myweb/webcam.jpg
cd /data/myweb
nc localhost 5558 > sensordata.txt
TEXT=$(awk '/actual_th0_temp_c/' sensordata.txt > sensoractual.txt)
CAUSSEN=$(sed -e 's/actual_th0_temp_c/Lufttemperatur: /g' < sensoractual.txt)
DATUM=$(date +'%d/%m/%Y')
CAUSSEN=" $DATUM | $CAUSSEN"
TEXT=$(awk '/actual_wind0_speed_kmh/' sensordata.txt > sensorwind.txt)
WINDSPEED=$(sed -e 's/actual_wind0_speed_kmh/Wind: /g' < sensorwind.txt)
WINDRICHTUNG=$(awk 'NR==103 { print $2 }' sensordata.txt)
OUTPUT=webcam.jpg
convert webcam.jpg -font /usr/share/fonts/truetype/n019003l.pfb -pointsize 16 -fill yellow -undercolor '#000000' -gravity None -annotate +156+13 " | $CAUSSEN\\°\\C | $WINDSPEED km/h - $WINDRICHTUNG " -fill black -undercolor '#000000' -draw 'rectangle 0,16 638,18' "$OUTPUT"
for file in webcam.jpg; do cp -p -- "$file" "$(ls -l --time-style=long-iso "$file" | cut -d " " -s -f 6,7 | sed "s/:/-/g" | sed "s/ /_/g")_webcam.jpg"; done