Page 4 of 4

Re: Extra Webfiles Missing

Posted: Thu 21 May 2020 9:59 pm
by Phil23
For anyone that has need to close CMX from the Scheduler in Windows here's an updated copy of the utility from AutoHotkey.

It's got a few pop-up boxes that were just for debug & can be removed & recompiled, (Need Ahk installed to compile).

The EXE just runs, & the dialog boxes time out in a second or two.

CumulusShutdown.ahk Script below.

Complied Stadalone exe in the Attached zip.

Cheers

Phil.

Code: Select all

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.

if WinExist("ahk_exe CumulusMX.exe")
WinActivate  ; Uses the last found window.

MsgBox, 1,"CMX Will Be Closed", Would you like to continue?,1

IfMsgBox Cancel
{
MsgBox,,"Cumulus Shutdow Utility" , "You pressed Cancel.",3
    Return
}

IfMsgBox Ok
    MsgBox, ,"Cumulus Shutdow Utility", "You pressed Ok.",3

else
{
MsgBox, ,"Cumulus Shutdow Utility", "Message Box Timed Out",1
    Send ^c
    WinWaitClose
MsgBox, ,"Cumulus Shutdow Utility","Cumulus Closed",3
    Return
}

Re: Extra Webfiles Missing

Posted: Thu 21 May 2020 11:05 pm
by Phil23
Just noticed a string of errors at the end of the log in a test Start/Stop.

May not mean much as many have duplicated time stamps.

Full log file attached.

On the surface all seems to be running fine & no issues.

Cheers.

Code: Select all

2020-05-22 06:53:47.275 Normal running
Exiting system due to external: Ctrl-C
2020-05-22 06:57:16.118 Cumulus closing
2020-05-22 06:57:16.134 Writing Cumulus.ini file
2020-05-22 06:57:16.196 Completed writing Cumulus.ini file
2020-05-22 06:57:16.196 Station stopping
2020-05-22 06:57:16.212 Closing connection
2020-05-22 06:57:16.212 !!! loop data not received, Comm port is closed
2020-05-22 06:57:16.212 Station stopped
2020-05-22 06:57:16.212 Writing today.ini file
2020-05-22 06:57:16.227 WakeVP: Error - System.InvalidOperationException: The port is closed.
   at System.IO.Ports.SerialPort.DiscardInBuffer()
   at CumulusMX.DavisStation.WakeVP(SerialPort serialPort)
2020-05-22 06:57:16.227 WakeVP: Error - System.InvalidOperationException: The port is closed.
   at System.IO.Ports.SerialPort.DiscardInBuffer()
   at CumulusMX.DavisStation.WakeVP(SerialPort serialPort)
   
 etc
 etc 

Re: Extra Webfiles Missing

Posted: Thu 21 May 2020 11:11 pm
by Phil23
Partially reproduced the above by closing with Ctrl-C on the keyboard; but only one instance of the error message.

Maybe on a timing boundary.

Phil

Code: Select all

Exiting system due to external: Ctrl-C
2020-05-22 09:08:19.062 Cumulus closing
2020-05-22 09:08:19.094 Writing Cumulus.ini file
2020-05-22 09:08:19.172 Completed writing Cumulus.ini file
2020-05-22 09:08:19.172 Station stopping
2020-05-22 09:08:19.172 Closing connection
2020-05-22 09:08:19.172 Station stopped
2020-05-22 09:08:19.172 Writing today.ini file
2020-05-22 09:08:19.187 !!! loop data not received, Comm port is closed
2020-05-22 09:08:19.187 Comleted writing today.ini file
2020-05-22 09:08:19.187 Station shutdown complete
Cumulus has shutdown
2020-05-22 09:08:19.187 WakeVP: Error - System.InvalidOperationException: The port is closed.
   at System.IO.Ports.SerialPort.DiscardInBuffer()
   at CumulusMX.DavisStation.WakeVP(SerialPort serialPort)
Edit:-

Just to add to the above, the Shutdown at 9:00:30, performed by the script was much like the above with only 1 error line.

Code: Select all

2020-05-22 09:00:32.782 Comleted writing today.ini file
2020-05-22 09:00:32.782 Station shutdown complete
Cumulus has shutdown
2020-05-22 09:00:32.923 WakeVP: Error - System.InvalidOperationException: The port is closed.
   at System.IO.Ports.SerialPort.DiscardInBuffer()
   at CumulusMX.DavisStation.WakeVP(SerialPort serialPort)

Re: Extra Webfiles Missing

Posted: Fri 22 May 2020 5:54 am
by sfws
You introduced a typo in those pasting operations, Phil, you've managed to change the spelling of "completed" in the second paste. It is correct in your source, Mark, don't worry, this is not another 'p' issue.

Re: Extra Webfiles Missing

Posted: Fri 22 May 2020 8:25 am
by mcrossley
You can safely ignore errors after the Cumulus Shutdown message. They are usually like this one where a thread that hasn't terminates is trying to read from a port that Cumulus has already closed. The shutdown code could do with some loving to tidy up a bit better, but it's low priority.

Re: Extra Webfiles Missing

Posted: Sat 23 May 2020 7:56 am
by Phil23
sfws wrote: Fri 22 May 2020 5:54 am You introduced a typo in those pasting operations, Phil, you've managed to change the spelling of "completed" in the second paste.
It's actually incorrect in the source for Today.ini, but correct for the main ini.

Didn't think Mark needed to bother chasing a missing p at this point.
I can live with that.

Phil.