Add a Photo

322 views
Skip to first unread message

Gary Hook

unread,
Jan 26, 2014, 12:09:09 PM1/26/14
to weewx...@googlegroups.com
I've just started using Weewx and would like to add a photo to the webpage.  I have a webcam that can save a current photo every minute and would like to display that photo.  how can i do that?


Andrew Milner

unread,
Jan 27, 2014, 10:45:43 AM1/27/14
to weewx...@googlegroups.com
1.  Have the webcam create the image in a known location, with a consistant (always the same) filename - ideally in the same directory as the generated weewx HTML web pages, and ideally overlay the photo with a time and datestamp if the software you are using to take the images does that.
2.  Change the template that you wish to carry the image to include the appropriate HTML code to insert the current image file into the weewx generated page.

Of course you can also get much more elaborate if you want to start coding - my method is, in essence, codeless.

vds

unread,
Jan 27, 2014, 4:24:02 PM1/27/14
to weewx...@googlegroups.com
On Monday, January 27, 2014 7:45:43 AM UTC-8, Andrew Milner wrote:
1.  Have the webcam create the image in a known location, with a consistant (always the same) filename - ideally in the same directory as the generated weewx HTML web pages, and ideally overlay the photo with a time and datestamp if the software you are using to take the images does that.
2.  Change the template that you wish to carry the image to include the appropriate HTML code to insert the current image file into the weewx generated page.

Of course you can also get much more elaborate if you want to start coding - my method is, in essence, codeless.


Another variant:
  3. set your system to upload your image to a stable URL at another site, and edit your weewx template to reference that URL.

I added my webcam to Weather Underground and cooked up a little cron job to update the snapshot every 15 minutes or so. 

http://www.wunderground.com/webcams/index.html - use the add a webcam link in the lower right of the page


mwall

unread,
Jan 27, 2014, 4:46:21 PM1/27/14
to weewx...@googlegroups.com
here is yet another variant.

upload each image with a unique name, such as YYYYmmddHHMMSS.jpg

cron a script on the server to make a symlink to the latest image

use the name of the symlink in your weewx skin

then use mencoder to create timelapse movies of the latest day/week/month/whatever

here is an example:

http://sailing.mit.edu/weather

daily timelapses are on the links page:

http://sailing.mit.edu/weather/links.html

kenneth lavrson has a wiki for detecting motion in your images:

http://www.lavrsen.dk/foswiki/bin/view/Motion/WebHome

kenneth's wiki also includes tricks for grabbing still images from various camera models.

m

Andrew Bauer

unread,
Feb 24, 2016, 3:06:25 PM2/24/16
to weewx-user
Thought I'd post into this old thread, rather than create a new one.

If one happens to have a ZoneMinder surveillance system, you can easily embed snapshots from one of your cameras by editing skin.conf like so:

radar_img = http://{hostname or Internet ip}/cgi-bin/zm/zms?mode=single&scale=25&monitor=16&user={username}&pass={password}



radar_url = http://{hostname or Internet ip}/cgi-bin/zm/zms?mode=single&scale=100&monitor=16&user={username}&pass={password}


A smaller image is embedded into the page. Clicking on the image produces the full sized image.
Adjust the scale parameter according to taste.

For best security, create a username and password in ZoneMinder with view only access to just the camera in question.
Reply all
Reply to author
Forward
0 new messages