Welcome to the Cumulus Support forum.

Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024

Cumulus MX V4 beta test release 4.0.0 (build 4018) - 28 March 2024

Legacy Cumulus 1 release v1.9.4 (build 1099) - 28 November 2014 (a patch is available for 1.9.4 build 1099 that extends the date range of drop-down menus to 2030)

Download the Software (Cumulus MX / Cumulus 1 and other related items) from the Wiki

Added a PondCam

Hardware/software/hints and tips/discussion/webcam links etc
User avatar
gluepack
Posts: 460
Joined: Tue 22 Jan 2013 9:20 pm
Weather Station: PCE-FWS 20
Operating System: Win 7 Pro
Location: Zlatina, Bulgaria

Re: Added a PondCam

Post by gluepack »

Oh, thanks but I have switched to jQuery with...

Code: Select all

<script type="text/javascript">
			 $(document).ready(function() {
			window.setInterval("refreshCamera();", 10000); // ten seconds interval
			});
			var url = 'http://www.jerbils.info/current.jpg?refresh=';
			var forcerefresh = 0;
			function refreshCamera()
			{
			   forcerefresh = forcerefresh + 1;
			   $('#pondcam').attr('src',url + forcerefresh);
				}
			</script>
			<img id='pondcam' alt='Loading...' />
With the provisos added to my previous post.
Image

PWS links: WundergroundIVARNAPR3CWOP/APRSE(W)2048PWSWeatherZLATINABGAwekas10631Twitter@Zlatina_weather
Station type: PCE-FWS 20…Webcam link: View south to edge of Provadisko plateau
User avatar
mcrossley
Posts: 12695
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Added a PondCam

Post by mcrossley »

Just add a call to refreshCamera() into your onload function to perform the initial image load.

Code: Select all

<script type="text/javascript">
$(document).ready(function() {
    refreshCamera();
    window.setInterval(refreshCamera, 10000); // ten seconds interval
});
var url = 'http://www.jerbils.info/current.jpg?refresh=';
var forcerefresh = 0;
function refreshCamera() {
    forcerefresh = forcerefresh + 1;
    $('#pondcam').attr('src',url + forcerefresh);
}
</script>
User avatar
gluepack
Posts: 460
Joined: Tue 22 Jan 2013 9:20 pm
Weather Station: PCE-FWS 20
Operating System: Win 7 Pro
Location: Zlatina, Bulgaria

Re: Added a PondCam

Post by gluepack »

Phew, thanks very much for that. It is working fine now.

The two variables have to be set up front though?

I tried your other code mod but that didn't have any effect, IE and FF still didn't refresh.

Thanks for all your help.


Err... there is still something weird. With IE, I will do a manual refresh and it will show the "current" image and then will switch back to one from a couple of hours ago and update that. Has it retained these images in local cache? Surely the ? parameter shouldn't have any effect on which image is shown it should still pull the current image from the host shouldn't it? (both FF and IE were doing it earlier but FF seems ok now). And, this only happened when Chrome and FF were up showing the same web page. When I closed the tab in both of those and refreshed the IE version, it updated normally. It still begs the question of whether I have two hours worth of images (about 35mb) sitting on my hard drive somewhere.
Image

PWS links: WundergroundIVARNAPR3CWOP/APRSE(W)2048PWSWeatherZLATINABGAwekas10631Twitter@Zlatina_weather
Station type: PCE-FWS 20…Webcam link: View south to edge of Provadisko plateau
Manzara
Posts: 32
Joined: Thu 23 May 2013 8:50 am
Weather Station: WH1080
Operating System: XP
Location: Cyprus
Contact:

Re: Added a PondCam

Post by Manzara »

Looking at your pics you say you have put polarizing film over the lens and not much change. Have you rotated the filter in all directions to get the maximum polarizing effect?
User avatar
beteljuice
Posts: 3292
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: W10 - Threadripper 16core, etc
Location: Dudley, West Midlands, UK

Re: Added a PondCam

Post by beteljuice »

Hmm ... with this code:

Code: Select all

var url = 'http://www.jerbils.info/current.jpg?refresh=';
var forcerefresh = 0;
function refreshCamera() {
    forcerefresh = forcerefresh + 1;
    $('#pondcam').attr('src',url + forcerefresh);
forcerefresh is always a definitive number (starting 0, 1, 2, 3 etc.) and thus the url could well be in your browser(s) cache.

Make it a timestamp instead.
BTW - there is no need for refresh=, just .jpg?value
Image
......................Imagine, what you will KNOW tomorrow !
User avatar
gluepack
Posts: 460
Joined: Tue 22 Jan 2013 9:20 pm
Weather Station: PCE-FWS 20
Operating System: Win 7 Pro
Location: Zlatina, Bulgaria

Re: Added a PondCam

Post by gluepack »

The wonders of software... with the change from summertime, Yawcam doesn't seem to have fathomed it out. I don't even know where it gets the time from, certainly not my system as that is correct.
Image

PWS links: WundergroundIVARNAPR3CWOP/APRSE(W)2048PWSWeatherZLATINABGAwekas10631Twitter@Zlatina_weather
Station type: PCE-FWS 20…Webcam link: View south to edge of Provadisko plateau
User avatar
gluepack
Posts: 460
Joined: Tue 22 Jan 2013 9:20 pm
Weather Station: PCE-FWS 20
Operating System: Win 7 Pro
Location: Zlatina, Bulgaria

Re: Added a PondCam

Post by gluepack »

Well... I had to shut down the system that runs Cumulus and Yawcam with a long power button. In doing so I lost both the Cumulus and Yawcam ini files. I re-established the one for Cumulus, no problem, as I have had to do it before and so now keep an up-to-date copy. However, I had to set up the FTP for Yawcam again and, my memory being what it is, I couldn't remember the file name for the stream that Yawcam picks up. Anyway, I eventually figured it out but now the problem is that...
...running under Win 8.1 on the desktop system that Cumulus, etc. runs on, the pond cam image displays and refreshes on my website under Chrome, no problem, but
... running under Win 7 on my laptop, the pond cam image displays initially but then (presumably at refresh) I get white space where the image should be and it never returns until I manually refresh the page.

http://www.jerbils.info/saratoga/wxpondcam.php

Any ideas?

Hah! after just saying that I returned to my laptop and it was displaying/refreshing ok. However, I manually refreshed and the same problem, it shows the image for a few seconds then goes to white space. When I said "it was displaying/refreshing ok" it was remaining on the screen. Now it is refreshing briefly and then disappearing and eventually, ahhhh and after 5 or so minutes of this, it is remaining on the screen.
Image

PWS links: WundergroundIVARNAPR3CWOP/APRSE(W)2048PWSWeatherZLATINABGAwekas10631Twitter@Zlatina_weather
Station type: PCE-FWS 20…Webcam link: View south to edge of Provadisko plateau
User avatar
beteljuice
Posts: 3292
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: W10 - Threadripper 16core, etc
Location: Dudley, West Midlands, UK

Re: Added a PondCam

Post by beteljuice »

Not having any problems with IE8 or FireFox.

You never changed your code to date or random as I suggested above. So you could have cache problems.
Image
......................Imagine, what you will KNOW tomorrow !
User avatar
gluepack
Posts: 460
Joined: Tue 22 Jan 2013 9:20 pm
Weather Station: PCE-FWS 20
Operating System: Win 7 Pro
Location: Zlatina, Bulgaria

Re: Added a PondCam

Post by gluepack »

..
Image

PWS links: WundergroundIVARNAPR3CWOP/APRSE(W)2048PWSWeatherZLATINABGAwekas10631Twitter@Zlatina_weather
Station type: PCE-FWS 20…Webcam link: View south to edge of Provadisko plateau
Post Reply