Original Cumulus Wiki and Raspberry Pi Image: Difference between pages

From Cumulus Wiki
(Difference between pages)
Jump to navigationJump to search
m (→‎Please help: layout change, links updated)
 
(Add root account information)
 
Line 1: Line 1:
== Using the pre-built Raspberry Pi Image ==
<big>'''Welcome to the Cumulus Wiki'''</big>, this community Wiki is for sharing knowledge of the [[About Cumulus|Cumulus]] Weather Station software. [[CumulusWiki:About|This Wiki]] was originated to document the (original) Cumulus (1) software Steve Loft developed. ''The vast majority of the original content used Steve's own words, and he was a key contributor.''
We have created an customised version of the Raspberry Pi Lite image with Cumulus MX pre-installed and ready to go.


This is designed to be what is called a "headless" installation, that is to be run on a Raspberry Pi without a monitor or keyboard attached to it. As such the image does not contain a Graphical User Interface (GUI), it is a command line only installation. It is possible to add the GUI later if you want it.
Other contributors reviewed what Steve said in answers in the support forum, and collated that material into pages in this Wiki, so Steve's knowledge could be shared more systematically. When Steve Loft developed other flavours, the content here also covered those. This Wiki retains content for the legacy original Cumulus software that people still use, some of that legacy content has been locked against further editing. Steve Loft deleted the material on Cumulus 2 when he abandoned that development, but his [[Cumulus 3 (MX) beta documentation|MX 3.0.0 beta]] documentation remains. This copy of the original Cumulus Wiki was cloned on 26-Oct-2018, just before Steve Loft ended his association with Cumulus, and all user credentials from the deleted original Wiki hosted by ''sandaysoft.com'' should be valid here.


===Alternatives to using image===
There is limited support available for the legacy software and any remaining legacy users are encouraged to [[Migrating from Cumulus 1 to MX|Migrate from Cumulus 1]] to the vastly different Cumulus MX. A number of developers are contributing to MX, but the big transformation (from Steve's original) has been almost entirely developed by Mark Crossley.
Should you decide not to use the image, please see instructions in the support forum about [https://cumulus.hosiene.co.uk/viewtopic.php?f=44&t=18916 installing MX], about installing specifically on [https://cumulus.hosiene.co.uk/viewtopic.php?t=17895 Raspberry PI computer], and about installing on [https://cumulus.hosiene.co.uk/viewtopic.php?t=18766 any Linux computer].


=== Pre-Installation Steps ===
<div style="padding-left: 20px; width: 95%; border:solid; border-width: thin; padding:10px; margin-bottom:20px; padding-bottom:20px; background-color:LightYellow;">
You will need:
* A suitable (micro) SD (high capacity) card for your Raspberry Pi
:A minimum size of 16GB is recommended. Be sure to buy a good quality card.
:You can use an SSD instead if preferred [with the minor complication that in a later step you will need non-WiFi access to the Raspberry Pi (keyboard and monitor, or SSH over ethernet) as you cannot enter the WiFi details from a Windows PC to the linux SSD (Windows cannot understand the different file system used on the SSD for Linux, it is different to the file system Microsoft uses on a SSD)].
* An image installer to copy the image file to the SD card
:The [https://www.raspberrypi.org/documentation/installation/installing-images/ Raspberry Pi site] has a list of suitable software for your operating system. Scroll down to "Writing the image".<br />
: This guide uses Raspberry Pi Imager
* The image file to install
:Download the latest image file from the [[Software#Current_Release|Software Download page]], these are not produced for every MX release.
* An SSH terminal program to configure your Raspberry Pi
: For Windows we recommend using [https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html PuTTY]
* A file transfer program - though you will not need this right away, you will need it at some point. The main uses will be...
:* Copying Cumulus MX updates to your Raspberry Pi
:* Extracting the diagnostic files from Cumulus MX if this go wrong
:* Setting up a web site<br />
:A popular program for Windows is [https://winscp.net/eng/download.php WinSCP] which shares some configuration with PuTTY (but some people prefer FileZilla program and its interface).


=== Installing the Image ===
<big>'''''You do not need a userid to READ any of the content on this Wiki.''''' </big>
This installation was performed on a Windows computer using the [https://www.raspberrypi.org/downloads/ Raspberry Pi Imager v1.4] software
[[File:PiImager-01.png|none]]
* Insert your blank SD card into your computer - if not blank whatever is on the card will be erased.
* Start Raspberry Pi Imager
:* Click the CHOOSE OS button, scroll down to the bottom of the list and select '''Use custom'''
:*; [[File:PiImager-02.png|none]]
:* Browse to the location of the OS Image zip file you downloaded - do not unzip it
:* Click CHOOSE SD CARD, and select the SD card from the Device dropdown - check you have the correct drive selected!
:*; [[File:PiImager-04.png|none]]
:* Click the WRITE button. Writing the image will take a few minutes
:* Once the image has finished been written, you can close Raspberry Pi Imager<br /><br />
* '''''OPTIONAL''''' - If you wish to connect your Pi to the network using WiFi from the first boot, then you will need to follow these additional steps.
*;Note. If you connect via an cabled network, you can always configure the WiFi later using the command line
:* Eject your SD card from your computer and re-insert it
:* Locate the SD drive in File Explorer.
:* On the SD drive edit a file called '''wpa_supplicant.conf.txt''' with a text editor and...
::* Change the country code to match your location - eg. US, GB, FR etc
::* Set the ssid to match your WiFi id
::* Set the psk to your WiFi password
:* Save the file, and then rename it to '''wpa_supplicant.conf''' - i.e. remove the .txt filename extension<br /><br />
* Eject the SD card from your computer. Insert it into your Raspberry Pi and power up.


Please note, the edit above changes the country code for the wireless (WiFi) connection, the image is built on the basis that your Raspberry Pi will operate in the GB timezone, and MX will run using the GB locale. You can only modify those after installation is completed on your RPi computer.
If you are new to Wiki's we suggest you spend a few minutes reading basic articles about this Wiki. Familiarise yourself with:
*Explaining [[Help:Contents/tabs|tabs]] at top of page
*How to [[Help:Contents#Reading|read]]
*How to [[Help:Contents#Searching|search]]


=== First Boot ===
Please see the bottom of this page for how ''you can contribute'' to this Wiki. If you plan on '''CONTRIBUTING''' to the Wiki, then you will need a account with userid.
* Connect the Pi to your wired network if you did not configure the WiFi as per the steps above.
The quickest way to get a new account is to put a request via the support forum (see pink background text there)
* Power on the Pi.
'''''When requesting a Wiki account, please quote the user name you use on the Cumulus support forum, or provide other evidence of you being a genuine Cumulus user.
* Now wait 5 minutes. The first boot will be resizing your disk and optionally configuring your WiFi
Otherwise use the [[Special:RequestAccount|Request Account]] form to apply for a userid, '''use the biography box to explain what you will contribute if you are granted write access''', not to describe your past (you may have to wait some time for an administrator to have spare time to wade through loads of spam requests to find any real Cumulus user request).
* Start your browser and see if you can connect to this URL: '''<nowiki>http://cumulusmx:8998</nowiki>'''
Do be aware there are many spammers attempting to gain access, and any request that does not comply with above instruction makes it impossible for the admins to identify genuine account requests from spammers.'''''
:* If you can great - you should now see the Cumulus MX console
(Please note, the support forum and this Wiki are hosted by different people, on different web hosts, so do use a different password!)
:* If not, then you will have to find out the Raspberry Pi's IP address from your router. Then try connecting to this URL: '''http://<ip_address>:8998''' (example: '''<nowiki>http://192.168.1.123:8998</nowiki>''' where the numbers before :8998 are those for YOUR Raspberry Pi from YOUR router). It just depends on your router whether it allows use of the URL name (cumulusmx) or requires the IP address.


=== Verify your SSH Connection ===
Brian Underdown (weather34) has allowed us to host his [[HomeWeatherStationTemplate|Home Weather Station template for Cumulus]] on the Wiki.
* Fire up your SSH Client - we use PuTTY here
</div>
:* Enter the hostname as "cumulusmx", and check the protocol is set to SSH. Then open the connection.<br />
: (As before, you may need to enter the Pi's IP address instead of the hostname if that does not work)
:*; [[File:PuTTY-01.png|none]]
* You will have the accept the SSH key the first time you connect
* Enter the username "cmx" and password "cumulusmx"
: ''For prior releases up to 3.15 the username was "pi" and password (note UK spelling) "raspberry"''
* '''You should now change the default password'''
:* Use the '''passwd''' command to do this now...
<nowiki>cmx@cumulusmx:~ $ passwd
Changing password for cmx.
Current password:
New password:
Retype new password:
passwd: password updated successfully</nowiki>
* '''Now you can check/configure your RPi for your locale and timezone settings.'''<br />
: You '''must''' do this before you configure Cumulus MX if you are going to change it. Changing the locale after Cumulus MX has connected to your station means you may be in for a lot of editing of data files!
** ''The build has set a default which is for '''en_UK UTF-8''' locale and '''GMT''' timezone''.
** Use '''sudo raspi-config''' 5. Localization Options, L1 Locale (select en_US ISO-8851-1 for USA if needed) and L2 Timezone (select the appropriate timezone), then '''sudo reboot''' if needed to engage the new settings.
** NOTE: if you are using ''bullseye'' (or up), verify all locale settings are the same (run: locale). If not then edit /etc/default/locale and add (or change) LC_ALL=<locale wanted>. save, exit and reboot again.
* Check the status of the Cumulus MX service with the command '''sudo systemctl status cumulusmx'''<br />
: You will get some information back, the important bit to note is the line starting '''Active:''', it should say '''active (running)'''
* You can leave the SSH session open, you will need it again soon...


=== Configure Cumulus MX ===
Now it is time to configure Cumulus MX for your station.
* Start your browser and connect to the same URL as before - '''<nowiki>http://cumulusmx:8998</nowiki>''' or '''http://<ip_address>:8998'''
* From the menu select '''Settings | Station Settings''', then follow '''[https://cumuluswiki.org/a/Cumulus.ini#First run of MX this guide for configuring your station].'''
* Once your have completed all the settings for for station, and successfully saved them, Cumulus MX will need to be restarted.
* Back in your SSH session, send the command '''sudo systemctl stop cumulusmx''', this stops the Cumulus MX service.
* Wait a few seconds, then enter the command '''sudo systemctl start cumulusmx''', this starts the Cumulus MX service again.
* Back to your browser and check that URL - '''<nowiki>http://cumulusmx:8998</nowiki>''' or '''http://<ip_address>:8998''' - again. If all is well, the default dashboard page should start showing the data from your weather station.
:* If it does, congratulations, you have successfully started recording your weather data
:* If it doesn't, then check back over this process carefully for any mistakes or omissions you may have made.
:* If you cannot resolve the problem, then ask for [https://cumulus.hosiene.co.uk/viewforum.php?f=40 help on the forum]


== Additional Steps ==
If you have any questions please raise them on either the [https://cumulus.hosiene.co.uk/viewforum.php?f=38 Cumulus forum] or [https://www.wxforum.net/index.php?board=105.0 Cumulus board at WXForum.net].
''To be expanded''
<div>
{| class="t_nav_main"
|-
!style="width:60px"| [[Image:Badge vMx.png|left|50px]]Cumulus MX (V.3)
!style="width:100px"| [[Image:Icon info.png|left|50px]]Legacy Cumulus (V.1)
!style="width:50px"| [[Image:Icon tool.png|left|50px]]Customisation
!style="width:80px"| [[Image:Icon article.png|left|50px]]Reference
|-


* Configuring WiFi from SSH
|
** ''To be expanded''
*[[:Category:Cumulus MX|Starting point for all MX documentation]]
* Stopping Cumulus MX starting up when the Pi boots
*[[What_to_do_when_I_have_a_problem_with_MX|Solving problems]]
** The build sets up MX to run as a service, and to start when the computer builds, so it will be running when you switched your Raspberry Pi on
*'''Download''' links:
** To stop this auto-starting behavior permanently, just type <code>sudo systemctl disable cumulusmx</code> once.
** [[Software#Current_Release|Current MX]],
* Give your Pi a fixed IP address
** [[Software#Create_Missing|Create Missing utility]],
:* Add a DHCP reservation
** [[Software#ExportToMySQL|Export To MySQL utility]],
:* Assign a static IP address
** and [https://github.com/cumulusmx/CumulusMX/releases Earlier Releases]
:If you need to use a fixed IP address for your Raspberry Pi, there are 2 methods
* [[Raspberry Pi Image]]
*[[MX_on_Linux|Install on Unix/Linux/Raspberry Pi OS]]
*[[MX_on_Windows_OS|Install on Microsoft Windows OS]]
* [[The_Alternative_Interface_(ai.cmx)]]: Local pages, Settings, and Editing
*[[MX_Administrative_Interface|MX Interface included in MX download ('''aka''' Local interface, User interface, Administrative interface, and Dashboard interface)]]: Local pages, Settings, and Editing
*[[Cumulus.ini|Configuration/settings (3.8.0 onwards)]]
*MX default web site:
**[[New Default Web Site Information|Usage information]]
**[[Default_Website_Development|latest developments]]
**[[Cumulus.ini#Optional_Web_Server|Settings relevant to web site]]
**[[:Category:JSON Files|Supporting JSON files]]
**[[WebsitedataT.json|Data for web site tables]]
**[[Webtags/Parameters|Customising Parameters]]
*[[Updating_MX_to_new_version|How to Upgrade to new MX build]]
*[[Cumulus_MX_formal_release_versions|Release tracker]]
*[[MX_Basic_info|Basic MX information]]
*[[Cumulus MX Local API|Local Application Programming Interface]]
*[[Highcharts_-_Recent|Recent Charts]] and [[Highcharts_-_Historic|Historic Charts]]
*[[MX_Issues|Known Issues/bugs]]
*[[Cumulus_MX_FAQ|Frequently asked]]
*[[Supported Devices]]


1. Adjust your router settings to always assign the same IP address. This facility has different names on different brands of router, look for a section named DHCP. You may be able to choose the IP address (possibly within or possibly outside the range assigned by DHCP), or you may only be allowed to choose 'always assign the address it currently has'. You may need to know the MAC address of the Raspberry PI, but if so that will likely be displayed alongside the current connection.


2. Adjust Raspberry Pi settings to always request the the same fixed address. This is less reliable, because your router may have assigned the requested address to a different device since the Pi was last active. To do this you have to edit this file: « '''/etc/network/interfaces''' »
|
:For Ethernet connection a line specifying port '''eth0''' is needed to describe your ethernet configuration, as the example below. For a wireless connection, it needs similar with '''wlan0''':
*[[:Category:Cumulus 1|Starting point for all legacy documentation]]
allow-hotplug eth0
*[[About Cumulus|Functionality of Cumulus Software]]
iface eth0 inet static
*[[Cumulus_Screenshots|'''Screenshots''' for Main, and other, screens]]
address 192.168.11.100
* Download links:
netmask 255.255.255.0
** [[Downloads#Download_Instructions|Instructions and installer]]
gateway 192.168.11.1
** [[Downloads#Special_Cumulus_1_versions|Instromet specials]]
dns-domain example.com
** [[Setup|How to install and use software]]
dns-nameservers 192.168.11.1
*[[FAQ|Frequently asked, questions and answers]]
''The line "dns-domain example.com" is optional''
*[[Cumulus.ini_(Cumulus_1)|Configuration settings file (cumulus.ini)]]
*[[Website setup|Set up the example (Legacy) web pages]]
*[[Cumulus Versions|History for the legacy software]]
*[[Screen capture|Capturing a screen shot for support issues]]
*[[ImportCumulusFile#IMPORTANT_NOTE_FOR_VERSION_2.x_and_3.x|Uploading from Cumulus 1.9.4 to MySQL db]]
*[[Moving cumulus|Moving your installation]]
*[[:Category:Other Languages|Other Languages]]
*[[Supported Devices]]


:You could have also to edit another file, for dns configuration.
:see file «'''/etc/resolv.conf'''» to insert these lines:
nameserver 192.168.11.1
domain example.com
''Again, the line "domain example.com" is optional''


== Information ==
|
'''Web Server:'''
*[[:Category:WebTips|Starting point for Web tips/documentation (including some basic HTML, CSS, JavaScript,PHP etc. tips)]]
*[[Customised templates|Customising Cumulus legacy templates]] and [[Cumulus_template_file|Guide to Cumulus template files]]
* Definitive list of [[Webtags|tag names for template files]] and [[Webtags/Parameters|Input and Output Modification Parameters for those web tags]]
*[[Reports folder|The (NOAA style) Climate Reports functionality]]
*[[Simple_Website_setup|Legacy simple web site]]
*[[Webspace|Commercial Web site hosting]]
*[[Your_Own_Server|Your Own Web/Database Server]]


If you previously used Microsoft Windows with each part of a path separated by "\", please remember that all other operating systems, including that for Raspberry Pi, use "/" to both indicate the root (at start) and to separate parts of a path, as per the install location shown next.
'''Shared by Third Parties:'''
*[[:Category:User Contributions|Starting point for 3rd Party Contributions]]
*[[:Category:WebTools|Starting point for 3rd Party web pages/tools]]
*[[:Category:SteelSeries|Steel Series Gauges]]
*[[:Category:CumulusUtils|CumulusUtils (3rd party add-on for MX)]]
*[[:Category:3rd Party Apps|3rd Party Apps (for your devices)]]


=== Install location ===
In this image Cumulus MX is installed into '''/opt/CumulusMX'''


If you have run MX before, you will copy your existing [[Cumulus.ini]], and optional [[Strings.ini]], into that folder. But be aware that MX has been set to run on boot, so MX will have started, and you must stop it with <code>sudo systemctl stop cumulusmx</code>, before you can add these files.


=== Symbolic Links ===
|
* [[:Category:Terminology|Cumulus Terminology]]
* [[:Category:StationSpecific|Details specific to a particular weather station type]]
* [[:Category:Cumulus Files|Information by folder and file names]]
* [[:Category:Ini Files|All about the '''.ini''' files that store extreme records]]
* [[:Category:Files with Comma Separated Values|All about text files that store data with Comma Separated Values]]
* [[Correcting Extremes|Full guide to correcting extremes Records]]
* [[Standard log files|Logging of standard values]] and [[Calculate_Missing_Values|Full guide to populating missing standard values]]
* [[Dayfile.txt|The daily summary log (dayfile.txt) introduction]] and [[Amending dayfile|Full guide to dayfile.txt correction]]
* [[Raspberry_Pi_computer_page|Raspberry Pi computer and MX]]
* [[Migrating from Cumulus 1 to MX|How to migrate from legacy original Cumulus to MX]]
* [[Compare C1 and MX|Compare functionality in legacy original Cumulus with MX]]


The image contains a number of pre-created symbolic links for Cumulus MX files such as realtime.txt and the standard website tmp files. These links divert these files to the random access memory chip (within the standard Linux folder "/run", the RAM storage area is configured as subfolder "/cumulusmx") to reduce wear on your SD card.
*[[Twitter Usernames|Twitter users]] (obsolete)
*[[Cumulus Users|User Websites]] (obsolete)


The full list of symbolic links could be added here by another contributor, presumably these cover every .json file that is produced for the default web page with fully defaulted settings as to which files are produces. For the moment, two symbolic link examples are included below:
|}
# the processed ''realtime.txt'' -> /run/cumulusmx/realtime.txt
</div>
# the processed '''wxnow.txt''' -> /run/cumulusmx/wxnow.txt


=== Root Account ===
<br>
==Please help==


The image does not alter the default root account from the Raspberry Pi OS base image. So the root account does not have a password set, and cannot be used to logon to the system. If you wish to relax this default security then there are plenty of web sites with instructions on how to do this.
<div style="padding-left: 20px; width: 95%; border:solid; border-width: thin; padding:10px; margin-bottom:20px; padding-bottom:20px; background-color:LightYellow;"><big>'''It's your Wiki......'''</big><br> <br>We always welcome contributions from the Cumulus Community and if you feel you can contribute, please do.


=== Image Customisations ===
:If you already have a userid, then just [[Special:UserLogin|Login here]] (link also available on top right of any page).


* Based on the 'Lite' version of the Raspberry Pi OS (i.e. the graphical desktop GUI is not included)
*'''Are you willing to contribute to this Wiki's documentation?'''
* Full install of Mono
* Are you new to Cumulus MX? If so, you are the best possible person to know what newcomers need in this Wiki. You also know what you have discovered, and can document it to be useful for others.
* Update of all packages
#<big>As a starting point, we suggest you read [[Help:Contents/Editing|How to Edit]],</big>
* Install of Cumulus MX
#*that is full of hints on how to write Wiki pages,
#*including Cumulus Wiki specific help.
* Set Cumulus MX to auto-start
* Enable SSH service
#If you
* Disable IPv6
#*want a suggestion to start you off ...
* Set hostname to "cumulusmx"
#*or want to make a suggestion ...
#** ... [[How_you_can_contribute]] is the page you should go to, its content should be updated when work done, or suggestions need to be recorded.


NOTE: If you later want to add the graphical desktop GUI, please check online for the latest instructions, but when last researched, these 4 steps were needed for Buster:
* This ''Main Page'' (only administrators can update this page) was redesigned in January 2021, the biggest changes were
# sudo apt update
*# It provides direct links to a new set of [[Special:Categories|category pages]], '''Anyone can edit any of the new, and amended, "category" pages, those are now the entry points grouping the rest of the documentation in this Wiki.'''
# sudo apt install xserver-xorg
*# The pages specific to MX and specific to legacy software are now in separate columns
# sudo apt install raspberrypi-ui-mods
*# This main page does provide direct links to key pages that are unlikely to be renamed/removed, but administrators have limited time to edit such links.
# sudo reboot


===Further Information===


There are two other pages in this Wiki that might be useful to read [[Raspberry Pi computer page]] and [[MX on Linux]].
* The old Fine Offset stations were long ago documented in some pages linked from [[:Category:StationSpecific]]

* There is minimal documentation for [[Davis]] stations and [[Instromet]] stations, can you rectify this?
=== systemctl commands ===
* There is no documentation yet for the newer Ecowitt devices, can you rectify this?
You can use the following commands to control Cumulus MX...
* This Wiki documents the legacy Cumulus 1 in good detail due to many different contributors
: To start Cumulus:
* Steve Loft, and Mark Crossley, (plus others), modified some legacy pages to also cover the original [[Cumulus_3_(MX)_beta_documentation| MX 3.0.0 beta]], but that had very limited functionality (just a subset of that available in Cumulus 1) and only 2 new pages were added.
sudo systemctl start cumulusmx
* Most pages that are specific to legacy Cumulus 1 have been locked, to prevent editing for MX differences and to ensure they are preserved for those still using the legacy software (all pages relating to Cumulus 2 were removed by Steve Loft)
: To stop Cumulus:
* <big>The MX of today, thanks to Mark Crossley leading development (with small contributions from others), is totally different from that early MX beta; do you use/understand any of the new functionality (not documented for legacy software) meaning you can document it for those new to that functionality?</big>
sudo systemctl stop cumulusmx
# MX has changed dramatically, therefore some of the early MX documentation has been deleted, and some pages make it clear that they apply to an earlier MX release.
: To check if Cumulus is running:
# MX offers so much functionality, that nobody uses everything MX can do. Some pages use the '''<nowiki>{{Template:WorkInProgressBanner}}</nowiki>''' to indicate other contributors are needed to expand the current content
sudo systemctl status cumulusmx
</div>
: To restart Cumulus:
sudo systemctl restart cumulusmx
: To make Cumulus start at system boot time:
sudo systemctl enable cumulusmx
: To stop Cumulus starting at boot time:
sudo systemctl disable cumulusmx

=== Starting Cumulus MX from the command line ===
You may want to start Cumulus from the command line for diagnostic purposes, you can still do this...

First make sure the Cumulus MX service is stopped
sudo systemctl stop cumulusmx

Then issue a change path command to move to the Cumulus folder and start MX there<br>
(Noting it is case sensitive).
: cd /opt/CumulusMX
: sudo mono CumulusMX.exe

= Build Creation Notes =
Here are the technical details:
* Installed Raspberry Pi Buster Lite (August 2020)
* Enabled SSH
* Installed latest updates - apt update/upgrade
* Installed latest Mono complete stable version (6.12)
* Clean up apt - apt autoremove
* Changed hostname to "cumulusmx"
* Edited cumulusmx.service and copied to /etc/systemd/system
* Disabled mono-xsp4 service - update-rc.d mono-xsp4 disable
* Copied full CMX download to /opt/CumulusMX folder
* Created symbolic links for temp files to /run/cumulusmx



The following commands are useful in creating the image file (created on Debian).

Create image file from SD card - sdb, may be sdc etc.
dd if=/dev/sdb of=/home/<username>/rpi.img bs=1M

Shrink the image file.<br />
Download pishrink from:
wget https://raw.githubusercontent.com/Drewsif/PiShrink/master/pishrink.sh
Then run it...
pishrink.sh /home/<username>/rpi.img /home/<username>/rpi2.img

Disable IPv6<br />
Edit /etc/systctl.conf<br />
Add line...
net.ipv6.conf.all.disable_ipv6 = 1

Latest revision as of 10:17, 12 July 2022

Using the pre-built Raspberry Pi Image

We have created an customised version of the Raspberry Pi Lite image with Cumulus MX pre-installed and ready to go.

This is designed to be what is called a "headless" installation, that is to be run on a Raspberry Pi without a monitor or keyboard attached to it. As such the image does not contain a Graphical User Interface (GUI), it is a command line only installation. It is possible to add the GUI later if you want it.

Alternatives to using image

Should you decide not to use the image, please see instructions in the support forum about installing MX, about installing specifically on Raspberry PI computer, and about installing on any Linux computer.

Pre-Installation Steps

You will need:

  • A suitable (micro) SD (high capacity) card for your Raspberry Pi
A minimum size of 16GB is recommended. Be sure to buy a good quality card.
You can use an SSD instead if preferred [with the minor complication that in a later step you will need non-WiFi access to the Raspberry Pi (keyboard and monitor, or SSH over ethernet) as you cannot enter the WiFi details from a Windows PC to the linux SSD (Windows cannot understand the different file system used on the SSD for Linux, it is different to the file system Microsoft uses on a SSD)].
  • An image installer to copy the image file to the SD card
The Raspberry Pi site has a list of suitable software for your operating system. Scroll down to "Writing the image".
This guide uses Raspberry Pi Imager
  • The image file to install
Download the latest image file from the Software Download page, these are not produced for every MX release.
  • An SSH terminal program to configure your Raspberry Pi
For Windows we recommend using PuTTY
  • A file transfer program - though you will not need this right away, you will need it at some point. The main uses will be...
  • Copying Cumulus MX updates to your Raspberry Pi
  • Extracting the diagnostic files from Cumulus MX if this go wrong
  • Setting up a web site
A popular program for Windows is WinSCP which shares some configuration with PuTTY (but some people prefer FileZilla program and its interface).

Installing the Image

This installation was performed on a Windows computer using the Raspberry Pi Imager v1.4 software

PiImager-01.png
  • Insert your blank SD card into your computer - if not blank whatever is on the card will be erased.
  • Start Raspberry Pi Imager
  • Click the CHOOSE OS button, scroll down to the bottom of the list and select Use custom
    PiImager-02.png
  • Browse to the location of the OS Image zip file you downloaded - do not unzip it
  • Click CHOOSE SD CARD, and select the SD card from the Device dropdown - check you have the correct drive selected!
    PiImager-04.png
  • Click the WRITE button. Writing the image will take a few minutes
  • Once the image has finished been written, you can close Raspberry Pi Imager

  • OPTIONAL - If you wish to connect your Pi to the network using WiFi from the first boot, then you will need to follow these additional steps.
    Note. If you connect via an cabled network, you can always configure the WiFi later using the command line
  • Eject your SD card from your computer and re-insert it
  • Locate the SD drive in File Explorer.
  • On the SD drive edit a file called wpa_supplicant.conf.txt with a text editor and...
  • Change the country code to match your location - eg. US, GB, FR etc
  • Set the ssid to match your WiFi id
  • Set the psk to your WiFi password
  • Save the file, and then rename it to wpa_supplicant.conf - i.e. remove the .txt filename extension

  • Eject the SD card from your computer. Insert it into your Raspberry Pi and power up.

Please note, the edit above changes the country code for the wireless (WiFi) connection, the image is built on the basis that your Raspberry Pi will operate in the GB timezone, and MX will run using the GB locale. You can only modify those after installation is completed on your RPi computer.

First Boot

  • Connect the Pi to your wired network if you did not configure the WiFi as per the steps above.
  • Power on the Pi.
  • Now wait 5 minutes. The first boot will be resizing your disk and optionally configuring your WiFi
  • Start your browser and see if you can connect to this URL: http://cumulusmx:8998
  • If you can great - you should now see the Cumulus MX console
  • If not, then you will have to find out the Raspberry Pi's IP address from your router. Then try connecting to this URL: http://<ip_address>:8998 (example: http://192.168.1.123:8998 where the numbers before :8998 are those for YOUR Raspberry Pi from YOUR router). It just depends on your router whether it allows use of the URL name (cumulusmx) or requires the IP address.

Verify your SSH Connection

  • Fire up your SSH Client - we use PuTTY here
  • Enter the hostname as "cumulusmx", and check the protocol is set to SSH. Then open the connection.
(As before, you may need to enter the Pi's IP address instead of the hostname if that does not work)
  • PuTTY-01.png
  • You will have the accept the SSH key the first time you connect
  • Enter the username "cmx" and password "cumulusmx"
For prior releases up to 3.15 the username was "pi" and password (note UK spelling) "raspberry"
  • You should now change the default password
  • Use the passwd command to do this now...
cmx@cumulusmx:~ $ passwd
Changing password for cmx.
Current password: 
New password: 
Retype new password: 
passwd: password updated successfully
  • Now you can check/configure your RPi for your locale and timezone settings.
You must do this before you configure Cumulus MX if you are going to change it. Changing the locale after Cumulus MX has connected to your station means you may be in for a lot of editing of data files!
    • The build has set a default which is for en_UK UTF-8 locale and GMT timezone.
    • Use sudo raspi-config 5. Localization Options, L1 Locale (select en_US ISO-8851-1 for USA if needed) and L2 Timezone (select the appropriate timezone), then sudo reboot if needed to engage the new settings.
    • NOTE: if you are using bullseye (or up), verify all locale settings are the same (run: locale). If not then edit /etc/default/locale and add (or change) LC_ALL=<locale wanted>. save, exit and reboot again.
  • Check the status of the Cumulus MX service with the command sudo systemctl status cumulusmx
You will get some information back, the important bit to note is the line starting Active:, it should say active (running)
  • You can leave the SSH session open, you will need it again soon...

Configure Cumulus MX

Now it is time to configure Cumulus MX for your station.

  • Start your browser and connect to the same URL as before - http://cumulusmx:8998 or http://<ip_address>:8998
  • From the menu select Settings | Station Settings, then follow run of MX this guide for configuring your station.
  • Once your have completed all the settings for for station, and successfully saved them, Cumulus MX will need to be restarted.
  • Back in your SSH session, send the command sudo systemctl stop cumulusmx, this stops the Cumulus MX service.
  • Wait a few seconds, then enter the command sudo systemctl start cumulusmx, this starts the Cumulus MX service again.
  • Back to your browser and check that URL - http://cumulusmx:8998 or http://<ip_address>:8998 - again. If all is well, the default dashboard page should start showing the data from your weather station.
  • If it does, congratulations, you have successfully started recording your weather data
  • If it doesn't, then check back over this process carefully for any mistakes or omissions you may have made.
  • If you cannot resolve the problem, then ask for help on the forum

Additional Steps

To be expanded

  • Configuring WiFi from SSH
    • To be expanded
  • Stopping Cumulus MX starting up when the Pi boots
    • The build sets up MX to run as a service, and to start when the computer builds, so it will be running when you switched your Raspberry Pi on
    • To stop this auto-starting behavior permanently, just type sudo systemctl disable cumulusmx once.
  • Give your Pi a fixed IP address
  • Add a DHCP reservation
  • Assign a static IP address
If you need to use a fixed IP address for your Raspberry Pi, there are 2 methods

1. Adjust your router settings to always assign the same IP address. This facility has different names on different brands of router, look for a section named DHCP. You may be able to choose the IP address (possibly within or possibly outside the range assigned by DHCP), or you may only be allowed to choose 'always assign the address it currently has'. You may need to know the MAC address of the Raspberry PI, but if so that will likely be displayed alongside the current connection.

2. Adjust Raspberry Pi settings to always request the the same fixed address. This is less reliable, because your router may have assigned the requested address to a different device since the Pi was last active. To do this you have to edit this file: « /etc/network/interfaces »

For Ethernet connection a line specifying port eth0 is needed to describe your ethernet configuration, as the example below. For a wireless connection, it needs similar with wlan0:
allow-hotplug eth0
iface eth0 inet static
 address 192.168.11.100
 netmask 255.255.255.0
 gateway 192.168.11.1
 dns-domain example.com
 dns-nameservers 192.168.11.1

The line "dns-domain example.com" is optional

You could have also to edit another file, for dns configuration.
see file «/etc/resolv.conf» to insert these lines:
nameserver 192.168.11.1
domain example.com

Again, the line "domain example.com" is optional

Information

If you previously used Microsoft Windows with each part of a path separated by "\", please remember that all other operating systems, including that for Raspberry Pi, use "/" to both indicate the root (at start) and to separate parts of a path, as per the install location shown next.

Install location

In this image Cumulus MX is installed into /opt/CumulusMX

If you have run MX before, you will copy your existing Cumulus.ini, and optional Strings.ini, into that folder. But be aware that MX has been set to run on boot, so MX will have started, and you must stop it with sudo systemctl stop cumulusmx, before you can add these files.

Symbolic Links

The image contains a number of pre-created symbolic links for Cumulus MX files such as realtime.txt and the standard website tmp files. These links divert these files to the random access memory chip (within the standard Linux folder "/run", the RAM storage area is configured as subfolder "/cumulusmx") to reduce wear on your SD card.

The full list of symbolic links could be added here by another contributor, presumably these cover every .json file that is produced for the default web page with fully defaulted settings as to which files are produces. For the moment, two symbolic link examples are included below:

  1. the processed realtime.txt -> /run/cumulusmx/realtime.txt
  2. the processed wxnow.txt -> /run/cumulusmx/wxnow.txt

Root Account

The image does not alter the default root account from the Raspberry Pi OS base image. So the root account does not have a password set, and cannot be used to logon to the system. If you wish to relax this default security then there are plenty of web sites with instructions on how to do this.

Image Customisations

  • Based on the 'Lite' version of the Raspberry Pi OS (i.e. the graphical desktop GUI is not included)
  • Full install of Mono
  • Update of all packages
  • Install of Cumulus MX
  • Set Cumulus MX to auto-start
  • Enable SSH service
  • Disable IPv6
  • Set hostname to "cumulusmx"

NOTE: If you later want to add the graphical desktop GUI, please check online for the latest instructions, but when last researched, these 4 steps were needed for Buster:

  1. sudo apt update
  2. sudo apt install xserver-xorg
  3. sudo apt install raspberrypi-ui-mods
  4. sudo reboot

Further Information

There are two other pages in this Wiki that might be useful to read Raspberry Pi computer page and MX on Linux.

systemctl commands

You can use the following commands to control Cumulus MX...

To start Cumulus:
sudo systemctl start cumulusmx
To stop Cumulus:
sudo systemctl stop cumulusmx
To check if Cumulus is running:
sudo systemctl status cumulusmx
To restart Cumulus:
sudo systemctl restart cumulusmx
To make Cumulus start at system boot time:
sudo systemctl enable cumulusmx
To stop Cumulus starting at boot time:
sudo systemctl disable cumulusmx

Starting Cumulus MX from the command line

You may want to start Cumulus from the command line for diagnostic purposes, you can still do this...

First make sure the Cumulus MX service is stopped

sudo systemctl stop cumulusmx

Then issue a change path command to move to the Cumulus folder and start MX there
(Noting it is case sensitive).

cd /opt/CumulusMX
sudo mono CumulusMX.exe

Build Creation Notes

Here are the technical details:

  • Installed Raspberry Pi Buster Lite (August 2020)
  • Enabled SSH
  • Installed latest updates - apt update/upgrade
  • Installed latest Mono complete stable version (6.12)
  • Clean up apt - apt autoremove
  • Changed hostname to "cumulusmx"
  • Edited cumulusmx.service and copied to /etc/systemd/system
  • Disabled mono-xsp4 service - update-rc.d mono-xsp4 disable
  • Copied full CMX download to /opt/CumulusMX folder
  • Created symbolic links for temp files to /run/cumulusmx


The following commands are useful in creating the image file (created on Debian).

Create image file from SD card - sdb, may be sdc etc.

dd if=/dev/sdb of=/home/<username>/rpi.img bs=1M

Shrink the image file.
Download pishrink from:

wget https://raw.githubusercontent.com/Drewsif/PiShrink/master/pishrink.sh

Then run it...

pishrink.sh /home/<username>/rpi.img /home/<username>/rpi2.img

Disable IPv6
Edit /etc/systctl.conf
Add line...

net.ipv6.conf.all.disable_ipv6 = 1