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 4019) - 03 April 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

External programs

From build 3044 the development baton passed to Mark Crossley. Mark has been responsible for all the Builds since. He has made the code available on GitHub. It is Mark's hope that others will join in this development, but at the very least he welcomes your ideas for future developments (see Cumulus MX Development suggestions).

Moderator: mcrossley

Post Reply
User avatar
laulau
Posts: 678
Joined: Tue 13 Oct 2009 10:52 pm
Weather Station: WeatherDuino Pro2
Operating System: Win 7
Location: Meyenheim, Alsace, FR
Contact:

External programs

Post by laulau »

Hi,
I recently upgrade to Cumulus MX 3.2.5 buil3061 and it seem sthat my dayly external program not run as before.
it's a "batch file (.cmd) that calls a ftp command. if i run it manually it does what expected but it fails at rollower !
Could someone help me about this ?
Thanks
Laurent

Image
Phil23
Posts: 884
Joined: Sat 16 Jul 2016 11:59 pm
Weather Station: Davis VP2+ & GW1000 (Standalone)
Operating System: Win10 Pro / rPi Buster
Location: Australia

Re: External programs

Post by Phil23 »

Just checked mine since I'm also now on 3062 & it's still working fine.

It's just a file called DayEnd.bat

Code: Select all

@echo off
echo Waiting a few seconds for End of Day to complete.

ping localhost -n 5 > nul

copy "\\WEATHER-PC\Cumulus\data\dayfile.txt" + "\\WEATHER-PC\CumulusMX\data\dayfile.txt" "\\WEATHER-PC\CumulusMX\Scripts\dayfile-merged.txt" /b /y

cd \cumulusmx
Rem cumulusutils Top10 pwsFWI SysInfo Graphs MapsOn
cumulusutils Top10 pwsFWI SysInfo Graphs

"C:\CumulusMX\scripts\fnr.exe" --cl --dir "C:\CumulusMX\utils" --fileMask "graphs.txt" --find "'Normal', color: 'black'," --replace "'Normal', color: 'lightgray', lineWidth: 12,"
"C:\CumulusMX\scripts\fnr.exe" --cl --dir "C:\CumulusMX\utils" --fileMask "graphs.txt" --find "'Normal',  color: 'black'," --replace "'Normal', color: 'lightgray', lineWidth: 12,"

ftp -s:"\\WEATHER-PC\CumulusMX\Scripts\ftp.txt"

Ping localhost -n 5 > nul
CD\

Not sure how lone I was on 3061, but may have missed the issue if it was present.

Cheers.
:Now: :Today/Yesterday:

Image

Main Station Davis VP2+ Running Via Win10 Pro.
Secondary Stations, Ecowitt HP2551/GW1000 Via rPi 3 & 4 Running Buster GUI.
:Local Inverell Ecowitt Station: :Remote Ashford Ecowitt Station:
User avatar
mcrossley
Posts: 12756
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: External programs

Post by mcrossley »

There have been no (intended!) changes the external program processing since Steve's last build 3043.
User avatar
laulau
Posts: 678
Joined: Tue 13 Oct 2009 10:52 pm
Weather Station: WeatherDuino Pro2
Operating System: Win 7
Location: Meyenheim, Alsace, FR
Contact:

Re: External programs

Post by laulau »

My batch file runs well from the command line but hangs when initiated from CMX external program!
It's the ftp command , the connection is ok but the 'D:\CumulusMX\data\testfile.txt ' hangs !
Laurent

Image
User avatar
mcrossley
Posts: 12756
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: External programs

Post by mcrossley »

Perhaps if you post the batch file we can take a look and make suggestions?
Phil23
Posts: 884
Joined: Sat 16 Jul 2016 11:59 pm
Weather Station: Davis VP2+ & GW1000 (Standalone)
Operating System: Win10 Pro / rPi Buster
Location: Australia

Re: External programs

Post by Phil23 »

Just while on external programs, it's unclear when they are precisely run.

Are they executed after all internal processes are completed & all files for the interval updated & closed, or could they be triggered such that the timing of other process overlap if the internal processes & file writes have not completed, particularly on slower machine or big data sets.

I vaguely recall some initial issues with creating my script above, where it bombed as if the dayfile was in use.

As you can see I added some pings for a delay at the beginning & it work fine after that & ever since.

Phil
:Now: :Today/Yesterday:

Image

Main Station Davis VP2+ Running Via Win10 Pro.
Secondary Stations, Ecowitt HP2551/GW1000 Via rPi 3 & 4 Running Buster GUI.
:Local Inverell Ecowitt Station: :Remote Ashford Ecowitt Station:
User avatar
laulau
Posts: 678
Joined: Tue 13 Oct 2009 10:52 pm
Weather Station: WeatherDuino Pro2
Operating System: Win 7
Location: Meyenheim, Alsace, FR
Contact:

Re: External programs

Post by laulau »

The batch file colled at rollower(uploadDF.cmd):

Code: Select all

ftp -s:D:\CumulusMX\dayfileftp.txt
call D:\CumulusMX\savec.bat
"C:\Program Files (x86)\GnuWin32\bin\wget" "http://....
dayfileftp.txt:

Code: Select all

open ftp.laurentmey.fr
login******
passw***
cd /www//meteo
put D:\CumulusMX\data\dayfile.txt
cd /www//domo
put P:\DomoData\domodayfile.txt
quit
savec.bat:

Code: Select all

@echo off
set source=D:\CumulusMX\data
set dest=P:\Meteo\CumulusMX\data

set mois=01
set an=20
echo copy %mois%%an%.txt
if %mois%==01 copy "%source%\janv%an%log.txt" "%dest%"
if %mois%==02 copy "%source%\f?vr%an%log.txt" "%dest%"
if %mois%==03 copy "%source%\mars%an%log.txt" "%dest%"
if %mois%==04 copy "%source%\avr%an%log.txt" "%dest%"
if %mois%==05 copy "%source%\mai%an%log.txt" "%dest%"
if %mois%==06 copy "%source%\juin%an%log.txt" "%dest%"
if %mois%==07 copy "%source%\juil%an%log.txt" "%dest%"
if %mois%==08 copy "%source%\ao?t%an%log.txt" "%dest%"
if %mois%==09 copy "%source%\sept%an%log.txt" "%dest%"
if %mois%==10 copy "%source%\oct%an%log.txt" "%dest%"
if %mois%==11 copy "%source%\nov%an%log.txt" "%dest%"
if %mois%==12 copy "%source%\d?c%an%log.txt" "%dest%"
copy "%source%\dayfile.txt" "%dest%"
copy "%source%\*.ini" "%dest%"
('mois' and 'an' variables are updated in CMX extra webfile)

I didn't make any change since a while but for the moment the ftp command hangs at rollower!
Laurent

Image
User avatar
mcrossley
Posts: 12756
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: External programs

Post by mcrossley »

Does the "ftp" command require administrator rights?
ftp.exe is on the cmd path?

Otherwise I'm not sure, have you checked in the process list that the FTP command is actually running?

Also try adding a simple command before the FTP, just to make sure the batch file is running. Say something like...

Code: Select all

@echo %date% %time% Batch started > D:\CumulusMX\DailyBatchLog.txt
Any reason you aren't just using the CMX extra files facility to do these transfers and copies?
Then you'd just have to do the "wget" in the external program script.
User avatar
laulau
Posts: 678
Joined: Tue 13 Oct 2009 10:52 pm
Weather Station: WeatherDuino Pro2
Operating System: Win 7
Location: Meyenheim, Alsace, FR
Contact:

Re: External programs

Post by laulau »

I'm not sure that external program runs AFTER the CMX extra files facility !?

The point where it hangs:
Capture.JPG
The connection is ok but the ftp put timed out !
You do not have the required permissions to view the files attached to this post.
Laurent

Image
User avatar
mcrossley
Posts: 12756
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: External programs

Post by mcrossley »

OK, the problem is on the line with response code 425
"Could not open data connection to port 56299"

Your FTP program is opening the control connection to port 21 on the remote host, but the data connection to the dynamic port (56299 in this case) is failing. So you can send commands and get responses but you cannot transfer any data.

No idea why.
User avatar
mcrossley
Posts: 12756
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: External programs

Post by mcrossley »

The Extra files are processed at the end of the EOD process (after external programs) and are uploaded at the next archive interval after the EOD process completes.
User avatar
laulau
Posts: 678
Joined: Tue 13 Oct 2009 10:52 pm
Weather Station: WeatherDuino Pro2
Operating System: Win 7
Location: Meyenheim, Alsace, FR
Contact:

Re: External programs

Post by laulau »

That's why i first upload my dayfile and then use php script to update the remote database.
BTW how do you proceed ?

The strange thing is that it works when i manually execute the batch file.
Laurent

Image
User avatar
mcrossley
Posts: 12756
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: External programs

Post by mcrossley »

Sounds like a permissions thing to me - or firewall.
Post Reply