Welcome to the Cumulus Support forum.

Latest Cumulus release v1.9.4 (build 1099) - 28 November 2014
Latest Cumulus MX release v3.0.0 build 3047 - 03 February 2019. See the Wiki for download

CumulusMX - RaspberyPi - Start|Stop|Restart Script V2.5.5.0

Discussion of version 3 of Cumulus, which runs on Windows, Linux, and OS X. All Cumulus MX queries in here, please.

Moderator: mcrossley

jank
Posts: 311
Joined: Sat 13 Jun 2015 5:57 pm
Weather Station: weatherstation
Operating System: Debian Wheezy
Location: Germany

Re: CumulusMX - RasperryPi - Start|Stop|Restart Script V2.4

Post by jank » Sat 30 Jan 2016 2:37 pm

Werk_AG wrote:Hi,
Today I started trying to use this script. It is working well.
But I have a question: There is any way to start CumulusMX with these localization settings?
CumulusMX -lang pt-PT
Thanks
Edited: I think I found a way to do this, editing the script. It would be nice having a parameter to choose or define localization.
hi....I just tested the following on my Test Raspberry Pi2 with Debian Jessie.
If you did not change the system locale (I have no idea if you need the system locale to be english) Mono will use the system locale to start. I bet your system is still configured for english.
You can test iot by using my Script with option -c (sudo ./cumulusmx.sh -c)
On Step 3: Checking your System Settings and Cumulus Settings
the System locale and Cumulus Locale will be displayed

System Language is: en_EN.UTF-8 and Language used in CumulusMX is: English

If you want to change the System and Mono (CumulusMX) Language to be PT, please open

sudo raspi-config
Choose: Internationalisation Option
Change Locale


Choose your Language --> pt_PT.UTF-8 UTF-8 and save settings

A reboot is required, also if not being told...so please reboot and call sudo ./cumulusmx.sh -c again and you will see:

System Language is: pt_PT.UTF-8 and Language used in CumulusMX is: Portoguese

Maybe there is a good reason for you to stay at english on your Raspüberry Pi but start CumulusMX using your Language.....in this case, I will think about how I can add such a function into the next version of the Script
Jan
Want to see your Station values on SSH? Cumulusnow http://sandaysoft.com/forum/viewtopic.php?f=27&t=14062
Want a Start|Stop|Restart Script for CumulusMX on RaspberryPi? cumulusmx.sh http://sandaysoft.com/forum/viewtopic.php?f=27&t=13767

User avatar
Werk_AG
Posts: 183
Joined: Sun 13 Jan 2013 8:04 pm
Weather Station: WeatherDuino Pro2 PLUS
Operating System: Windows 7
Location: Cercal CDV - Portugal
Contact:

Re: CumulusMX - RasperryPi - Start|Stop|Restart Script V2.4

Post by Werk_AG » Sun 31 Jan 2016 1:06 am

jank wrote: Maybe there is a good reason for you to stay at english on your Raspüberry Pi but start CumulusMX using your Language.....in this case, I will think about how I can add such a function into the next version of the Script
Jan
Hi Jan
Thanks for this excellent explanation.
It made me check things... my Rasperry system, was in a "unknown" language:

System Language is: and Language used in CumulusMX is: Unvariant


After reconfiguring it with raspi-config, it's working like a charm.

System Language is: pt_PT.UTF-8 and Language used in CumulusMX is: Portuguese


Many thanks for your great help. Your script is really complete and helpful. A "must have" to everyone running CumulusMX on a PI.
Image

jank
Posts: 311
Joined: Sat 13 Jun 2015 5:57 pm
Weather Station: weatherstation
Operating System: Debian Wheezy
Location: Germany

Re: CumulusMX - RasperryPi - Start|Stop|Restart Script V2.4

Post by jank » Sun 31 Jan 2016 10:52 am

Werk_AG wrote:Many thanks for your great help. Your script is really complete and helpful. A "must have" to everyone running CumulusMX on a PI.
not really complete......but a lot of stuff already in this script. I have some further Ideas left......currently adding possibillity to write a cumulusmxsh.log to track possible problems with the script and other fine things. But thank you anyway for the positive feedback
Want to see your Station values on SSH? Cumulusnow http://sandaysoft.com/forum/viewtopic.php?f=27&t=14062
Want a Start|Stop|Restart Script for CumulusMX on RaspberryPi? cumulusmx.sh http://sandaysoft.com/forum/viewtopic.php?f=27&t=13767

ninendal
Posts: 16
Joined: Sun 04 Jul 2010 7:29 pm
Weather Station: Davis vantage pro2
Operating System: Windows 7

Re: CumulusMX - RasperryPi - Start|Stop|Restart Script V2.4

Post by ninendal » Wed 03 Feb 2016 1:27 pm

Sometimes it doesn't stop CumulusMX properly;

System.ApplicationException: Mutex is not owned
at System.Threading.Mutex.ReleaseMutex () <0x74e44edc + 0x00054> in <filename unknown>:0
at (wrapper remoting-invoke-with-check) System.Threading.Mutex:ReleaseMutex ()
at System.Net.FtpClient.FtpClient.Dispose () <0x72a72488 + 0x00267> in <filename unknown>:0
at System.Net.FtpClient.FtpClient.Finalize () <0x72a72c18 + 0x00017> in <filename unknown>:0

---

System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'System.Net.Sockets.Socket'.
at System.Net.Sockets.Socket.ThrowIfDisposedAndClosed () <0x73a0cae0 + 0x00058> in <filename unknown>:0
at System.Net.Sockets.Socket.get_Available () <0x73a12388 + 0x0001b> in <filename unknown>:0
at System.Net.Sockets.TcpClient.get_Available () <0x73160d60 + 0x0001f> in <filename unknown>:0
at . (Int32 ) <0x73160d98 + 0x00767> in <filename unknown>:0
at . () <0x73771fe8 + 0x002c3> in <filename unknown>:0
at System.Threading.ThreadHelper.ThreadStart_Context (System.Object state) <0x74c712bc + 0x000c7> in <filename unknown>:0
at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, Boolean preserveSyncCtx) <0x74c6f934 + 0x001af> in <filename unknown>:0
at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, Boolean preserveSyncCtx) <0x74c6f900 + 0x0002b> in <filename unknown>:0
at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state) <0x74c6f84c + 0x0005b> in <filename unknown>:0
at System.Threading.ThreadHelper.ThreadStart () <0x74c7148c + 0x00037> in <filename unknown>:0

This could be a CumulusMX issue, not sure about that.

User avatar
steve
Cumulus Author
Posts: 26717
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: CumulusMX - RasperryPi - Start|Stop|Restart Script V2.4

Post by steve » Wed 03 Feb 2016 1:36 pm

Sometimes exceptions like that can be thrown when MX closes depending on exactly what it was doing at the time (and what happened while it was running). They don't normally stop it closing, though. Perhaps they cause a problem for Jan's script?
Steve

jank
Posts: 311
Joined: Sat 13 Jun 2015 5:57 pm
Weather Station: weatherstation
Operating System: Debian Wheezy
Location: Germany

Re: CumulusMX - RasperryPi - Start|Stop|Restart Script V2.4

Post by jank » Wed 03 Feb 2016 2:13 pm

ninendal wrote:Sometimes it doesn't stop CumulusMX properly;
Hi, I am not sure if I really understand the real problem when stopping cumulusMX with my script.
Bit I can imagine:
when CumulusMX is crashing my Script is (of course not aware of it)
When starting CumulusMX with my Script, I am creating a PID File in /tmp Folder.
when I stop cumulusMX with my Scirpt, I am stopping CumulusMX and deleting the PID file.
Now when CumulusMX starts and the PID file is written and CumulusMX crashes, the PID File might not be removed and the Next start will cause Problems, because the old PID File still exist and my Scirpt won't start

Here is how I stop CumulusMX when using cumulusmx.sh -q or -r

screen -X -S "CumulusMX" stuff "^C" Sending a CTRL C to the Screen session to stop CumulusMX
sleep 5 2>/dev/null Waiting 5 Seconds
kill -9 $MONOPID 2>/dev/null Sending a Kill to the Process with the PID I have saved.
rm /tmp/$SERVICE.pid 2>/dev/null Removing the PID File


To be honstest, I did not understand what you current problem is :-)
(Also Steves comment could not help me to really understand your problem)

Or did you see the error above when stopping cumulusMX by using ./cumulusmx.sh -q ?
Want to see your Station values on SSH? Cumulusnow http://sandaysoft.com/forum/viewtopic.php?f=27&t=14062
Want a Start|Stop|Restart Script for CumulusMX on RaspberryPi? cumulusmx.sh http://sandaysoft.com/forum/viewtopic.php?f=27&t=13767

ninendal
Posts: 16
Joined: Sun 04 Jul 2010 7:29 pm
Weather Station: Davis vantage pro2
Operating System: Windows 7

Re: CumulusMX - RasperryPi - Start|Stop|Restart Script V2.4

Post by ninendal » Wed 03 Feb 2016 2:24 pm

jank wrote:
ninendal wrote:Sometimes it doesn't stop CumulusMX properly;
Hi, I am not sure if I really understand the real problem when stopping cumulusMX with my script.
Bit I can imagine:
when CumulusMX is crashing my Script is (of course not aware of it)
When starting CumulusMX with my Script, I am creating a PID File in /tmp Folder.
when I stop cumulusMX with my Scirpt, I am stopping CumulusMX and deleting the PID file.
Now when CumulusMX starts and the PID file is written and CumulusMX crashes, the PID File might not be removed and the Next start will cause Problems, because the old PID File still exist and my Scirpt won't start

Here is how I stop CumulusMX when using cumulusmx.sh -q or -r

screen -X -S "CumulusMX" stuff "^C" Sending a CTRL C to the Screen session to stop CumulusMX
sleep 5 2>/dev/null Waiting 5 Seconds
kill -9 $MONOPID 2>/dev/null Sending a Kill to the Process with the PID I have saved.
rm /tmp/$SERVICE.pid 2>/dev/null Removing the PID File


To be honstest, I did not understand what you current problem is :-)
(Also Steves comment could not help me to really understand your problem)
So far I couldn't relate this to a problem in case of data loss. It was more to inform development in case of coming issues or a possible fix.

jank
Posts: 311
Joined: Sat 13 Jun 2015 5:57 pm
Weather Station: weatherstation
Operating System: Debian Wheezy
Location: Germany

Re: CumulusMX - RasperryPi - Start|Stop|Restart Script V2.4

Post by jank » Wed 03 Feb 2016 2:40 pm

ninendal wrote:So far I couldn't relate this to a problem in case of data loss. It was more to inform development in case of coming issues or a possible fix.
development , thats not me :-)

the above error message has nothing to do with the start|Stop Script, but seem to occur when CumulusMX runs and run into an exception. (System.ObjectDisposedException: Cannot access a disposed object.)

when running my script after this happens, it might be a little bit confused that CumulusMX is not running anymore, but the PID file still exist, but thats all.
At the next start, I find out that the PID file still exist, but thats no Problem , I will start CumulusMX anyway.
Not sure how I find out, why there is no CumulusMX Process but PID File exist....need to check this in the code but for me the most important thing is, CumulusMX will be started anyway.....

regarding Data Loss here is a hint

I have a cron job which ios syncing my complete CumulusMX folder once per hour to an external NAS

00 */1 * * * sudo rsync -rtagu /home/pi/CumulusMX/ /mnt/Backup/Administrator/CumulusMX_Sync/ --exclude=MXdiags --exclude backup

so in worst case, I am loosing 1 hour
Want to see your Station values on SSH? Cumulusnow http://sandaysoft.com/forum/viewtopic.php?f=27&t=14062
Want a Start|Stop|Restart Script for CumulusMX on RaspberryPi? cumulusmx.sh http://sandaysoft.com/forum/viewtopic.php?f=27&t=13767

slashmusic
Posts: 219
Joined: Sun 10 Jan 2010 10:43 am
Weather Station: WS2350
Operating System: Raspberry Pi2 - Debian
Location: Germany
Contact:

Re: CumulusMX - RasperryPi - Start|Stop|Restart Script V2.4

Post by slashmusic » Fri 19 Feb 2016 9:46 am

Version 2.5.0 is available [19.02.2016]

o some cosmetic improvments and smaller bufix
o Fixed a bug in the Verison check of CumulusMX
o Fixed a bug when checking PID File
- Removing @reboot check - not possible anymore since Jessie
+ Added "Free diskspace in Percent"" check of device where CumulusMX is installed in case it is not on boot device (Status Page)

Since Version 2.4.0 the Variables are defined in an external file cumulusmxsh.conf which should be located in the CumulusMX install folder

+ Script will quit if no configuration file can be found. Please use the .conf file provided in the ZIP
+ CumulusMX is now writing a logfile (cumulusmxsh.log) to easier track problems (cumulusmxsh.log)
+ cumulusmxsh.log can be checked when using option -l (or by using cat /home/pi/CumulusMX/cumulusmxsh.log)
+ added support for locale different from system locale. Normally CumulusMX is starting with the same locale the system (RaspberryPi is using) Now it can be different.
Example: RaspberryPi Locale is: en_EN.UTF-8 --> CumulusMX Language can be: MXLANGUAGE="-lang de-DE" (Parameter can be set in the conf file)
+ New Parameters in the cumulusmxsh.conf.

LOGPATH=$INSTPATH/cumulusmxsh.log
LOGSIZE=10000 (Size in bytes of the cumulusmxsh.conf )
MXLANGUAGE="" (When using different languages for System and CumulusMX)

(Attention: People who already using a cumulusmxsh.conf and updating from Version 2.4.0 do NOT need to add new parameters.
When running the script the first time, new Parameters will be added automatically to cumulusmxsh.conf)

setting new parameters.jpg
2016-02-21 12_51_49-SuperPuTTY - Cumulus.jpg
New version is available in the first Post
You do not have the required permissions to view the files attached to this post.
Last edited by slashmusic on Sun 21 Feb 2016 11:55 am, edited 2 times in total.
Image

thegasman
Posts: 23
Joined: Sun 24 Mar 2013 6:42 pm
Weather Station: WMR88
Operating System: Raspbian on Pi2
Location: Ayr, Scotland, United Kingdom
Contact:

Re: CumulusMX - RasperryPi - Start|Stop|Restart Script V2.4

Post by thegasman » Sun 21 Feb 2016 11:01 am

Hi,

Great script, invaluable. Just installed it yesterday on my new Raspberry Pi 2 with CumulusMX.

I'm pretty certain I downloaded CumulusMX_2.5.0.zip, and that's the only file I have on my PC, but when I run cumulusmx.sh -s it reports:

This Script Version: 2.4.0.1 (2016-02-19) - Available new Version: 2.5.0.0 (2016-02-19)

Martin

slashmusic
Posts: 219
Joined: Sun 10 Jan 2010 10:43 am
Weather Station: WS2350
Operating System: Raspberry Pi2 - Debian
Location: Germany
Contact:

Re: CumulusMX - RasperryPi - Start|Stop|Restart Script V2.4

Post by slashmusic » Sun 21 Feb 2016 11:49 am

thegasman wrote:Hi,
Great script, invaluable. Just installed it yesterday on my new Raspberry Pi 2 with CumulusMX.
I'm pretty certain I downloaded CumulusMX_2.5.0.zip, and that's the only file I have on my PC, but when I run cumulusmx.sh -s it reports:
This Script Version: 2.4.0.1 (2016-02-19) - Available new Version: 2.5.0.0 (2016-02-19)
Martin
Damn.....it look like I am not able to upload 1 version which is 100% fine. Everytime when I upload a new version, something is wrong with it.
This time, I missed to increase the Version String of this script in the head of the script :-)
Thanks for letting me know :groan:

OKay, all who already downloaded the script are having 3 options:
1. Download it again right now
2. Edit the version sting in the header of the script by using nano (VERSION='2.5.0.0 (2016-02-19)')
3. Leave it as it is since you know that you have 2.5.0 but it is telling that it is still 2.4.0.1

Jan
Last edited by slashmusic on Mon 22 Feb 2016 1:47 pm, edited 1 time in total.
Image

TechnoDribble
Posts: 6
Joined: Tue 16 Feb 2016 8:36 am
Weather Station: Maplin /FO
Operating System: Win 10
Location: Guildford

Re: CumulusMX - RasperryPi - Start|Stop|Restart Script V2.5

Post by TechnoDribble » Mon 22 Feb 2016 10:33 am

Probably a noobie question, but I am new to Pi's and Linux etc
I have set-up your script and rebooted and all is good.
Cumulus MX is running fine (I can see from the web), however as my Pi starts X Windows automatically I don't see any process box for Cumulus now.
Previously when it was all manual I would just start Cumulus from a terminal window.
I cant use the script commands nor how do I now stop Cumulus Cleanly from Windows if I want to shut the Pi down?
Help?

I don't want to simply issue shut-down the Pi from Windows for fear of corruption or similar!

jank
Posts: 311
Joined: Sat 13 Jun 2015 5:57 pm
Weather Station: weatherstation
Operating System: Debian Wheezy
Location: Germany

Re: CumulusMX - RasperryPi - Start|Stop|Restart Script V2.5

Post by jank » Mon 22 Feb 2016 1:28 pm

TechnoDribble wrote:Probably a noobie question, but I am new to Pi's and Linux etc
I have set-up your script and rebooted and all is good.
Cumulus MX is running fine (I can see from the web), however as my Pi starts X Windows automatically I don't see any process box for Cumulus now.
Previously when it was all manual I would just start Cumulus from a terminal window.
I cant use the script commands nor how do I now stop Cumulus Cleanly from Windows if I want to shut the Pi down?
Help?
I don't want to simply issue shut-down the Pi from Windows for fear of corruption or similar!
Hi
when you read the most upper lines in the first post, you can see for who this script is:
I wrote a little script to Start Stop Restart Cumulus on a Raspberry Pi or Linux System
It is often very useful to run Cumulus in a so called headless mode on console window without a attached keyboard etc.
Since Cumulus can not be "deamonized" yet, one option is to run Cumulus in a so called: "Screen Session". This allows you to connect to the Linux Box via SSH, starting CumulusMX and close the SSH Session again.
Once you logged out and logged in again, you are able to "find" your Cumulus again and Start/Restart or Quit it by using this small bash script


Normally, I think 99% of all RaspberryPi users are using their Raspberry without a graphical UI (X windows) but in a "headless mode". Headless means: No Keyboard, no monitor and no mouse is connected.
If you want to work on your PI you are using a SSH Program like Putty, login as user pi and logout when you are done.

Often Programs are having a Webbased Interface using a Webserver, so as CumulusMX do. You can configure all settings , without being physically connected to the Raspberry Pi, only using a Webbrowser on your Windows Box connected to the Raspberry Pi. (Btw: Putty is also used on your Windows workstation)
So CumulusMX is being started at the console -> You are logging in as user pi using SSH, starting the CumulusMX by using this command:
sudo mono CumulusMX.exe
the program is running interactively. As long you are connected via SSH (Putty on your windows box) the program is running. In the moment you disconnect from Putty, CumulusMX stops.
You can compare it with a DOS Program on Windows. As long the Command window is open the program runs, when you close the command, the program stops.
And exactly here, this Script helps people to start CumulusMX in the background. They can logout with SSH and once they login later, the script will "find" the running CumulusMX again and you can stop it or restart it or whatever you like to do.

So this is almost nothing for people who work with Raspberry Pi with a UI.
I am sure, sooner or later you will configure your RaspberryPi to run in "headless" mode to get rid of these CPU consuming Graphical UI. (This can be done with sudo raspi-config --> Boot Options -> Console)
Want to see your Station values on SSH? Cumulusnow http://sandaysoft.com/forum/viewtopic.php?f=27&t=14062
Want a Start|Stop|Restart Script for CumulusMX on RaspberryPi? cumulusmx.sh http://sandaysoft.com/forum/viewtopic.php?f=27&t=13767

TechnoDribble
Posts: 6
Joined: Tue 16 Feb 2016 8:36 am
Weather Station: Maplin /FO
Operating System: Win 10
Location: Guildford

Re: CumulusMX - RasperryPi - Start|Stop|Restart Script V2.5

Post by TechnoDribble » Mon 22 Feb 2016 2:12 pm

jank wrote:
TechnoDribble wrote:Probably a noobie question, but I am new to Pi's and Linux etc
I have set-up your script and rebooted and all is good.
Cumulus MX is running fine (I can see from the web), however as my Pi starts X Windows automatically I don't see any process box for Cumulus now.
Previously when it was all manual I would just start Cumulus from a terminal window.
I cant use the script commands nor how do I now stop Cumulus Cleanly from Windows if I want to shut the Pi down?
Help?
I don't want to simply issue shut-down the Pi from Windows for fear of corruption or similar!
Hi
when you read the most upper lines in the first post, you can see for who this script is:
I wrote a little script to Start Stop Restart Cumulus on a Raspberry Pi or Linux System
It is often very useful to run Cumulus in a so called headless mode on console window without a attached keyboard etc.
Since Cumulus can not be "deamonized" yet, one option is to run Cumulus in a so called: "Screen Session". This allows you to connect to the Linux Box via SSH, starting CumulusMX and close the SSH Session again.
Once you logged out and logged in again, you are able to "find" your Cumulus again and Start/Restart or Quit it by using this small bash script


Normally, I think 99% of all RaspberryPi users are using their Raspberry without a graphical UI (X windows) but in a "headless mode". Headless means: No Keyboard, no monitor and no mouse is connected.
If you want to work on your PI you are using a SSH Program like Putty, login as user pi and logout when you are done.

Often Programs are having a Webbased Interface using a Webserver, so as CumulusMX do. You can configure all settings , without being physically connected to the Raspberry Pi, only using a Webbrowser on your Windows Box connected to the Raspberry Pi. (Btw: Putty is also used on your Windows workstation)
So CumulusMX is being started at the console -> You are logging in as user pi using SSH, starting the CumulusMX by using this command:
sudo mono CumulusMX.exe
the program is running interactively. As long you are connected via SSH (Putty on your windows box) the program is running. In the moment you disconnect from Putty, CumulusMX stops.
You can compare it with a DOS Program on Windows. As long the Command window is open the program runs, when you close the command, the program stops.
And exactly here, this Script helps people to start CumulusMX in the background. They can logout with SSH and once they login later, the script will "find" the running CumulusMX again and you can stop it or restart it or whatever you like to do.

So this is almost nothing for people who work with Raspberry Pi with a UI.
I am sure, sooner or later you will configure your RaspberryPi to run in "headless" mode to get rid of these CPU consuming Graphical UI. (This can be done with sudo raspi-config --> Boot Options -> Console)
Thanks so much for replying.
I realise now that I can start your script from within a X term session or even better remotely via Putty/SSH and it will give me the control I want.
I will probably leave the X windows as it does not really consume much in the way of resources and a Pi2 B has plenty.
This is a very useful utility whether you run X windows or not.
My problem is more to do with lack of Linux experience!
I have become lazy over the years and you quickly forget command line activity when it can all be done by a button/in Windows!

jank
Posts: 311
Joined: Sat 13 Jun 2015 5:57 pm
Weather Station: weatherstation
Operating System: Debian Wheezy
Location: Germany

Re: CumulusMX - RasperryPi - Start|Stop|Restart Script V2.5

Post by jank » Mon 22 Feb 2016 2:48 pm

TechnoDribble wrote:I have become lazy over the years and you quickly forget command line activity when it can all be done by a button/in Windows!
Hey....it is never too late to learn how to work with linux.
I also worked many many years with windows but currently I love to work with all my Raspberry and Banana Pi's more then working with windows. I have 1 Workstation left with windows to write e-Mails but all my servers now swotched to bananapi.
the latest project was: I switched my NAS from QNAP to my BananaPi with OpenMediaVault on it......
Now I am testing a Surveillance Station Software with some Cams by using Kerberos.io on a RaspberryPi.
I am using OSMC in conjunction with my Television (Kodi) also on a Raspberry.
So, don't lose heart , use more Linux....... :-)
Jan
Want to see your Station values on SSH? Cumulusnow http://sandaysoft.com/forum/viewtopic.php?f=27&t=14062
Want a Start|Stop|Restart Script for CumulusMX on RaspberryPi? cumulusmx.sh http://sandaysoft.com/forum/viewtopic.php?f=27&t=13767

Post Reply