IMPORTANT! The server may go down soon - possibly permanently. Please read the latest post in Announcements and News

I strongly advise all users using my server for their web site to make alternative arrangements.

Outgoing mail is disabled because of the malware on the server. No new forum registrations are currently possible, and mail to the forum administrator will not work.

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

Alert if webcam image out-of-date

Hardware/software/hints and tips/discussion/webcam links etc
Posts: 1
Joined: Sat Sep 03, 2016 5:59 pm
Weather Station: Fine Offset
Operating System: Windows 10

Alert if webcam image out-of-date

Postby sarfend » Sat Sep 03, 2016 6:11 pm

Hi all,

I wonder if anyone has any suggestions on this one.

On my weather site, I have a display of my station data courtesy of Cumulus and the Saratoga PHP scripts. I also used Cumulus to upload a webcam image every 10 minutes.

It's not uncommon for something to go wrong - either the station stops collecting data, the PC locks.reboots or there's an error, which means my online data is out-of-date. I use a number of solutions to keep everything working (Cumulus Toolbox plus a PHP script that checks all's up to date. Everything works well, and I get email alerts if the weather data is out-of-date. The only thing I can't fix, is the webcam.

On occasion, the webcam capture software stops. Cumulus dutifully uploads whatever image it can find, so the website reports there's a recently-uploaded image, and the site displays an image.

Ideally, what I need is for Cumulus to spot that the image has a filestamp of >15 minutes, generate a tag, and I can detect that tag on the site.

My status page is here: - and using a site monitor, I can get an email alert if any errors appear on this page - what I can't do, is identify the age of the local jpg prior to Cumulus uploading it.

Anyone think of any clever ways around this?



User avatar
Posts: 2483
Joined: Tue Dec 09, 2008 1:37 pm
Weather Station: None !
Operating System: XP SP3 - honest
Location: Dudley, West Midlands, UK

Re: Alert if webcam image out-of-date

Postby beteljuice » Sat Sep 03, 2016 10:05 pm

Here's something the beteljuice put together many years ago ...

It uses three different images.
    Checking Camera Status (loading.jpg - 3 seconds)
    Actual webcam image (cam_1.jpg)
    Off-Line image (offline.jpg)

It uses both Javascript in the web page and a php script to do the timestamp check.

Code: Select all

<!-- web page code -->

function LoadImage1()

        uniq1 = Math.random();
   document.images.webcam1.src = "opt.php?uniq="+uniq1;


function StartDelay()
        window.setTimeout("LoadImage1();", 3000); // status image delay
        window.setInterval("LoadImage1();", 30000); // subsequent loop

function DoIt1()
        window.setTimeout("LoadImage1();", 8000);


<!-- then where you put the image -->

<img src="loading.jpg" id="webcam1" name="webcam1" onload="StartDelay()" width=320 height=240 border=1 style="border-color:#a4a4ff; border-style:solid;">

... and the php file (opt.php)

Code: Select all


// Time to wait for showing the offline image in seconds

// We don't want cached results
// Get the time that the uploaded image is on the server
$calctime=date("U") - filemtime("cam_1.jpg");

// If the uploaded image exists and its new enough
if (file_exists("cam_1.jpg") and $calctime<=$offtime){
} else {
// Else send the predefined off-line image

You do not have the required permissions to view the files attached to this post.
......................Imagine, what you will KNOW tomorrow !

Posts: 30
Joined: Sun Feb 13, 2011 7:12 pm
Weather Station: Davis Vantage Pro 2
Operating System: RaspBerry Pi Win 10 OSx
Location: Gulf Breeze, Fl., USA

Re: Alert if webcam image out-of-date

Postby f4phlyer » Mon Sep 12, 2016 10:01 pm

Not sure if Beteljuice answered your question but it seems you have more than basic skills. I would think it would be possible to create a script to check the image "metadata" for "create time/date" and compare it to current date, then handle the email the same. There are apps/programs to strip the metadata and put it in a file. Hope this helps
The Squeaky Sands Inn
CumulusMX on Raspberry π 3
WeatherUnderground KFLGULFB1

Return to “Webcams”

Who is online

Users browsing this forum: No registered users and 1 guest