Page 1 of 1

Help with Yaw cam please

Posted: Sat 07 Sep 2013 10:42 am
by Manzara
I have now managed to get yawcam working!! Set up the router and my webcam captures every 30 secs All the pics are there both on my hard drive and also my web hosting folder. Problem is I don't know how to get the pictures to update every 30 secs. In yawcam it asks for a filme name so I called mine webcam(num).jpg even tho the pictures increment in the folders I can't get the right coding so the website updates itself. Any ideas I think I need a bit of script - bit thick here.

Re: Help with Yaw cam please

Posted: Sat 07 Sep 2013 12:23 pm
by ironeagleuk
I would set yawcam to upload a static filename pic...ie webcam.jpg, then get your webpage just to look at that filename.

I use a script running in a CMD window from a batch file to use wget to download the files from the website into a folder, then rename the file to the date and time into a folder of the date.

This is the code I used, that some kind chap on this forum helped me put together

Code: Select all

:: Isolate the variables to this instance of the script
setlocal

:: Get the date and time into variables
for /f "tokens=1-3 delims=/ " %%a in ("%date%") do set dy=%%a&set mo=%%b&set yr=%%c
for /f "tokens=1-2 delims=:." %%a in ("%time%") do set hr=%%a&set mi=%%b

:: Set variable for hour depending on whether it is single or a double digit
set hour=%time:~0,2%
if "%hour:~0,1%" == " " set hour=0%hour:~1,1%
echo hour=%hour%


:: Change drive & directory to "C:\WebCams\Capture\Webcam1
cd /D C:\WebCams\Capture\Webcam1\

:: Create todays directory if it does not exist
md %yr%-%mo%-%dy%

:: Change path to "\WebCams\Capture\Webcam1\yyyy-mm-dd"
cd %yr%-%mo%-%dy%

:: Delete any instance already existing of cam1
del cam1*.*


:: Get the remote file
wget http://www.ironeagleuk.co.uk/cumulus/webcam/cam1.jpg

:: Wait a bit
::ping -n 15 www.ironeagleuk.co.uk
:: Wait a bit - Better on Vista or later..
timeout /t 10

:: OR, better yet, wait for the wget program to finish rather than relying on a timeout, replace "wget" above with
::start /wait wget http://www.ironeagleuk.co.uk/cumulus/webcam/cam1.jpg

:: Rename "cam1.jpg" to "cam_1_hhmm-ddmmyyyy.jpg"
ren cam1.jpg cam_1_%hour%%mi%-%dy%%mo%%yr%.jpg

:: Wait a bit
::ping -n 15 www.ironeagleuk.co.uk
:: Wait a bit - Better on Vista or later..
timeout /t 10

:: End isolation of the variables to this instance of the script
endlocal

:: ?Presumably call this script again? 
c:\camrename2.bat
I use the above code to download images from 3 cameras into 3 different folders...but this code is just for one of them.

Change the name of the website to your website and folder names