Please read the posts in the Announcements section about the current status of Cumulus development now that I have retired

Please read this post before posting

Latest Cumulus release v1.9.4 (build 1099) - Nov 28 2014
Latest Cumulus MX release - v3.0.0 build 3043 Jan 20 2017. See this post for download

Bash scrip

Hardware/software/hints and tips/discussion/webcam links etc
dazza1223
Posts: 319
Joined: Sun Jan 25, 2015 8:41 pm
Weather Station: davis vantage vue
Operating System: raspberry pi 3
Location: worthing
Contact:

Bash scrip

Postby dazza1223 » Tue Jul 10, 2018 11:26 pm

Hi has any one made bash scrip to take snapshot off a ip cam and over lay in with data?

User avatar
Toxic17
Posts: 780
Joined: Mon May 19, 2014 10:45 pm
Weather Station: Davis VPro2 Plus
Operating System: Deb 9.4 Stretch
Location: Bangor, NI
Contact:

Re: Bash scrip

Postby Toxic17 » Tue Jul 10, 2018 11:56 pm

yep :)

I run mine every minute I think with crontab. something like this:

camdataT.txt Template processed realtime.

Code: Select all

Temp: <#temp>°C - Press: <#press> hPa - Hum: <#hum>% - Wind: <#wspeed> mph(<#currentwdir>) - Rain: <#rfall> mm - UV Index: <#UV> - SolarRad: <#SolarRad> W/m² - CloudBase: <#cloudbase>.


then minute script

Code: Select all

#!/bin/sh
#
#set variable yday to be like 20100208
#
#tday=$(date -d today +%Y%m%d%H%M%S);
#stamp=$(date '+DATE: %d/%m/%y%nTIME:%H:%M:%S');
tday=$(date +%Y%m%d%H%M%S);
#stamp=$(date +%Y%m%d);
#
# get weather image
wget --auth-no-challenge --http-user=xxxxxx --http-password=xxxxxxxx "http://xxx.xxx.xx.xxx/cgi/jpg/image.cgi" -O "/share/weather/sky1.jpg";
# next 2 lines add weather info
testdata="$(/bin/cat /share/weather/camdata.txt)";
testdata1=`date +"%A %d-%b-%Y %R %Z"`;

# add layers and text to image
convert -fill RoyalBlue4 -draw "fill-opacity 0.4 rectangle 0 0 1280 25" \
-fill red -draw "fill-opacity 0.6 rectangle 0 26 1280 27" \
-fill RoyalBlue4 -draw "fill-opacity 0.7 rectangle 0 695 1280 720" \
-fill red -draw "fill-opacity 0.6 rectangle 0 693 1280 694" \
-fill white -pointsize 18 -font /share/script/arialbold.ttf -draw "text 10,20 'Conlig Weather Station:  $testdata1 - ICODOWNN2 - www.conligwx.org'" \
-fill yellow -pointsize 18 -draw "text 10,715 '$testdata'" /share/weather/sky1.jpg  /share/weather/skywebcam.jpg

# convert image.jpg to 150kb for WUnderground
convert /share/weather/skywebcam.jpg -define jpeg:extent=150kb /share/weather/image.jpg

# ftp webcam to wunderground
lftp -e 'put /share/weather/image.jpg; bye' -u xxxxxxxx,passwordxxxx webcam.wunderground.com -d


Image
Regards Simon

https://www.conligwx.org
https://www.conligwx.org/pws/
https://twitter.com/conligwx
Davis Vantage Pro2+ - CumulusMX v3.0.0 (build 3043) + Saratoga/PWS
Image

dazza1223
Posts: 319
Joined: Sun Jan 25, 2015 8:41 pm
Weather Station: davis vantage vue
Operating System: raspberry pi 3
Location: worthing
Contact:

Re: Bash scrip

Postby dazza1223 » Wed Jul 11, 2018 9:14 am

o Simon thank you for that!!! i did have a Bash scrip but it keep crashing and makeing the imges go all funny? i will try and add yours..... but i will pont out this tho i do think it very nice that some ppl on here do share there hard work and give it to other and includeing you :D


Return to “Webcams”

Who is online

Users browsing this forum: No registered users and 4 guests