5,838
edits
m (→sudo) |
|||
(8 intermediate revisions by the same user not shown) | |||
Line 101: | Line 101: | ||
===sudo=== | ===sudo=== | ||
By default, a Linux user will log in as a default user with limited rights | By default, a Linux user will log in as a default user with limited rights. | ||
In the '''apt''' context here, ''' | For example, the Raspberry Pi Operating System has a single default user "Pi", with their home folder that can be referenced as "~". | ||
In the '''apt''' context here, those limited rights allow use of actions that just read (such as '''search''', ''show''). | |||
However, for any action involving writing (such as '''install''', ''full-upgrade'', '''update''', ''autoremove''), the package manager needs additional rights, and we prefix the "apt" with '''sudo'''. | |||
: Elsewhere on this page you might notice [[#Running any MX executable with a terminal session left open|'''cd''']] can move round the file structure (without a "sudo"), but "sudo" is used with [[# Installing/Configuring the MX service and the -service parameter|'''cp''']] as that writes a file. | : Elsewhere on this page you might notice [[#Running any MX executable with a terminal session left open|'''cd''']] can move round the file structure (without a "sudo"), but "sudo" is used with [[# Installing/Configuring the MX service and the -service parameter|'''cp''']] as that writes a file. | ||
Novice readers should exercise caution, because using "sudo", changing folder/file ownership, adding write rights, and even using "-R" or "-y" flags, can all make it very easy to inadvertently do the wrong action, even perhaps delete vital folders/files. | |||
: '''For technical readers only''', "sudo" is further explained later [[#su_and_sudo]]) | : '''For technical readers only''', "sudo" is further explained later [[#su_and_sudo]]). Briefly, "sudo" gives super-user (root) rights when executing the instruction that follows for actions on files that are either not in the current user's ownership, or for which the current user lacks necessary (read, write, execute) permissions. | ||
===apt=== | ===apt=== | ||
Line 115: | Line 119: | ||
The second part of our installation commands is “apt” meaning “Advance Package Tool”. In simple terms, it runs the “package manager” used in Linux. | The second part of our installation commands is “apt” meaning “Advance Package Tool”. In simple terms, it runs the “package manager” used in Linux. | ||
If you are looking online for a tutorial on how to install packages, you might see “apt-get” or "apt-cache" used in examples they quote. It should be safe to replace these older package managers with "apt". I have included a little technical explanation at the end of this page if this really worries you. | If you are looking online for a tutorial on how to install packages, you might see “apt-get” or "apt-cache" used in examples they quote. It should be safe to replace these older package managers with "apt". I have included [[#Package Manager – a brief technical aside|a little technical explanation]] at the end of this page if this really worries you. | ||
===install=== | ===install=== | ||
Line 202: | Line 206: | ||
MX uses this library for weather stations (like Fine Offset and USB connected Oregon Scientific models) that appear as a HID via a USB connection. To check if your weather station appears as a HID, download this [https://cumulus.hosiene.co.uk/download/file.php?id=11414 USB HID test package] and run it. | MX uses this library for weather stations (like Fine Offset and USB connected Oregon Scientific models) that appear as a HID via a USB connection. To check if your weather station appears as a HID, download this [https://cumulus.hosiene.co.uk/download/file.php?id=11414 USB HID test package] and run it. | ||
This HidSharp library calls a package ''libudev shared library'' file called ''libudev.so.1''. Most recent Linux distributions will already include the libudev shared library. On my Raspberry Pi, [[#install|typing]] <code>apt search libudev</code> showed ''libudev.so.1'' was already installed. If it is missing, then [[#install]] it. | This HidSharp library calls a package ''libudev shared library'' file called ''libudev.so.1''. Most recent Linux distributions will already include the libudev shared library. On my Raspberry Pi, [[#install|typing]] <code>apt search libudev</code> showed ''libudev.so.1'' was already installed. If it is missing, then [[#install]] it. | ||
Line 264: | Line 267: | ||
# follow step 1 there, | # follow step 1 there, | ||
# but in step 2 replace ‘’’mono-devel‘’’ by ‘’’mono-complete’’’ | # but in step 2 replace ‘’’mono-devel‘’’ by ‘’’mono-complete’’’ | ||
The complete mono package includes a component (mono-xsp4) that creates a simple web server to run ASP.NET 4.0 applications. MX does not need this, so type <code>sudo update-rc.d mono-xsp4 disable</code>. | |||
=Cumulus packages= | =Cumulus packages= | ||
Note use of plural in section name above, the following sub-sections will install various packages produced by Developer Mark Crossley. If you are using the [[Software#Cumulus_MX|pre-built disc image]], then (unless the MX release version included in your image is an old one) you should skip the instructions for "CumulusMX". | Note use of plural in section name above, the following sub-sections will install various packages produced by Developer Mark Crossley. If you are using the [[Software#Cumulus_MX|pre-built disc image]], then (unless the MX release version included in your image is an old one) you should skip the instructions for installing "CumulusMX" itself. | ||
==Handling zip files== | ==Handling zip files== | ||
Line 295: | Line 300: | ||
*# The developer suggests you use ‘’’/opt’’’ for EXISTING PATH (which should be available on any Linux computer). | *# The developer suggests you use ‘’’/opt’’’ for EXISTING PATH (which should be available on any Linux computer). | ||
*#* By default, the code Mark provides for installing Cumulus as a service, will run that service as a root user, and the root user has full permissions in /opt (and everywhere else) | *#* By default, the code Mark provides for installing Cumulus as a service, will run that service as a root user, and the root user has full permissions in /opt (and everywhere else) | ||
*#* If you do choose a EXISTING PATH outside your home folder, | *#* (Novices: Skip this step) If you do choose a EXISTING PATH outside your home folder, then a more technical user can change the ownership of the "CumulusMX" sub-folder, to the default user (Pi) with <code>sudo chown -R pi: EXISTING PATH/CumulusMX</code>, and reduce the need to use "sudo" on many actions. | ||
==Packages to install== | ==Packages to install== | ||
Line 340: | Line 345: | ||
All the (optional) files in the [[Reports folder]] can be copied across from a previous installation. If your previous installation was not on Linux, see [[#Line terminators in .txt files]] | All the (optional) files in the [[Reports folder]] can be copied across from a previous installation. If your previous installation was not on Linux, see [[#Line terminators in .txt files]] | ||
<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''' in [[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. | ||
* Microsoft Windows uses different line terminators, see [[#Line terminators in .txt files]], although MX should cope, 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 437: | Line 447: | ||
# as a service and | # as a service and | ||
# interactively with terminal window left open. | # interactively with terminal window left open. | ||
As a side-note, some weather station types require MX to be run with '''root''' rights, this is why ''sudo'' is included in each example command, but if you have technical knowledge and know your weather station can be run with default user, you can omit the ''sudo'' provided your user has ownership of all folders and files used by MX. | |||
== Optional parameters to add to the instruction to run the MX engine == | == Optional parameters to add to the instruction to run the MX engine == | ||
This list of parameters covers every parameter, if you are using the latest release skip the historic 3.0.0 sub-sections. | This list of parameters covers every parameter, if you are using the latest release skip the historic 3.0.0 sub-sections. | ||
Note that you ''may'' need to supply your root password after typing any 'sudo ...' command line if the instruction changes something set by another package (e.g. changing the locale for MX from the locale set by mono). The system will prompt you for this if it is needed. | Note that you ''may'' need to supply your root password after typing any 'sudo ...' command line if the instruction changes something set by another package (e.g. changing the locale for MX from the locale set by mono). The system will prompt you for this if it is needed. | ||
Line 448: | Line 458: | ||
=== -port parameter for changing Port === | === -port parameter for changing 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 | 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 change it using the '-port' parameter on the command line, e.g. to use port 9999 instead: | ||
<pre>sudo mono CumulusMX.exe -port 9999</pre> | <pre>sudo mono CumulusMX.exe -port 9999</pre> | ||
=== -lang parameter for changing Locale === | === -lang parameter for changing Locale === | ||
Individual computers may have different default for their locale. The forum reported an issue with OS X with its default US locale even if that is not your locale. | |||
As MX starts its output (to diagnostic log and to any interactive terminal window) says which locale is being used, '''Current culture: English (United States)'''. That default locale will relate to the one your computer had when mono is installed, as it is mono that tells MX all the locale settings. If you notice MX starting with wrong locale, issue the correct instruction to close MX. | |||
You can use a '''-lang''' parameter to change the locale as you restart MX. For example, in the UK, type: | |||
:<code>sudo mono CumulusMX.exe -lang en-GB</code> | :<code>sudo mono CumulusMX.exe -lang en-GB</code> | ||
Other locale examples: | Other locale examples: '''CumulusMX.exe -lang de-DE''', '''CumulusMX.exe -lang el-GR''' (this is one of the locales that reads numbers with '''integer,decimal''' format), '''CumulusMX.exe -lang nl-NL'''. | ||
If you are not sure what value you need to supply for the -lang parameter, there is a list here - http://msdn.microsoft.com/en-gb/library/ee825488%28v=cs.20%29.aspx. You need to supply the code in the first column ("Language Culture Name") in that list. | If you are not sure what value you need to supply for the -lang parameter, there is a list here - http://msdn.microsoft.com/en-gb/library/ee825488%28v=cs.20%29.aspx. You need to supply the code in the first column ("Language Culture Name") in that list. | ||
Line 463: | Line 477: | ||
=== Installing/Configuring the MX service and the -service parameter=== | === Installing/Configuring the MX service and the -service parameter=== | ||
The parameter syntax is <code>sudo mono CumulusMX.exe -service</code> | The parameter syntax is <code>sudo mono CumulusMX.exe -service</code> | ||
Line 470: | Line 482: | ||
You don't use this parameter in a terminal or interactive instruction for running MX. Instead it appears within a file that we use to set up for running MX as a service. | You don't use this parameter in a terminal or interactive instruction for running MX. Instead it appears within a file that we use to set up for running MX as a service. | ||
For | For recent releases, (see [https://cumulus.hosiene.co.uk/viewtopic.php?p=146473#p146473 original release announcement]): | ||
#There is a task to do just once to configure the service | #There is a task to do just once to configure the service | ||
#Find the '''EXISTING PATH/CumulusMX/MXutils/linux/''' sub-folder, that might be in home directory and therefore found using "~/CumulusMX/MXutils/linux" as explained elsewhere on this page | #Find the '''EXISTING PATH/CumulusMX/MXutils/linux/''' sub-folder, that might be in home directory and therefore found using "~/CumulusMX/MXutils/linux" as explained elsewhere on this page | ||
Line 484: | Line 496: | ||
There are some edits needed to that section: | There are some edits needed to that section: | ||
# | # Technical users might want to edit the '''User=root''' line so that the service will run as a different user, novice users are best to leave this alone | ||
# | # Everyone must edit the line that begins with '''ExecStart=''' | ||
#* The mandatory change is to replace '''/home/install''' by what you have selected for EXISTING PATH | #* The mandatory change is to replace '''/home/install''' by what you have selected for EXISTING PATH | ||
#* An optional change is to add additional parameters after the '''-service''' (select from '''-debug''', -locale, -port) as described in sub-sections above | #* An optional change is to add additional parameters after the '''-service''' (select from '''-debug''', -locale, -port) as described in sub-sections above | ||
#save file with a new name ''' | # Next save file with a new name '''cumulusmx_edited.service''' (using a new name stops it being overwritten when we upgrade MX | ||
# | # Now copy file to where it is needed to run the service <code>sudo cp EXISTING_PATH/CumulusMX/MXutils/linux/cumulusmx_edited.service /etc/systemd/system/cumulusmx.service</code> | ||
# Finally, optionally create a symbolic link to that file using <code>sudo systemctl enable cumulusmx</code> if you want the service to start after a reboot | |||
< | |||
====Setting up as a service in release 3.8.0 ==== | ====Setting up as a service in release 3.8.0 ==== | ||
The previous section covered how to set up a service in all recent releases, but if you are still using the [https://cumulus.hosiene.co.uk/viewtopic.php?p=145048#p145048 3.8.0 release] then different instructions were supplied: | |||
# Ensure you are in the folder containing CumulusMX.exe | # Ensure you are in the folder containing CumulusMX.exe | ||
# Type <code> mono-service -l:/var/run/cmx.pid CumulusMX.exe -service</code> | # Type <code> mono-service -l:/var/run/cmx.pid CumulusMX.exe -service</code> | ||
Line 518: | Line 512: | ||
=== -debug parameter for adding debugging === | === -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>sudo mono CumulusMX.exe -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. | 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 [[ | 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. | ||
=== Parameters only applicable to Version 3.0.0 Beta builds of MX === | === Parameters only applicable to Version 3.0.0 Beta builds of MX === | ||
Line 532: | Line 528: | ||
Beta builds in MX version 3.0.0 had an optional parameter <code>sudo mono EXISTING PATH/CumulusMX/CumulusMX.exe -wsport nnnn</code> that determined which port (represented by a 4 digit number ''nnnn'') was used for '''Web Sockets'''. | Beta builds in MX version 3.0.0 had an optional parameter <code>sudo mono EXISTING PATH/CumulusMX/CumulusMX.exe -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==== | ==== -logging parameter for debugging of data flow between station and MX==== | ||
Beta builds in MX version 3.0.0 had an optional parameter <code>sudo mono CumulusMX.exe -Logging=1</code> (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. | |||
==Running as a service== | ==Running as a service== |
edits