MX on Linux: Difference between revisions

From Cumulus Wiki
Jump to navigationJump to search
1,311 bytes added ,  21:15, 23 July 2021
m
m (→‎Running MX on Linux: change sequence of parameters)
(6 intermediate revisions by the same user not shown)
Line 175: Line 175:
sudo apt autoremove
sudo apt autoremove
</code>
</code>
Each of those can be understood from information in previous section.


Each of these can be understood from information in previous section.
If you are installing onto a Pi zero, or similar slow computer, please ensure the size of the swapfile is as big as possible, as the mono-complete we will install is large. In linux, we type <code>free -m</code> to see our RAM size and our swapfile size.
 
To change swapfile size on the Raspberry Pi, you need to edit a file <code>sudo nano /etc/dphys-swapfile</code>.  Move the cursor down line by line until it reaches '''CONF_SWAPSIZE=100'''.  That is showing that the swapfile is only 99 mb by default in the Raspberry Pi Operating System. Now move the cursor to the 100, and change it to "512" which is enough for mono even on a Pi zero. Next, stop, and restart the relevant service using <code>sudo /etc/init.d/dphys-swapfile stop && sudo /etc/init.d/dphys-swapfile start</code>. That should complete quickly, and we can type <code>free -m</code> again to see the 99 we saw previously has been replaced by 511.


=== USB HID ===  
=== USB HID ===  
Line 182: Line 185:
There is one more prerequisite package for MX with some weather station types.
There is one more prerequisite package for MX with some weather station types.


The cross-platform Universal Serial Bus (USB) Human Interface Device (HID) library used by MX to connect to weather stations (like Fine Offset and USB connected Oregon Scientific models) that appear as a HID connecting via USB calls a package file called ''libudev.so.1'', so you may need to [[#install|search]] your Linux computer for this file.
The cross-platform [https://www.nuget.org/packages/HidSharp/ Universal Serial Bus (USB) Human Interface Device (HID) library] used by MX to connect to weather stations that appear as a HID connecting via USB (like Fine Offset and USB connected Oregon Scientific models) calls a package file called ''libudev.so.1'', so you may need to [[#install|search]] your Linux computer for this file, and [[#install]] it if it is missing. Alternatively, you might just need a symbolic link where MX looks to where the file is.


To check your USB devices, type <code>sudo lsusb -t</code).   
To check your USB devices, type <code>sudo lsusb -t</code).   
Line 204: Line 207:
===Add the Mono repository for a Raspberry Pi===
===Add the Mono repository for a Raspberry Pi===


The two Mono repositories listed here are specific to the 2017 and 2019 releases (respectively) of the operating system for a Raspberry Pi computer.  These are taken from  [https://www.mono-project.com/download/stable/#download-lin-raspbian].
The two Mono repositories listed here are specific to the 2017 and 2019 releases (respectively) of the operating system for a Raspberry Pi computer.  These are taken from  [https://www.mono-project.com/download/stable/#download-lin-raspbian download-lin-raspbian].


# the first line (in each case) installs a certificate
# the first line (in each case) installs a certificate
# the echo line defines a repository to add to the sources list.
# the echo line defines a repository to add to the sources list.


{| class="wikitable" border="1"
{| class="wikitable" border="0"
|-
|-
!style="width:450px" | Raspberry Operating System 9 (stretch)
!style="width:450px" | Raspberry Operating System 9 (stretch)
!style="width:450px" | Raspberry Operating System 10 (buster)
!style="width:450px" | Raspberry Operating System 10 (buster)
|-
|-
|<code>sudo apt install apt-transport-https dirmngr gnupg ca-certificates<br>
| sudo apt install apt-transport-https dirmngr gnupg ca-certificates<
<br>
| sudo apt install apt-transport-https dirmngr gnupg ca-certificates
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF<br>
|-
<br>
| <code>sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF</code>
echo "deb https://download.mono-project.com/repo/debian stable-raspbianstretch main" | sudo tee /etc/apt/sources.list.d/mono-official-stable.list
| <code>sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF</code>
</code>
|-
|<code>sudo apt install apt-transport-https dirmngr gnupg ca-certificates<br>
| <nowiki>echo "deb https://download.mono-project.com/repo/debian stable-raspbianstretch main"</nowiki>
<br>
| <nowiki>echo "deb https://download.mono-project.com/repo/debian stable-raspbianbuster main"</nowiki>
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF<br>
|-
<br>
| sudo tee /etc/apt/sources.list.d/mono-official-stable.list
 
| sudo tee /etc/apt/sources.list.d/mono-official-stable.list
echo "deb https://download.mono-project.com/repo/debian stable-raspbianbuster main" | sudo tee /etc/apt/sources.list.d/mono-official-stable.list
</code>
|}
|}


==Add the Mono repository to Ubuntu, Debian, Fedora==
===Add the Mono repository to Ubuntu, Debian, Fedora===


At time of writing, [https://www.mono-project.com/download/stable/#download-lin-ubuntu], shows the instructions for versions 16, 18, and 20 of Ubuntu.
At time of writing, [https://www.mono-project.com/download/stable/#download-lin-ubuntu download-lin-ubuntu], shows the instructions for versions 16, 18, and 20 of Ubuntu.


Equally, [https://www.mono-project.com/download/stable/#download-lin-debian], gives details for debian, and [https://www.mono-project.com/download/stable/#download-lin-fedora] for Fedora.
Equally, [https://www.mono-project.com/download/stable/#download-lin-debian download-lin-debian], gives details for debian, and [https://www.mono-project.com/download/stable/#download-lin-fedora] for Fedora.


Others can be found by choosing other tabs on any of those links.
Others can be found by choosing other tabs on any of those links.
Line 420: Line 421:
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:
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:
<pre>sudo mono CumulusMX.exe -port 9999</pre>
<pre>sudo mono CumulusMX.exe -port 9999</pre>
=== Parameter for adding debugging ===
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 [[MXdiags_folder]] page for details) or by adding a parameter: 
:<code>sudo mono CumulusMX.exe -debug</code>


=== Parameter for changing Locale ===
=== Parameter for changing Locale ===
Line 485: Line 477:
WantedBy=multi-user.target</pre>
WantedBy=multi-user.target</pre>


== Setting up as a service release 3.8.0 ==
== Setting up as a service in release 3.8.0 ==


Skip this sub-section for latest release.   
Skip this sub-section for latest release.   
Line 493: Line 485:
# 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>
# (to verify) note this does not allow you to add -port, -debug, -locale parameters
# (to verify) note this does not allow you to add -port, -debug, -locale parameters
=== Parameter for adding debugging ===
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 [[MXdiags_folder]] page for details) or by adding a parameter: 
:<code>sudo mono CumulusMX.exe -debug</code>


=== 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 502: Line 501:
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'''.  


 
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 described earlier.  
That parameter is now deprecated as Web Sockets in all builds since 3045 uses the same port as the rest of the [[MX_Administrative_Interface#The_API_interface|Admin Interface]], see Port parameter below.  


==== Debugging of data flow between station and MX====
==== Debugging of data flow between station and MX====
Line 511: Line 509:
Note use of this parameter is now deprecated.
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.
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 described earlier.  Perhaps someone could confirm whether this is true.




5,838

edits

Navigation menu