Category:Cumulus MX: Difference between revisions

33 bytes removed ,  09:56, 27 April 2020
m
Line 197: Line 197:


'''Buy equipment'''
'''Buy equipment'''
Raspberry Pi Zero W
* Raspberry Pi Zero W
o A faster Pi is NOT needed for running Cumulus. Pi Zero W has WiFi and one USB port which is all that is needed for headless running.
** A faster Pi is NOT needed for running Cumulus. Pi Zero W has WiFi and one USB port which is all that is needed for headless running.
o Using a faster Pi might speed parts of the installation process, but are overkill for actual ‘production’ running. A faster Pi will work fine though if you have one going spare and don't mind the extra power use.
** Using a faster Pi might speed parts of the installation process, but are overkill for actual ‘production’ running. A faster Pi will work fine though if you have one going spare and don't mind the extra power use.
o Case if desired
** Case if desired
Micro SD card eg 16 GB, decent quality. Adapter if needed to put Micro SD card in PC
* Micro SD card eg 16 GB, decent quality. Adapter if needed to put Micro SD card in PC
OTG cable (micro USB plug to standard USB socket) to connect a USB weather station to Raspberry Pi [you may have got one free with a mobile phone or tablet] if it's a USB weather station. Not needed if you have a WiFi or ethernet weather station. An Ethernet weather station will need connected to your router, not the Pi.
* OTG cable (micro USB plug to standard USB socket) to connect a USB weather station to Raspberry Pi [you may have got one free with a mobile phone or tablet] if it's a USB weather station. Not needed if you have a WiFi or ethernet weather station. An Ethernet weather station will need connected to your router, not the Pi.
Suitable Micro USB power supply (it does not need to be a high power 2.5A version for Pi Zero W with only the weather station attached; it will be powered on 24/7, so a low power consumption ‘switched mode’ type is preferred – ie one that does not become warm when plugged in with nothing attached. You may have a suitable one from a mobile phone.
* Suitable Micro USB power supply (it does not need to be a high power 2.5A version for Pi Zero W with only the weather station attached; it will be powered on 24/7, so a low power consumption ‘switched mode’ type is preferred – ie one that does not become warm when plugged in with nothing attached. You may have a suitable one from a mobile phone.
'''
'''
Download useful PC software and install on your PC'''
Download useful PC software and install on your PC'''
These instructions are for a Windows PC. Steps would be similar on a Mac, but programs and details would differ. Should also be possible with an Android tablet.
These instructions are for a Windows PC. Steps would be similar on a Mac, but programs and details would differ. Should also be possible with an Android tablet.
SD Formatter (the Windows Format facility will NOT do)
* SD Formatter (the Windows Format facility will NOT do)
o https://www.sdcard.org/downloads/formatter_4/index.html
** https://www.sdcard.org/downloads/formatter_4/index.html
balenaEtcher (for unzipping and burning images to SD cards) [Previously named 'Etcher']
* balenaEtcher (for unzipping and burning images to SD cards) [Previously named 'Etcher'] <tt>https://etcher.io/</tt>
o https://etcher.io/
* Win32DiskImager (for backup & restore of SD card images) <tt>https://sourceforge.net/projects/win32diskimager/</tt>
Win32DiskImager (for backup & restore of SD card images)
* PuTTY (an SSH client for Windows) <tt>https://www.putty.org/</tt>
o https://sourceforge.net/projects/win32diskimager/
* FileZilla (an FTP file transfer program for Windows) <tt>https://filezilla-project.org/download.php</tt>
PuTTY (an SSH client for Windows)
 
o https://www.putty.org/
'''Download Raspbian Pi Operating System'''
FileZilla (an FTP file transfer program for Windows)
* Save it on your PC, from https://www.raspberrypi.org/downloads/raspbian/
o https://filezilla-project.org/download.php
* "RaspBIAN Buster Lite" is probably OK, but other than small file size it offers no advantage over installing the full version of RaspBIAN Buster. These instructions are being tested using "Raspbian Buster with desktop and recommended software", the largest of all, which could allow you to do other things more easily.
'''
* Just click on “Download Zip” (torrent might be faster if you have the ability, but not worth installing just for this)
Download Raspbian Pi Operating System'''
* Do not unzip it
Save it on your PC, from https://www.raspberrypi.org/downloads/raspbian/
* These instructions have been tested with kernel version 4.14, released 18 April 2018 and with kernel version 4.14, released 13 November 2018 [March 2019] and kernel version 4.19 released 10 July 2019
"RaspBIAN Buster Lite" is probably OK, but other than small file size it offers no advantage over installing the full version of RaspBIAN Buster. These instructions are being tested using "Raspbian Buster with desktop and recommended software", the largest of all, which could allow you to do other things more easily.
 
Just click on “Download Zip” (torrent might be faster if you have the ability, but not worth installing just for this)
'''Install Pi Operating System onto Micro SD card'''
Do not unzip it
 
These instructions have been tested with kernel version 4.14, released 18 April 2018 and with kernel version 4.14, released 13 November 2018 [March 2019] and kernel version 4.19 released 10 July 2019
''Format the SD card''
'''
* Put Micro SD card in PC (use adapter if needed)
Install Pi Operating System onto Micro SD card'''
** If re-using a previous Pi SD card, click ‘Cancel’ on the warning about needing to format the card
Format the SD card
* Run SD Card Formatter (click Yes to ‘Allow to make changes to your device’).
Put Micro SD card in PC (use adapter if needed)
** Need to use this program rather than the Format tool in File Explorer, because Pi SD cards end up with a very small ‘Windows accessible’ partition and a large partition containing Linux. SD Card Formatter allows reclaim of the large partition.
o If re-using a previous Pi SD card, click ‘Cancel’ on the warning about needing to format the card
* Your SD card should automatically populate in the ‘Drive’ box. In case you have another SD card in your PC, ensure the correct card is selected!
Run SD Card Formatter (click Yes to ‘Allow to make changes to your device’).
* Click ‘Format’ and check and accept the Warning messages
o Need to use this program rather than the Format tool in File Explorer, because Pi SD cards end up with a very small ‘Windows accessible’ partition and a large partition containing Linux. SD Card Formatter allows reclaim of the large partition.
Your SD card should automatically populate in the ‘Drive’ box. In case you have another SD card in your PC, ensure the correct card is selected!
Click ‘Format’ and check and accept the Warning messages


'''Copy the Pi Raspbian Operating System onto the card'''
'''Copy the Pi Raspbian Operating System onto the card'''
Run balenaEtcher on your PC
* Run '''balenaEtcher''' on your PC
Click ‘Select Image’ and choose the ‘Raspbian Buster’ operating system zip file that was downloaded earlier
* Click ‘Select Image’ and choose the ‘Raspbian Buster’ operating system zip file that was downloaded earlier
SD card should be automatically populated. In case you have another SD card in your PC, ensure the correct card is selected!
* SD card should be automatically populated. In case you have another SD card in your PC, ensure the correct card is selected!
Click ‘Flash!’. The operating system will be copied to the card. This takes about 10 minutes, followed by another 8 minutes to ‘Verify’
* Click ‘Flash!’. The operating system will be copied to the card. This takes about 10 minutes, followed by another 8 minutes to ‘Verify’
Cancel any messages about needing to Format the card - they are just indicating that Etcher has installed the partition that cannot be read by Windows
* Cancel any messages about needing to Format the card - they are just indicating that Etcher has installed the partition that cannot be read by Windows
On completion, the card is ‘ejected’ from the PC. Physically remove it and then straight away reinsert it so that the content can be viewed in File Explorer
* On completion, the card is ‘ejected’ from the PC. Physically remove it and then straight away reinsert it so that the content can be viewed in File Explorer
TWO drives will now be visible for the SD card. You will likely see a warning that one of the drives needs to be formatted before it can be used. ‘Cancel’ that warning and ignore that drive.
* TWO drives will now be visible for the SD card. You will likely see a warning that one of the drives needs to be formatted before it can be used. ‘Cancel’ that warning and ignore that drive.
View the other drive, which is named ‘boot’ in File Explorer
* View the other drive, which is named ‘boot’ in File Explorer
On the View tab, ensure the ‘File Name extensions’ is ticked
* On the View tab, ensure the ‘File Name extensions’ is ticked
Right click and select ‘New’, ‘Text document’. Change its name to SSH (deleting the .txt extension; you need to make an empty file called SSH not SSH.txt). Click ‘Yes’ to ‘Are you sure you want to change the extension?’
* Right click and select ‘New’, ‘Text document’. Change its name to SSH (deleting the .txt extension; you need to make an empty file called SSH not SSH.txt). Click ‘Yes’ to ‘Are you sure you want to change the extension?’
Right click and select ‘New’, ‘Text document’. Change its name to wpa_supplicant.conf (deleting the .txt extension; you need to make a file called wpa_supplicant.conf not wpa_supplicant.conf.txt). Click ‘Yes’ to ‘Are you sure you want to change the extension?’
* Right click and select ‘New’, ‘Text document’. Change its name to wpa_supplicant.conf (deleting the .txt extension; you need to make a file called wpa_supplicant.conf not wpa_supplicant.conf.txt). Click ‘Yes’ to ‘Are you sure you want to change the extension?’
Right click on this new file and select ‘Open with Notepad’ or ‘Open with …’ then select Notepad. Enter the following content exactly as below (copy and paste) then edit your country code (if needed), WiFi network’s SSID and password: NOTE: Change GB as needed to be the code for your country. The quote marks should appear in the file, that is ssid="YourNetwork" not ssid=YourNetwork . Same for psk.
* Right click on this new file and select ‘Open with Notepad’ or ‘Open with …’ then select Notepad. Enter the following content exactly as below (copy and paste) then edit your country code (if needed), WiFi network’s SSID and password: NOTE: Change GB as needed to be the code for your country. The quote marks should appear in the file, that is ssid="YourNetwork" not ssid=YourNetwork . Same for psk.
<pre>ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
<pre>ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
update_config=1
Line 257: Line 254:
}</pre>
}</pre>


Not essential, but I like to keep copies of both those files for future use. They can be on the SD card with different names eg ‘SSH - Copy’ and ‘wpa_supplicant.conf - Copy’ as well as on your PC
* Not essential, but I like to keep copies of both those files for future use. They can be on the SD card with different names eg ‘SSH - Copy’ and ‘wpa_supplicant.conf - Copy’ as well as on your PC
The function of these 2 files is to connect your Raspberry Pi to your network as soon as it boots, and allows you to connect to and control it from your PC by SSH using PuTTY. This avoids needing to connect a keyboard, mouse and monitor to the Raspberry Pi. It is particularly useful for Pi Zero W (or Pi Zero) which hasn’t got enough USB connections and no Ethernet (wired network) connection. This is called ‘Headless operation’.
* The function of these 2 files is to connect your Raspberry Pi to your network as soon as it boots, and allows you to connect to and control it from your PC by SSH using PuTTY. This avoids needing to connect a keyboard, mouse and monitor to the Raspberry Pi. It is particularly useful for Pi Zero W (or Pi Zero) which hasn’t got enough USB connections and no Ethernet (wired network) connection. This is called ‘Headless operation’.
Right click on the ‘boot’ SD card in left pane of File Explorer and ‘Eject’ it safely.
* Right click on the ‘boot’ SD card in left pane of File Explorer and ‘Eject’ it safely.


'''Setting up the Raspberry Pi'''
'''Setting up the Raspberry Pi'''
With nothing plugged into the Raspberry Pi, take the Micro SD card from your PC and put it in the Pi.
* With nothing plugged into the Raspberry Pi, take the Micro SD card from your PC and put it in the Pi.
In a later step, you will need to find out the Raspberry Pi’s IP address by looking at your network router’s web interface. I can’t help you with doing that. If you don’t know how to, an alternative is to connect a keyboard, mouse and monitor to the Raspberry Pi at this stage
* In a later step, you will need to find out the Raspberry Pi’s IP address by looking at your network router’s web interface. I can’t help you with doing that. If you don’t know how to, an alternative is to connect a keyboard, mouse and monitor to the Raspberry Pi at this stage
Plug the power supply into the Raspberry Pi. It will boot up (note flashing red and/or green LEDs depending on model).
* Plug the power supply into the Raspberry Pi. It will boot up (note flashing red and/or green LEDs depending on model).
On your PC, log into your network router’s web interface and identify the Pi’s IP address, which will be in the form xxx.xxx.xxx.xxx, for example 192.168.1.123
* On your PC, log into your network router’s web interface and identify the Pi’s IP address, which will be in the form xxx.xxx.xxx.xxx, for example 192.168.1.123
o NOTE: If you will be switching from a faster “build” Raspberry Pi to a “production” Raspberry Pi Zero W, the IP address will change, so you’ll need to repeat this step later
** NOTE: If you will be switching from a faster “build” Raspberry Pi to a “production” Raspberry Pi Zero W, the IP address will change, so you’ll need to repeat this step later
o While in your network router for the ‘production’ Pi you will be using, set up some port forwarding that will be needed later.
** While in your network router for the ‘production’ Pi you will be using, set up some port forwarding that will be needed later.
o Forward port 8998 to your Pi’s IP address for TCP protocol if you want to be able to access the Cumulus web interface from the external internet (this brings potential security risk though). [Forwarding port 8002 as well was previously needed].
** Forward port 8998 to your Pi’s IP address for TCP protocol if you want to be able to access the Cumulus web interface from the external internet (this brings potential security risk though). [Forwarding port 8002 as well was previously needed].
Start PuTTY on your PC. In the box for ‘Host Name or IP address’, enter the Pi’s IP address from above. In the adjacent ‘Port’ box, enter 22. Connection type should be SSH. Click ‘Open’.
* Start PuTTY on your PC. In the box for ‘Host Name or IP address’, enter the Pi’s IP address from above. In the adjacent ‘Port’ box, enter 22. Connection type should be SSH. Click ‘Open’.
A window opens. The first time you do this you will probably see a long message asking to confirm it is OK to connect to a not-previously-known device. Click ‘Yes’.
* A window opens. The first time you do this you will probably see a long message asking to confirm it is OK to connect to a not-previously-known device. Click ‘Yes’.
Login to the Pi. Username is pi [lower case] and password is raspberry [lower case]
* Login to the Pi. Username is pi [lower case] and password is raspberry [lower case]
You will see a warning that SSH is enabled but the password has not been changed, which is a security risk. We will change the password in a moment
* You will see a warning that SSH is enabled but the password has not been changed, which is a security risk. We will change the password in a moment
Type
* Type
<pre>sudo raspi-config</pre>
<pre>sudo raspi-config</pre>


Line 301: Line 298:


'''Add the ‘Mono’ package'''
'''Add the ‘Mono’ package'''
Simplification: Mono is a package which allows programs to be written cross-platform so that they will run on Linux (including Raspberry Pi), Windows and Mac OS, similar to the Windows ‘.NET Framework’.
* Simplification: Mono is a package which allows programs to be written cross-platform so that they will run on Linux (including Raspberry Pi), Windows and Mac OS, similar to the Windows ‘.NET Framework’.
The previous anomaly with the USB library not working with later versions of mono, affecting Fine Offset stations and the later Oregon Scientific stations (WMR88/100/200 etc) has been fixed (''in CumulusMX build 3044 onwards'') and these and other stations should now be fine with later/current versions of mono. I am currently using a Fine Offset with mono v5.18
* The previous anomaly with the USB library not working with later versions of mono, affecting Fine Offset stations and the later Oregon Scientific stations (WMR88/100/200 etc) has been fixed (''in CumulusMX build 3044 onwards'') and these and other stations should now be fine with later/current versions of mono. I am currently using a Fine Offset with mono v5.18
Process is to install a security certificate, add the mono server to the list of software sources [sources.list] that the Pi searches, then install the mono-complete package:
* Process is to install a security certificate, add the mono server to the list of software sources [sources.list] that the Pi searches, then install the mono-complete package:
<pre>sudo apt install apt-transport-https dirmngr gnupg ca-certificates
<pre>sudo apt install apt-transport-https dirmngr gnupg ca-certificates
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
Line 374: Line 371:
2. Install the updated CumulusMX version into a new directory - I call mine CumulusMX3xyz (where xyz are the last 3 digits of the build number) so that I can easily see which build it is
2. Install the updated CumulusMX version into a new directory - I call mine CumulusMX3xyz (where xyz are the last 3 digits of the build number) so that I can easily see which build it is
3. copy the following from the old CumulusMX directory to the new CumulusMX3xyz directory:
3. copy the following from the old CumulusMX directory to the new CumulusMX3xyz directory:
- your CumulusMX/Cumulus.ini file
- your CumulusMX/Cumulus.ini file
- your CumulusMX/data directory
- your CumulusMX/data directory
- your CumulusMX/twitter.txt file (if you have personalised it)
- your CumulusMX/twitter.txt file (if you have personalised it)
- your CumulusMX/web directory (if you have personalised any web files)
- your CumulusMX/web directory (if you have personalised any web files)
4. Change your startup instruction to use the version in the new directory eg cd /home/pi/CumulusMX3050;sudo mono CumulusMX.exe
4. Change your startup instruction to use the version in the new directory eg cd /home/pi/CumulusMX3050;sudo mono CumulusMX.exe


Line 383: Line 385:


'''Updating mono version'''
'''Updating mono version'''
First, stop CumulusMX as above by editing crontab.
*First, stop CumulusMX as above by editing crontab.
Then remove the present version of mono:
*Then remove the present version of mono:
<pre>sudo apt-get purge libmono* cli-common mono-runtime
<pre>sudo apt-get purge libmono* cli-common mono-runtime
sudo apt-get autoremove</pre>
sudo apt-get autoremove</pre>


Then install the new version
*Then install the new version
<pre>sudo apt-get install mono-complete</pre>
<pre>sudo apt-get install mono-complete</pre>


Finally re-enable auto running by editing crontab to remove the # and finally
*Finally re-enable auto running by editing crontab to remove the # and finally
<pre>sudo reboot</pre>
<pre>sudo reboot</pre>


5,838

edits