MX on Windows OS: Difference between revisions

From Cumulus Wiki
Jump to navigationJump to search
1,803 bytes added ,  18:15, 27 August 2021
m
m (Making more consistent with "MX on Linux" for easier future maintenance)
(7 intermediate revisions by the same user not shown)
Line 21: Line 21:
All the (optional) files in the [[Reports folder]] can be copied across from a previous installation. It should not matter which release created past files, although ideally you need to ensure that the report naming and encoding described on that linked page remain the same.
All the (optional) files in the [[Reports folder]] can be copied across from a previous installation. It should not matter which release created past files, although ideally you need to ensure that the report naming and encoding described on that linked page remain the same.


All the files in the [[data folder]] can also be copied across, but be aware your new installation has to use the same "locale" as the old installation, or MX will struggle as the locale affects how new lines are stored, and how MX expects old lines to have been stored. Microsoft Windows uses different line terminators to other operating systems, although MX should cope, any third party routines reading your data files will probably not accept a line terminator change.
<br>


If your previous Cumulus installation was of the legacy software, version 1.9.4, or earlier, then you need to do a lot of reading:
Whilst you should copy ALL the files in the [[data folder]], from any old installation into the new installation, there are several extra considerations:
* [[Amending dayfile]] tells you about how MX is far more fussy about the content in [[dayfile.txt]]
* '''Your new MX installation will ignore any entries prior to the MX Start Date'''  when it reads from [[Monthly log files]], such as [[Standard log files]], and [[Extra Sensor Files]]:
* [[:Category:Ini Files|.ini files]] explains how time-stamps are formatted differently in the extreme tracking files
**  See [[Cumulus.ini#Data_Logging|'''StartDate=xxxxx''']] parameter, edit using ''Station Settings → Common Options → Advanced Options → Records Began date''
* [[Migrating from Cumulus 1 to MX]] gives some advice about differences in settings, but be aware that the way MX handles settings varies by release, and information on the linked page may be out of date
* Be aware your new installation has to use the same "locale" as the old installation, or MX will struggle as the locale affects how new lines are stored, and how MX expects old lines to have been stored the same way.
* If your old installation, is on a different operating system to the Microsoft Windows for your new installation, remember that Microsoft Windows uses different line terminators to all other operating systems, although MX should cope with mixed line terminators, any third party routines reading your data files will probably not accept a line terminator change.
* If your previous Cumulus installation was of the legacy software, version 1.9.4, or earlier, then you need to do a lot of reading:
** [[Amending dayfile]] tells you about how MX is far more fussy about the content in [[dayfile.txt]]
** [[:Category:Ini Files|.ini files]] explains how time-stamps are formatted differently in the extreme tracking files
** [[Migrating from Cumulus 1 to MX]] gives some advice about differences in settings, but be aware that the way MX handles settings varies by release, and information on the linked page may be out of date


==Configuration Files to copy across from any previous Cumulus installation==
==Configuration Files to copy across from any previous Cumulus installation==
Line 173: Line 178:
!style="width:30px" | Step
!style="width:30px" | Step
!style="width:600px" | Interactively
!style="width:600px" | Interactively
!style="width:600px" | As Service
!style="width:400px" | As Service
|-
|- style="vertical-align:top;"
|Setting up
! scope="row" |Setting up
| To run Cumulus MX, Windows needs to know
| To run Cumulus MX, Windows needs to know
# which '''.exe''' you want to run (ExportToMySQL.exe, CalculateMissing.exe, or CumulusMX.exe)
# which '''.exe''' you want to run (ExportToMySQL.exe, CalculateMissing.exe, or CumulusMX.exe)
Line 182: Line 187:
Therefore it is best to always start MX using what Windows calls a '''shortcut''', because when creating the shortcut you can enter all the required information into the properties.   
Therefore it is best to always start MX using what Windows calls a '''shortcut''', because when creating the shortcut you can enter all the required information into the properties.   


There are 3 ways on Windows to create a shortcut to run MX:
There are 3 ways on Windows to create a shortcut to run the CumulusMX executable:
#Create a shortcut on your desktop (and/or the taskbar) for the '''CumulusMX.exe''' executable <code>cmd.exe /C start CumulusMX C:\CumulusMX\CumulusMX.exe -debug</code>, the "-debug" is ''optional'', it starts the logging in debugging mode so the log created in MXDiags folder has more information. There are other optional parameters all listed later.
#Create a shortcut on your desktop (and/or the taskbar) for the '''CumulusMX.exe''' executable <code>cmd.exe /C start CumulusMX C:\CumulusMX\CumulusMX.exe -debug</code>, the "-debug" is ''optional'', it starts the logging in debugging mode so the log created in MXDiags folder has more information. There are other optional parameters all listed later.
#*In that shortcut define the path where the executable is located as the path to start in.
#*In that shortcut define the path where the executable is located as the path to start in.
Line 217: Line 222:
#*# Select '''Modify'''
#*# Select '''Modify'''
#*# You should see '''"C:\CumulusMX\CumulusMX.exe"'''
#*# You should see '''"C:\CumulusMX\CumulusMX.exe"'''
#*#* This assumes that you have installed your MX in that system partition path, adjust the '''C:''' if you have installed your MX in another partition, in above and in examples below
#*# Now you can add parameters as per [[#Optional_parameters_to_add_to_the_instruction_to_run_the_MX_engine]]
#*# Now you can add parameters as per [[#Optional_parameters_to_add_to_the_instruction_to_run_the_MX_engine]]
#*#* For example modify to ''' "C:\CumulusMX\CumulusMX.exe" -port 9000''' to add port
#*#* For example modify to ''' "C:\CumulusMX\CumulusMX.exe" -port 9000''' to add port
Line 223: Line 229:
# In your MX release distribution, navigate to '''CumulusMX\MXutils\windows'''.
# In your MX release distribution, navigate to '''CumulusMX\MXutils\windows'''.
# Find file '''CreateCmxResumeFromStandbyTask.ps1''' for resuming MX after Microsoft Windows has gone into standby.
# Find file '''CreateCmxResumeFromStandbyTask.ps1''' for resuming MX after Microsoft Windows has gone into standby.
#  The script MUST be run with Administrator priveldges.
#  The script MUST be run with Administrator privileges.
# Type <code>CreateCmxResumeFromStandbyTask</code>, and press '''Enter''', this will create a Scheduled Task.  
# Type <code>CreateCmxResumeFromStandbyTask</code>, and press '''Enter''', this will create a Scheduled Task.  
#* The scheduled task will exist from now on, and will automatically restart the service (on resume from standby/hibernate).
#* The scheduled task will exist from now on, and will automatically restart the service (on resume from standby/hibernate).
|-
|- style="vertical-align:top;"
| (Re-)Starting MX
! scope="row" | (Re-)Starting MX
|  # First '''start the MX engine''' using your shortcut (created in one of the 3 ways as above), if it has not started when you started your computer
|  # First '''start the MX engine''' using your shortcut (created in one of the 3 ways as above), if it has not started when you started your computer
# Next '''start the admin interface''', it does not need to run all the time, but only when you need it , it normally runs on port 8998 (to vary that there is a '''-port''' parameter that is followed by required port and that port parameter has to be entered every time you start MX if you are not using the default port). More information on admin interface [[MX Administrative Interface|in separate article]].
# Next '''start the admin interface''', it does not need to run all the time, but only when you need it , it normally runs on port 8998 (to vary that there is a '''-port''' parameter that is followed by required port and that port parameter has to be entered every time you start MX if you are not using the default port). More information on admin interface [[MX Administrative Interface|in separate article]].
Line 238: Line 244:
* Or, use the service command line tool:- <code>sc start CumulusMX</code> using Command window or Powershell window or Terminal window (one of these will be offered when you right click the Windows/Start symbol) and type '''exit''' to leave that window.
* Or, use the service command line tool:- <code>sc start CumulusMX</code> using Command window or Powershell window or Terminal window (one of these will be offered when you right click the Windows/Start symbol) and type '''exit''' to leave that window.


Note that you may sometimes want to use one or more of the optional parameters when starting MX.
Note that you may sometimes want to use one or more of the optional parameters when starting MX, as per previous row.
|-
|-  
| Checking MX is still running
! scope="row"| Checking MX is still running
| Simply look in the Command window or Powershell window or Terminal window you used to start MX and left open.
| Simply look in the Command window or Powershell window or Terminal window you used to start MX and left open.
| You can use <code>sc query CumulusMX</code> at any time to check that the service is running.
| You can use <code>sc query CumulusMX</code> at any time to check that the service is running.
|-
|-
| Deleting shortcut/service
! scope="row"| Deleting shortcut/service
| If you have set up your short-cut in the '''Startup''' folder, you need to delete that short-cut (or move it to a sub-folder), to stop MX automatically starting when you restart your computer
| If you have set up your short-cut in the '''Startup''' folder, you need to delete that short-cut (or move it to a sub-folder), to stop MX automatically starting when you restart your computer
| To remove the Cumulus system service run <code>CumulusMX.exe - uninstall</code> as an Administrator using Command window or Powershell window or Terminal window (one of these will be offered when you right click the Windows/Start symbol) and type '''exit''' to leave that window.
| To remove the Cumulus system service:
|-
* Either run <code>CumulusMX.exe - uninstall</code> as an Administrator using Command window or Powershell window or Terminal window (one of these will be offered when you right click the Windows/Start symbol) and type '''exit''' to leave that window.
| Stopping MX
* Or select '''Services''' from "Start", as an administrator, in the ''services applet'' that loads navigate to the one labelled Cumulus, and delete that.
|- style="vertical-align:top;"
! scope="row"| Stopping MX
| The recommended way is to click into the command window in which MX is running, ''hold down Control key'' and press '''C'''. It is normal for there to be a short wait, then a message "Cumulus Terminating" and then after another short wait, it will say "Cumulus Stopped" and immediately after that the command window  will be closed by MX.
| The recommended way is to click into the command window in which MX is running, ''hold down Control key'' and press '''C'''. It is normal for there to be a short wait, then a message "Cumulus Terminating" and then after another short wait, it will say "Cumulus Stopped" and immediately after that the command window  will be closed by MX.


Line 260: Line 268:
* Or, use the service command line tool:- <code>sc stop CumulusMX</code>  
* Or, use the service command line tool:- <code>sc stop CumulusMX</code>  
|}
|}
= Optional parameters to add to the instruction to run the MX engine =
As seen above, in Microsoft Windows, we leave off the file extension when we want to run one of the Cumulus executables, but we might need to add a parameter (starts with a minus symbol), and that parameter might need to be followed with a value.
== -install parameter for installing as Windows Service==
Use '''CumulusMX -install''' to install MX as a Windows service.
By default, MX's Microsoft Windows service is installed to run under the System account.
System does not have permissions for network access, that it turn means that any batch file that MX initiates as an external program will be restricted to actions that a System account can do, that excludes actions that a network access account can do.
== -uninstall parameter for uninstalling the Windows Service==
Use '''CumulusMX -uninstall''' to uninstall the service that runs MX.
== -Port parameter for changing HTTP Port ==
When Cumulus starts, it will display the URL of the user interface.
It runs on port 8998 by default; if this is not suitable for some reason you can over-ride it using the '-port' parameter on the command line, e.g. to use port 9999 instead:
:<code>CumulusMX -port 9999</code>
== -debug parameter for adding debugging ==
This is only available for [https://cumulus.hosiene.co.uk/viewtopic.php?p=138839#p138839 release 3.4.4 - Build 3068] onwards. This switches on debug and data logging from the start-up of Cumulus MX by adding a parameter:
:<code>CumulusMX -debug</code>
MX has a default level of logging that stores in the [[MXdiags_folder]] folder a log file that shows some of the interaction with the weather station and some of the output actions done as MX runs. A new log is started each time MX is restarted.
If there is a problem, then there is a great benefit in actually increasing the level of detail in these logs; and that is done either within the settings (on recent MX releases this is on '''Program Settings''' page of admin interface - please see [[:Category:Diagnostics]] page for details) or the above command.
== Beta builds of MX ==
The following two parameters are not available since MX came out of 3.0.0 beta.
=== -wsport parameter for web sockets ===
Beta builds in MX version 3.0.0 had an optional parameter <code>CumulusMX -wsport nnnn</code> that determined which port (represented by a 4 digit number ''nnnn'') was used for '''Web Sockets'''.
Note use of this parameter is now deprecated, as it has been incorporated into '''-port''' parameter described earlier.  The reason is that [https://cumulus.hosiene.co.uk/viewtopic.php?f=40&t=17887&p=138815&hilit=sockets#p138815 Web Sockets in all builds since 3045] use the same port for web sockets as for the HTTP port of the [[MX_Administrative_Interface#The_API_interface|Admin Interface]]. 
=== -Logging parameter for debugging of data flow between station and MX===
Use '''CumulusMX -Logging=1''' (for the station to MX transfers to have increased debugging logging).
Note use of this parameter is now deprecated, as it has been incorporated into '''-debug''', see above.


=Access to admin interface=
=Access to admin interface=
Line 365: Line 421:


You may find [[PHP|this wiki page]] useful for understanding more about the different script languages.
You may find [[PHP|this wiki page]] useful for understanding more about the different script languages.
= Optional parameters to add to the instruction to run the MX engine =
== Beta builds of MX ==
The following two parameters are not available since MX came out of 3.0.0 beta.
=== -wsport parameter for web sockets ===
Beta builds in MX version 3.0.0 had an optional parameter <code>CumulusMX -wsport nnnn</code> that determined which port (represented by a 4 digit number ''nnnn'') was used for '''Web Sockets'''.
That parameter [https://cumulus.hosiene.co.uk/viewtopic.php?f=40&t=17887&p=138815&hilit=sockets#p138815 is now deprecated as Web Sockets in all builds since 3045] use the same port for web sockets as for the HTTP port of the [[MX_Administrative_Interface#The_API_interface|Admin Interface], see '''-port''' parameter below.
=== -Logging parameter for debugging of data flow between station and MX===
Use '''CumulusMX -Logging=1''' (for the station to MX transfers to have increased debugging logging).
Note use of this parameter is now deprecated.
Although this is not mentioned in any release announcements, it appears that on all recent MX releases this effect is incorporated into the '''-debug''' parameter.  Perhaps someone could confirm whether this is true.
== -install parameter for installing as Windows Service==
Use '''CumulusMX -install''' to install MX as a service.
== -uninstall parameter for uninstalling the Windows Service==
Use '''CumulusMX -uninstall''' to uninstall the service that runs MX.
== -Port parameter for changing HTTP Port ==
When Cumulus starts, it will display the URL of the user interface.
It runs on port 8998 by default; if this is not suitable for some reason you can over-ride it using the '-port' parameter on the command line, e.g. to use port 9999 instead:
:<code>CumulusMX -port 9999</code>
== -debug parameter for adding debugging ==
MX has a default level of logging that stores in  the [[MXdiags_folder]] folder a log file that shows minimal details of the interaction with the weather station and  of the output actions done as MX runs. A new log is started each time MX is restarted, and when a log reaches a particular size, so the log cannot keep growing.
If there is a problem, then there is a great benefit in actually increasing the level of detail in these logs; and that is done either within the settings (on recent MX releases this is on '''Program Settings''' page of admin interface - please see [[MXdiags_folder]] page for details) or by adding a parameter as you start running MX:
:<code>CumulusMX -debug</code>
5,838

edits

Navigation menu