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 4017) - 17 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

webcam

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

Moderator: daj

User avatar
dazza1223
Posts: 860
Joined: Sun 25 Jan 2015 8:41 pm
Weather Station: Davis Vantage Pro 2 plus
Operating System: Raspberry pi 4 (4gb)
Location: Worthing
Contact:

webcam

Post by dazza1223 »

hi all i have my webcam setup but erver so offen the webpage refresh and it ony got half as it will be in the middle of writing the jpg to a directory when the ajax refresh occurs, so instead of displaying a broken image

so here the js
file var t_webcam = 1 // interval in seconds
image_webcam = "/images/webcam.jpg" //name of the image
function Start_webcam() {
tmp_webcam = new Date();
tmp_webcam = "?"+tmp_webcam.getTime()
document.images["refreshwebcam"].src = image_webcam+tmp_webcam
setTimeout("Start_webcam()", t_webcam*1000)
}
Start_webcam();
Have fun and keep learning

dazza :D

https://www.davisworthing.co.uk

Image
User avatar
vaggos
Posts: 160
Joined: Sat 06 Feb 2010 7:00 pm
Weather Station: PROWEATHER STATION 1080
Operating System: XP SP3, win7, Win10
Location: Acharnes Athens Greece
Contact:

Re: webcam

Post by vaggos »

Try this:

Code: Select all

<IMG name="webcam" 
            width="240" height="177" alt="Please wait the image will appear soon" 
            src="../images/webcam.jpg" 
            border="0"></A> 
<SCRIPT language="JavaScript" type="text/javascript">
interval = 60000;
imgsrc = "../images/webcam.jpg"
tmp = new Date();
tmp = "?" + tmp.getTime();
document.images["webcam"].src = imgsrc + tmp;
setTimeout("Refresh()", interval);
}
Refresh();
Change the dimensions and the time of refresh (in msec)
Image
Acharnes Athens Greece Meteo station
http://www.meteoacharnes.gr
https://weather.meteoacharnes.gr/
Thanks Sandaysoft
User avatar
dazza1223
Posts: 860
Joined: Sun 25 Jan 2015 8:41 pm
Weather Station: Davis Vantage Pro 2 plus
Operating System: Raspberry pi 4 (4gb)
Location: Worthing
Contact:

Re: webcam

Post by dazza1223 »

so do i put that in the js or html mate
Have fun and keep learning

dazza :D

https://www.davisworthing.co.uk

Image
User avatar
vaggos
Posts: 160
Joined: Sat 06 Feb 2010 7:00 pm
Weather Station: PROWEATHER STATION 1080
Operating System: XP SP3, win7, Win10
Location: Acharnes Athens Greece
Contact:

Re: webcam

Post by vaggos »

dazza1223 wrote:so do i put that in the js or html mate
It's script and put it i the place you want to have your webcam image in .html file.
Image
Acharnes Athens Greece Meteo station
http://www.meteoacharnes.gr
https://weather.meteoacharnes.gr/
Thanks Sandaysoft
User avatar
dazza1223
Posts: 860
Joined: Sun 25 Jan 2015 8:41 pm
Weather Station: Davis Vantage Pro 2 plus
Operating System: Raspberry pi 4 (4gb)
Location: Worthing
Contact:

Re: webcam

Post by dazza1223 »

so it gose in the html then?

Code: Select all

[attachment=0]webcam.rar[/attachment]
You do not have the required permissions to view the files attached to this post.
Have fun and keep learning

dazza :D

https://www.davisworthing.co.uk

Image
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: webcam

Post by beteljuice »

Like dazza vaggos said ... (oops)

replace your line #67

Code: Select all

     <img src="/images/webcam.jpg"  width="1000" height="690" name="refreshwebcam"><SCRIPT src="js/webcam_refresh.js" language="JavaScript" type="text/javascript" ></SCRIPT>
With (modified for your image size):

Code: Select all

<IMG name="webcam"
            width="1000" height="690" alt="Please wait the image will appear soon"
            src="../images/webcam.jpg"
            border="0"></A>
<SCRIPT language="JavaScript" type="text/javascript">
interval = 60000;
imgsrc = "../images/webcam.jpg"
tmp = new Date();
tmp = "?" + tmp.getTime();
document.images["webcam"].src = imgsrc + tmp;
setTimeout("Refresh()", interval);
}
Refresh();
</script>
BTW - you have a closing </div> too many @ line #78
Last edited by beteljuice on Thu 06 Apr 2017 9:02 am, edited 2 times in total.
Image
......................Imagine, what you will KNOW tomorrow !
User avatar
dazza1223
Posts: 860
Joined: Sun 25 Jan 2015 8:41 pm
Weather Station: Davis Vantage Pro 2 plus
Operating System: Raspberry pi 4 (4gb)
Location: Worthing
Contact:

Re: webcam

Post by dazza1223 »

thank u i give it a go to night
Have fun and keep learning

dazza :D

https://www.davisworthing.co.uk

Image
User avatar
dazza1223
Posts: 860
Joined: Sun 25 Jan 2015 8:41 pm
Weather Station: Davis Vantage Pro 2 plus
Operating System: Raspberry pi 4 (4gb)
Location: Worthing
Contact:

Re: webcam

Post by dazza1223 »

ok it work but it dont auto refresh

Code: Select all

[attachment=0]webcamT (1).rar[/attachment]
You do not have the required permissions to view the files attached to this post.
Have fun and keep learning

dazza :D

https://www.davisworthing.co.uk

Image
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: webcam

Post by beteljuice »

You didn't "CODE: SELECT ALL"

You missed the closing

Code: Select all

</script>
.. at the end of the code.
Image
......................Imagine, what you will KNOW tomorrow !
User avatar
dazza1223
Posts: 860
Joined: Sun 25 Jan 2015 8:41 pm
Weather Station: Davis Vantage Pro 2 plus
Operating System: Raspberry pi 4 (4gb)
Location: Worthing
Contact:

Re: webcam

Post by dazza1223 »

o sorry i for got that one lol OK i put it in but it still not auto refreshing mate
Have fun and keep learning

dazza :D

https://www.davisworthing.co.uk

Image
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: webcam

Post by beteljuice »

As we always say ......

a link would be useful !
Image
......................Imagine, what you will KNOW tomorrow !
User avatar
dazza1223
Posts: 860
Joined: Sun 25 Jan 2015 8:41 pm
Weather Station: Davis Vantage Pro 2 plus
Operating System: Raspberry pi 4 (4gb)
Location: Worthing
Contact:

Re: webcam

Post by dazza1223 »

Have fun and keep learning

dazza :D

https://www.davisworthing.co.uk

Image
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: webcam

Post by beteljuice »

Hmm ...
The only thing I can see (unless some of the jquery stuff is hanging) is that line #73

Code: Select all

imgsrc = "../images/webcam.jpg"
is missing the closing ;

Code: Select all

imgsrc = "../images/webcam.jpg";
Image
......................Imagine, what you will KNOW tomorrow !
User avatar
dazza1223
Posts: 860
Joined: Sun 25 Jan 2015 8:41 pm
Weather Station: Davis Vantage Pro 2 plus
Operating System: Raspberry pi 4 (4gb)
Location: Worthing
Contact:

Re: webcam

Post by dazza1223 »

lol nope when i put that in it dont even show the photo
Have fun and keep learning

dazza :D

https://www.davisworthing.co.uk

Image
User avatar
ConligWX
Posts: 1570
Joined: Mon 19 May 2014 10:45 pm
Weather Station: Davis vPro2+ w/DFARS + AirLink
Operating System: Ubuntu 22.04 LTS
Location: Bangor, NI
Contact:

Re: webcam

Post by ConligWX »

You have a <img> tag, so why are you using "imgsrc" attribute ?

it should be "src" not "imgsrc"

Code: Select all

<img src="../images/webcam.jpg" name="webcam" width="1000" height="690" alt="Please wait the image will appear soon" border="0" />
remove the </a> too. this is only used is html ref to links, not img. img can close with just />
Regards Simon

https://www.conligwx.org - @conligwx
Davis Vantage Pro2 Plus with Daytime FARS • WeatherLink Live • Davis AirLink • PurpleAir •

Image
Post Reply