Welcome to the Cumulus Support forum.

Latest Cumulus MX release v3.4.0 (build 3064) - 19 February 2020.
    Legacy Cumulus 1 release v1.9.4 (build 1099) - 28 November 2014

    See the Wiki for downloading either version.

    Weather34 Webcam Problem

    Other discussion about creating web sites for Cumulus that doesn't have a specific subforum

    Moderator: daj

    Post Reply
    acatalano
    Posts: 91
    Joined: Tue 16 Jun 2015 2:07 pm
    Weather Station: Davis VP2
    Operating System: Raspian, Win7 Pro
    Location: Boulder, CO
    Contact:

    Weather34 Webcam Problem

    Post by acatalano » Tue 23 Jan 2018 5:12 pm

    I've installed the Weather34.com templates as an addition (under "Console") to the Saratoga Templates on my website at: www.boulderwx.com. The setup was remarkably easy IMHO. The only problem I am having is with the webcam display. As I recall the php file for the webcam was preconfigured for WU which is at best flaky. WU has be completely unreliable as regards accepting uploads of image files and I've just given up on them. The line of code for the WU webcam path was fairly complex for a php novice like me, but I took a stab at editing out the WU stuff and simply tried pointing it at the root directory of my site where lay the uploaded image.jpg file. I've tried various path specifications including external paths to the file without success. My guess is I've messed a line of php code in the webcamsmall.php file. Any suggestions for a non-WU path spec?
    Best Regards,
    Anthony Catalano
    Boulder, Colorado, USA
    Webcam & Weather at:
    http://www.boulderwx.com, http://www.apcat.org, http://www.boulderweather.org
    Blitzortung Lightning Detector Station 1965

    User avatar
    ConligWX
    Posts: 751
    Joined: Mon 19 May 2014 10:45 pm
    Weather Station: Davis VPro2 Plus +DFARS
    Operating System: MeteoBridge Nano SD
    Location: Bangor, NI
    Contact:

    Re: Weather34 Webcam Problem

    Post by ConligWX » Tue 23 Jan 2018 8:21 pm

    Firstly you maybe able to grab an image from your webcam.

    this is what I do.

    I run a script each minute to grab an image. (dependant on Make/Model etc) using wget command. i then add some Weather Data (processed template from CumulusMX) and assign it a value. along with another value (date time etc)

    I then use Imagik's "convert" to create layers, use a font, and write some code(values) to the layers. the layers are just top and bottom of my screen.

    I then copy the image and convert it below 150kb for WU. I then ftp it to WU.

    if you can grab the snapshot image from your camera, rather than WU you will be able to do it this way too.

    minute.sh

    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=username --http-password=password "http://x.x.x.x/cgi/jpg/image.cgi" -O "/share/xxx/htdocs/weather/sky1.jpg";
    # next 2 lines add weather info
    testdata="$(/bin/cat /share/xxxxxx/htdocs/weather/camdata.txt)";
    testdata1=`date +"%A %d-%b-%Y %R %Z"`;
    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/xxxxxx/db_backup/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/xxxxxx/htdocs/weather/sky1.jpg  /share/xxxxxx/htdocs/weather/sky.jpg
    
    # add timestamp to filename for timelapse
    #cp /share/xxxxxx/htdocs/weather/sky.jpg /share/xxxxxx/htdocs/weather/image-history/video@"$tday".jpg;
    #cp -f /share/xxxxxx/htdocs/weather/sky.jpg /share/xxxxxx/htdocs/weather/image1.jpg
    
    # convert image.jpg to 150kb for WUnderground
    convert /share/xxxxxx/htdocs/weather/sky.jpg -define jpeg:extent=150kb /share/xxxxxx/htdocs/weather/image.jpg
    
    # ftp webcam to wunderground
    # lftp -e 'put /share/xxxxxx/htdocs/weather/image.jpg; bye' -u username,password webcam.wunderground.com
    lftp -e 'put /share/xxxxxx/htdocs/weather/image.jpg; bye' -u username,password webcam.wunderground.com
    it then ends up like this: https://www.conligwx.org/wxwebcam.php

    to test this script you would need to change paths/usernames etc abd run each line individually so to see the output works.

    what webcam do you have?
    Regards Simon

    https://www.conligwx.org - @conligwx
    Davis Vantage Pro2 Plus + DFARS - Meteobrige Nano SD + Saratoga Templates

    acatalano
    Posts: 91
    Joined: Tue 16 Jun 2015 2:07 pm
    Weather Station: Davis VP2
    Operating System: Raspian, Win7 Pro
    Location: Boulder, CO
    Contact:

    Re: Weather34 Webcam Problem

    Post by acatalano » Tue 23 Jan 2018 9:30 pm

    Thanks for the suggestions. I do essentially the same thing with a Python script (adding text etc.,) and upload to my site. I used to do this for WU until it became so unreliable. It seems I have gotten the "only 50 users allowed" when connecting via FTP and then it interferes with communication with my own site, so I've just written off WU. I might just remove the weather station from WU altogether. As it is I have the image.jpg sitting right next to the CU-X7X7 files so it seems that WU is the weak link in the chain and walking all around the barn to come back in the front door unnecessary. (Sorry for too many metaphors). The code for webcamsmall.php is this:

    Code: Select all

    <style>
    .webcam{
    -webkit-border-radius:4px;	-moz-border-radius:4px;	-o-border-radius:4px;	-ms-border-radius:4px;border-radius:4px;border:solid RGBA(84, 85, 86, 1.00) 2px;	width:275px; 	height:145px;}
    </style>
    <!-- HOMEWEATHER STATION TEMPLATE SIMPLE WEBCAM -add your url as shown below do NOT delete the class='webcam' !!! -->
    <img src="https://icons.wunderground.com/webcamramdisk/d/j/djchids/1/current.jpg?version=<?php echo filemtime("https://icons.wunderground.com/webcamramdisk/d/j/djchids/1/current.jpg");?>" alt="weathercam" class="webcam">
    </span>
    I have altered the img src to this:

    Code: Select all

    <style>
    .webcam{
    -webkit-border-radius:4px;	-moz-border-radius:4px;	-o-border-radius:4px;	-ms-border-radius:4px;border-radius:4px;border:solid RGBA(84, 85, 86, 1.00) 2px;	width:275px; 	height:145px;}
    </style>
    <!-- HOMEWEATHER STATION TEMPLATE SIMPLE WEBCAM -add your url as shown below do NOT delete the class='webcam' !!! -->
    <img src = "image.jpg"> 
    </span>
    <alt="weathercam" class="webcam">
    So to my eye it looks as if I've just altered the img src line of code. I think I will give editing the file another go, I probably have a missing backslash somewhere..
    Best Regards,
    Anthony Catalano
    Boulder, Colorado, USA
    Webcam & Weather at:
    http://www.boulderwx.com, http://www.apcat.org, http://www.boulderweather.org
    Blitzortung Lightning Detector Station 1965

    User avatar
    steve
    Cumulus Author
    Posts: 26717
    Joined: Mon 02 Jun 2008 6:49 pm
    Weather Station: None
    Operating System: None
    Location: Vienne, France
    Contact:

    Re: Weather34 Webcam Problem

    Post by steve » Tue 23 Jan 2018 9:37 pm

    Your

    Code: Select all

    <img src = "image.jpg"> 
    </span>
    <alt="weathercam" class="webcam">
    Should be

    Code: Select all

    <img src = "image.jpg" alt="weathercam" class="webcam">
    </span>
    Note that I am simply correcting your syntax, I have no idea whether it will do what you intend!
    Steve

    acatalano
    Posts: 91
    Joined: Tue 16 Jun 2015 2:07 pm
    Weather Station: Davis VP2
    Operating System: Raspian, Win7 Pro
    Location: Boulder, CO
    Contact:

    Re: Weather34 Webcam Problem

    Post by acatalano » Tue 23 Jan 2018 10:20 pm

    Yes, was missing a slash at the end..There are two files (at least so far) one is webcamsmall.php, the other cam.php Here is the working code for each with the image.jpg in root... first cam.php for a centered 4:3 image.jpg:

    Code: Select all

    <style>
    .webcamlarge{
    -webkit-border-radius:4px;	-moz-border-radius:4px;	-o-border-radius:4px;	-ms-border-radius:4px;border-radius:4px;border:solid RGBA(84, 85, 86, 1.00) 2px;	width:775px; 	height:420px;}
    </style>
    <!-- HOMEWEATHER STATION TEMPLATE SIMPLE Large WEBCAM -add your url as shown below do NOT delete the class='webcamlarge' !!! -->
    <p style="text-align:center;"><img src = "/image.jpg" width="560" height="420" /> </p> 
    
    <alt="webcam"  class="webcamlarge" >
    </span>
    Then for webcamsmall.php:

    Code: Select all

    <style>
    .webcam{
    -webkit-border-radius:4px;	-moz-border-radius:4px;	-o-border-radius:4px;	-ms-border-radius:4px;border-radius:4px;border:solid RGBA(84, 85, 86, 1.00) 2px;	width:275px; 	height:145px;}
    </style>
    <!-- HOMEWEATHER STATION TEMPLATE SIMPLE WEBCAM -add your url as shown below do NOT delete the class='webcam' !!! -->
    <img src = "/image.jpg" width="200" height="150" /> 
    
    <alt="weathercam" class="webcam">
    Best Regards,
    Anthony Catalano
    Boulder, Colorado, USA
    Webcam & Weather at:
    http://www.boulderwx.com, http://www.apcat.org, http://www.boulderweather.org
    Blitzortung Lightning Detector Station 1965

    weatherist34
    Posts: 105
    Joined: Wed 13 Apr 2016 11:09 am
    Weather Station: Davis Vantage Pro2 Plus
    Operating System: OSX High Sierra
    Contact:

    Re: Weather34 Webcam Problem

    Post by weatherist34 » Tue 23 Jan 2018 10:47 pm

    almost there you need to keep the alt="weathercam" class="webcam" within the img src script

    <style>
    .webcam{
    -webkit-border-radius:4px; -moz-border-radius:4px; -o-border-radius:4px; -ms-border-radius:4px;border-radius:4px;border:solid RGBA(84, 85, 86, 1.00) 2px; width:275px; height:145px;}
    </style>
    <!-- HOMEWEATHER STATION TEMPLATE SIMPLE WEBCAM -add your url as shown below do NOT delete the class='webcam' !!! -->
    <img src = "/image.jpg" width="200" height="150" />

    <alt="weathercam" class="webcam">


    to


    <style>
    .webcam{
    -webkit-border-radius:4px; -moz-border-radius:4px; -o-border-radius:4px; -ms-border-radius:4px;border-radius:4px;border:solid RGBA(84, 85, 86, 1.00) 2px; width:275px; height:145px;}
    </style>
    <!-- HOMEWEATHER STATION TEMPLATE SIMPLE WEBCAM -add your url as shown below do NOT delete the class='webcam' !!! -->
    <img src = "/image.jpg" alt="weathercam" class="webcam"/>

    acatalano
    Posts: 91
    Joined: Tue 16 Jun 2015 2:07 pm
    Weather Station: Davis VP2
    Operating System: Raspian, Win7 Pro
    Location: Boulder, CO
    Contact:

    Re: Weather34 Webcam Problem

    Post by acatalano » Wed 24 Jan 2018 2:10 pm

    Thank You! Not sure why but it seems to be working with the error, but I shall make it right.
    Best Regards,
    Anthony Catalano
    Boulder, Colorado, USA
    Webcam & Weather at:
    http://www.boulderwx.com, http://www.apcat.org, http://www.boulderweather.org
    Blitzortung Lightning Detector Station 1965

    acatalano
    Posts: 91
    Joined: Tue 16 Jun 2015 2:07 pm
    Weather Station: Davis VP2
    Operating System: Raspian, Win7 Pro
    Location: Boulder, CO
    Contact:

    Re: Weather34 Webcam Problem

    Post by acatalano » Wed 24 Jan 2018 3:27 pm

    I corrected the webcamsmall.php & cam.php code to add the alt="weathercam" class="webcam" within the src script boundary. This appears to "force" the image into a 16:9 format instead of its native 4:3 format, thereby stretching the image horizontally. Whereas, if I leave out alt="weathercam" class="webcam", the image adopts its 4:3 format. I assume the code I've left out defines the image format.

    To demonstrate I've left out the alt="weathercam" class="webcam" in one website, boulderwx.com>Station Console but put it in at apcat.org
    Best Regards,
    Anthony Catalano
    Boulder, Colorado, USA
    Webcam & Weather at:
    http://www.boulderwx.com, http://www.apcat.org, http://www.boulderweather.org
    Blitzortung Lightning Detector Station 1965

    User avatar
    ConligWX
    Posts: 751
    Joined: Mon 19 May 2014 10:45 pm
    Weather Station: Davis VPro2 Plus +DFARS
    Operating System: MeteoBridge Nano SD
    Location: Bangor, NI
    Contact:

    Re: Weather34 Webcam Problem

    Post by ConligWX » Thu 25 Jan 2018 12:17 am

    acatalano wrote:I corrected the webcamsmall.php & cam.php code to add the alt="weathercam" class="webcam" within the src script boundary. This appears to "force" the image into a 16:9 format instead of its native 4:3 format, thereby stretching the image horizontally. Whereas, if I leave out alt="weathercam" class="webcam", the image adopts its 4:3 format. I assume the code I've left out defines the image format.

    To demonstrate I've left out the alt="weathercam" class="webcam" in one website, boulderwx.com>Station Console but put it in at apcat.org

    the default is:

    Code: Select all

    <style>
    .webcam{
    -webkit-border-radius:4px;	-moz-border-radius:4px;	-o-border-radius:4px;	-ms-border-radius:4px;border-radius:4px;border:solid RGBA(84, 85, 86, 1.00) 2px;	width:275px; 	height:145px;}
    </style>
    <!-- HOMEWEATHER STATION TEMPLATE SIMPLE WEBCAM -add your url as shown below do NOT delete the class='webcam' !!! -->
    <img src="https://icons.wunderground.com/webcamramdisk/d/j/djchids/1/current.jpg?version=<?php echo filemtime("https://icons.wunderground.com/webcamramdisk/d/j/djchids/1/current.jpg");?>" alt="weathercam" class="webcam">
    </span>
    this message in the code:

    <!-- HOMEWEATHER STATION TEMPLATE SIMPLE WEBCAM -add your url as shown below do NOT delete the class='webcam' !!! -->

    it is there to keep the ratio the same for the window and the image contained inside of it. thats all.

    your http://www.apcat.org/cam.php will also have to be changed if you dont want to force 16:9 and use you own 4:3 format.

    Brian has said before, you may need to tweak the code to fit your needs. I have to change some things myself to get links to point where i want.
    Regards Simon

    https://www.conligwx.org - @conligwx
    Davis Vantage Pro2 Plus + DFARS - Meteobrige Nano SD + Saratoga Templates

    acatalano
    Posts: 91
    Joined: Tue 16 Jun 2015 2:07 pm
    Weather Station: Davis VP2
    Operating System: Raspian, Win7 Pro
    Location: Boulder, CO
    Contact:

    Re: Weather34 Webcam Problem

    Post by acatalano » Thu 25 Jan 2018 4:54 pm

    Thanks very much for the explanation. I have a much better understanding now of how the code influences behaviour. It took some experimentation with the image dimensions to get it to fit.
    Best Regards,
    Anthony Catalano
    Boulder, Colorado, USA
    Webcam & Weather at:
    http://www.boulderwx.com, http://www.apcat.org, http://www.boulderweather.org
    Blitzortung Lightning Detector Station 1965

    Post Reply