WEBCAM plugin & CRONJOB

Post Reply
Lespius
Advisor
Advisor
Posts: 61
Joined: Wed Aug 23, 2017 7:32 pm
Location: Cugy, Switzerland
Station model: Davis VP2
Software: Meteobridge
Contact:

WEBCAM plugin & CRONJOB

Post by Lespius » Wed Jul 11, 2018 10:27 am

Hi Everyone !

I am unable to make the plugin work properly, there is something I don't understand, or that I am doing wrong. So I need your help !!!!

1. Upload the files in my plugin directory --> done
2. Set up the plugin in my control panel --> done
3. Move the updateWebcam.php file into the load/crons folder --> done
4. Launch the Cronjob at the address /template/load/cron.php?password=***** --> done
I think it executes correctly, because I have an answer on the webpage. A image is saved, a thumbnail is created, as well as the table and everything.

But.... that's all ! No additional image is saved. Looks like the cronjob is running only manually and not on a regular basis. Images are saved only when I connect to /template/load/cron.php?password=*****

So I think something is missing, or wrong. I have tried to change the plugin settings, or to have a look in the file, but I don't have the knowledge.

Would be happy to have some assistance !
Thank you !!
Image

proger
Observer
Observer
Posts: 35
Joined: Tue Jan 16, 2018 4:52 pm
Location: Norway
Station model: davis vantage vue
Software: Meteobridge
Contact:

Re: WEBCAM plugin & CRONJOB

Post by proger » Wed Jul 11, 2018 11:13 am

I made a folder where I store photos downloaded from webcam.
In here I have a script that rename every snap photo my webcam uploads to the folder
The name on the file has to be the same as in settings on the plugin

Here is the script you can use for renaming the photo


<?php
$fileList = glob('*.jpg');
var_dump($fileList);
foreach (glob("put in folder name here/*.jpg") as $filename) {
echo "Renaming " . $filename . " now.</br>";
if(file_exists($filename)) {
rename($filename, "name of your photo here" . ".jpg");
echo $filename . " is now name og photo" . ".jpg</br>";
Image

Lespius
Advisor
Advisor
Posts: 61
Joined: Wed Aug 23, 2017 7:32 pm
Location: Cugy, Switzerland
Station model: Davis VP2
Software: Meteobridge
Contact:

Re: WEBCAM plugin & CRONJOB // SOLVED

Post by Lespius » Wed Jul 11, 2018 12:26 pm

Solved !!

I discovered that I needed to create a cron-job, and I did one on cron-job.org, thanks to viewtopic.php?f=60&t=1247&p=5843#p5843.

And now it works perfectly fine !

Thank you Proger for your answer, even if it was not my problem. But I must say that I had previously a problem with the FTP upload from my IPCam, because the name of the file has a timestamp. So your script could be interesting for that.
Image

User avatar
Dehatter
Professional
Professional
Posts: 350
Joined: Sun Jan 07, 2018 5:11 am
Location: Matthews, NC, USA
Station model: Ecowitt WH80
Software: Ecowitt GW1000
Contact:

Re: WEBCAM plugin & CRONJOB

Post by Dehatter » Thu Jul 12, 2018 9:04 pm

how are you running the cron job?

Are you using a service?

I suggest https://cron-job.org as it is simple, free, and notifies you if it fails.

Tom
Image

Lespius
Advisor
Advisor
Posts: 61
Joined: Wed Aug 23, 2017 7:32 pm
Location: Cugy, Switzerland
Station model: Davis VP2
Software: Meteobridge
Contact:

Re: WEBCAM plugin & CRONJOB

Post by Lespius » Sat Jul 14, 2018 7:08 pm

Absolutely. I have found this site in one of your post. Dramatically simple, all is working perfectly !!

Check http://www.meteo-cugy.ch/template/plugi ... /index.php

so coooool 8-)
Image

User avatar
Dehatter
Professional
Professional
Posts: 350
Joined: Sun Jan 07, 2018 5:11 am
Location: Matthews, NC, USA
Station model: Ecowitt WH80
Software: Ecowitt GW1000
Contact:

Re: WEBCAM plugin & CRONJOB

Post by Dehatter » Wed Jul 25, 2018 4:33 am

Fantastic!! Some good clouds there yesterday too!

Tom
Image

Post Reply