Welcome to the Cumulus Support forum.

Latest Cumulus MX V4 release 4.4.2 (build 4085) - 12 March 2025

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

Legacy Cumulus 1 release 1.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

If you are posting a new Topic about an error or if you need help PLEASE read this first viewtopic.php?p=164080#p164080

Run External Programs based on Sunrise/Sunset webtags

Discussion and questions about Cumulus weather station software version 1. This section is the main place to get help with Cumulus 1 software developed by Steve Loft that ceased development in November 2014.
captzero
Posts: 363
Joined: Wed 03 Mar 2010 10:20 am
Weather Station: Vantage Pro2 w/ daytime FARS
Operating System: Windows 10
Location: Brisbane, Australia
Contact:

Re: Run External Programs based on Sunrise/Sunset webtags

Post by captzero »

Just an update on my progress...
Eventually, I created two batch files, one to start the program if the sun was up and the other to stop it if the sun had set.
Cumulus processes each xxxxT.bat file and saves as xxxx.bat.
I wasn't happy with the limitations of Windows Task Scheduler so I'm using 'System Scheduler Pro' to run each batch file.
I only run the batch files during the required 'time window' (dawn (on) batch file from 4.20am to 6.15am each day and the dusk (off) batch file from 5.20pm to 6.45pm). This will cover the earliest and latest dawn/dusk times over the year.
I can schedule each file to run during certain hours, run silently in the background with no command window and add automatic key strokes to close windows etc.
Everything seems to be working fine.
Thanks to everyone who assisted.
Last edited by captzero on Sun 25 May 2014 3:33 am, edited 1 time in total.
Dan

http://www.brisbaneliveweather.com




A man with a thermometer always knows the temperature. A man with two thermometers, not so sure.
User avatar
ace2
Posts: 679
Joined: Tue 14 Jan 2014 12:38 pm
Weather Station: maxkon ws-1081pc
Operating System: windows 7 & 8
Location: Adelaide, south Australia, Australia
Contact:

Re: Run External Programs based on Sunrise/Sunset webtags

Post by ace2 »

captzero wrote: 'System Scheduler Pro' ..
Is that the one made by splinterware???
CHRIS
Image
web site
http://www.ace2weather.com
Follow me on Twitter
http://tinyurl.com/kwlr9re
YouTube channel
http://tinyurl.com/lehwpgp
Facebook page
http://tinyurl.com/k3sap4s
Tiny URL links used
captzero
Posts: 363
Joined: Wed 03 Mar 2010 10:20 am
Weather Station: Vantage Pro2 w/ daytime FARS
Operating System: Windows 10
Location: Brisbane, Australia
Contact:

Re: Run External Programs based on Sunrise/Sunset webtags

Post by captzero »

ace2 wrote:Is that the one made by splinterware???
Yes.
Dan

http://www.brisbaneliveweather.com




A man with a thermometer always knows the temperature. A man with two thermometers, not so sure.
User avatar
ace2
Posts: 679
Joined: Tue 14 Jan 2014 12:38 pm
Weather Station: maxkon ws-1081pc
Operating System: windows 7 & 8
Location: Adelaide, south Australia, Australia
Contact:

Re: Run External Programs based on Sunrise/Sunset webtags

Post by ace2 »

Mm, might look into that program, my current scheduler doesn't have between hours of.

I normally use a script which uses the hours from current time.

Code: Select all

if %time:~0,2% EQU (hour)goto start
Exit
And run every hour.
Easier using the scheduler!!
Tx
CHRIS
Image
web site
http://www.ace2weather.com
Follow me on Twitter
http://tinyurl.com/kwlr9re
YouTube channel
http://tinyurl.com/lehwpgp
Facebook page
http://tinyurl.com/k3sap4s
Tiny URL links used
User avatar
ace2
Posts: 679
Joined: Tue 14 Jan 2014 12:38 pm
Weather Station: maxkon ws-1081pc
Operating System: windows 7 & 8
Location: Adelaide, south Australia, Australia
Contact:

Re: Run External Programs based on Sunrise/Sunset webtags

Post by ace2 »

Why would task manager show multible cmd, ffmeg and my other scripts???
I have a exit on every completion and end of every script, scripts run and complete fine.....

Do I need to run a taskkill at the end or something???
CHRIS
Image
web site
http://www.ace2weather.com
Follow me on Twitter
http://tinyurl.com/kwlr9re
YouTube channel
http://tinyurl.com/lehwpgp
Facebook page
http://tinyurl.com/k3sap4s
Tiny URL links used
User avatar
mcrossley
Posts: 14388
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Run External Programs based on Sunrise/Sunset webtags

Post by mcrossley »

ace2 wrote: Do I need to run a taskkill at the end or something???
You shouldn't have too, what parameters are you using to start the script?
User avatar
ace2
Posts: 679
Joined: Tue 14 Jan 2014 12:38 pm
Weather Station: maxkon ws-1081pc
Operating System: windows 7 & 8
Location: Adelaide, south Australia, Australia
Contact:

Re: Run External Programs based on Sunrise/Sunset webtags

Post by ace2 »

mcrossley wrote:You shouldn't have too, what parameters are you using to start the script?
Excuse my basic script.....

cumulus processes the timeT.txt for all my variables.
I then use the timeswT that BCJKiwi posted on this thread in my script. I changed it to use the output %RFLAG% as a switch 1=on & 0=off.

I then set my mini lapse script to run on certain times, i then run this script hourly. If cumulus time = X goto X

**all user names and passwords have been removed**

I wonder if it's my version of ffmpeg causing it???
You do not have the required permissions to view the files attached to this post.
CHRIS
Image
web site
http://www.ace2weather.com
Follow me on Twitter
http://tinyurl.com/kwlr9re
YouTube channel
http://tinyurl.com/lehwpgp
Facebook page
http://tinyurl.com/k3sap4s
Tiny URL links used
User avatar
mcrossley
Posts: 14388
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Run External Programs based on Sunrise/Sunset webtags

Post by mcrossley »

It was more how you invoked the script rather than the script itself.
User avatar
ace2
Posts: 679
Joined: Tue 14 Jan 2014 12:38 pm
Weather Station: maxkon ws-1081pc
Operating System: windows 7 & 8
Location: Adelaide, south Australia, Australia
Contact:

Re: Run External Programs based on Sunrise/Sunset webtags

Post by ace2 »

mcrossley wrote:It was more how you invoked the script rather than the script itself.
oops.............but the script decide if it runs or not depending on variable

set to run via a task scheduler(not windows one) every hour...
CHRIS
Image
web site
http://www.ace2weather.com
Follow me on Twitter
http://tinyurl.com/kwlr9re
YouTube channel
http://tinyurl.com/lehwpgp
Facebook page
http://tinyurl.com/k3sap4s
Tiny URL links used
User avatar
ace2
Posts: 679
Joined: Tue 14 Jan 2014 12:38 pm
Weather Station: maxkon ws-1081pc
Operating System: windows 7 & 8
Location: Adelaide, south Australia, Australia
Contact:

Re: Run External Programs based on Sunrise/Sunset webtags

Post by ace2 »

It seems any script that invokes ffmpeg cause this. I had 10 processes of my mini lapse script showing, task killed the cmd.exe(about 10 of them as well) closed all my mini lapse scripts, then task killed ffmpeg.exe also 10 odd.
So why would this be happening???
Ffmpeg section completes the process and I have a CLS & exit command after ffmpeg/script.
Sound like my final step at night is to task kill all those processes.....
CHRIS
Image
web site
http://www.ace2weather.com
Follow me on Twitter
http://tinyurl.com/kwlr9re
YouTube channel
http://tinyurl.com/lehwpgp
Facebook page
http://tinyurl.com/k3sap4s
Tiny URL links used
User avatar
mcrossley
Posts: 14388
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Run External Programs based on Sunrise/Sunset webtags

Post by mcrossley »

Same question again really, how are you invoking the script from the scheduler?

Also you are using GOTO EOF, and have defined an :EOF label. EOF is a built-in label which means jump to the end-of-file and return to the calling script. How it behaves with a defined label I'm not sure. GOTO EOF is usually used when you use sub-routines (or at the end of external scripts) to jump back to the main code where you made the call to the sub-routine.

I would replace your :EOF label with :END and replace all your GOTO EOF with GOTO END
You could also replace all your exit points...
CLS
exit

with GOTO END as well.


Picky, but you have quite a few SET /A commands where you are not doing any arithmetic (such as "set /a SFLAG = 0"), you do not need the /a flag in these cases.
User avatar
ace2
Posts: 679
Joined: Tue 14 Jan 2014 12:38 pm
Weather Station: maxkon ws-1081pc
Operating System: windows 7 & 8
Location: Adelaide, south Australia, Australia
Contact:

Re: Run External Programs based on Sunrise/Sunset webtags

Post by ace2 »

mcrossley wrote:Same question again really, how are you invoking the script from the scheduler?

Also you are using GOTO EOF, and have defined an :EOF label. EOF is a built-in label which means jump to the end-of-file and return to the calling script. How it behaves with a defined label I'm not sure. GOTO EOF is usually used when you use sub-routines (or at the end of external scripts) to jump back to the main code where you made the call to the sub-routine.

I would replace your :EOF label with :END and replace all your GOTO EOF with GOTO END
You could also replace all your exit points...
CLS
exit

with GOTO END as well.


Picky, but you have quite a few SET /A commands where you are not doing any arithmetic (such as "set /a SFLAG = 0"), you do not need the /a flag in these cases.

Sorry, the .bat is converted to a silent exe with bat to exe convertor. So it's called as an exe.

Mm, will replace all my exit ones. strange enough, I used END on all my others.

The script has all the left over stuff cause its used in more than 1 script that utilizes the RFLAG, hence why some useless code exists. Easy to use one universal working script for all and change 1 line to suit the needs.
CHRIS
Image
web site
http://www.ace2weather.com
Follow me on Twitter
http://tinyurl.com/kwlr9re
YouTube channel
http://tinyurl.com/lehwpgp
Facebook page
http://tinyurl.com/k3sap4s
Tiny URL links used
User avatar
ace2
Posts: 679
Joined: Tue 14 Jan 2014 12:38 pm
Weather Station: maxkon ws-1081pc
Operating System: windows 7 & 8
Location: Adelaide, south Australia, Australia
Contact:

Re: Run External Programs based on Sunrise/Sunset webtags

Post by ace2 »

I'm still getting multiple CMD, NTCFTP, Mini lapse hourly and FFmpeg showing in task manager.(about 12 of each)

I've added the GOTO END on all exits and the :END at the end of script
(once again this script is converted to a silent exe, not run as a .bat)

closing FFmpeg kills all mini lapse hourly listed, i close all cmd amd ntcftp(my ftp command line program)

The mini lapse hourly runs every hour by a standalone task scheduler program and completes fine.
I just don't understand why these tasks are not closing........

I have included my script in case anyone can see my error.....
You do not have the required permissions to view the files attached to this post.
CHRIS
Image
web site
http://www.ace2weather.com
Follow me on Twitter
http://tinyurl.com/kwlr9re
YouTube channel
http://tinyurl.com/lehwpgp
Facebook page
http://tinyurl.com/k3sap4s
Tiny URL links used
ianboag
Posts: 9
Joined: Mon 18 Aug 2014 12:48 am
Weather Station: WS 1080
Operating System: Windows 7
Location: Turangi, NZ

Re: Run External Programs based on Sunrise/Sunset webtags

Post by ianboag »

Just to pick this one up again ...

I am doing an airfield station with pix. The pix are snapped and uploaded by a batch file that runs as the "external program". All works fine. I can see how to use <#isdaylight> etc to stop it taking pics and uploading them at night. I would actually like it to stop uploading altogether at night? Is there any way to do this in cumulus without going to external schedulers and stuff?

Ian B
User avatar
steve
Cumulus Author
Posts: 26672
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: Run External Programs based on Sunrise/Sunset webtags

Post by steve »

ianboag wrote:I would actually like it to stop uploading altogether at night? Is there any way to do this in cumulus without going to external schedulers and stuff?
No, sorry. Improving the scheduling is one of the things on the to-do list.
Steve
Post Reply