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 - Linux/RasperryPi- Start | Stop | Restart Sc

Post by jank » Thu 15 Oct 2015 3:58 pm

Currently I have 3 different conditions which might prevent CumulusMX to be started via Cron entry when system reboots (using my Start|stop script

1. If DHCP is used
2. If WLAN is used
3. If the CumulusMX folder is on a USB mounted drive

all 3 things may be slower than the script when started via cron entry at reboot.

In the last verison, I am checking if a device wlan0 exist, if so, the start of the script is being delayed
I can also delay the start, if DHCP is being used, or if USB Drive is being mounted.
But it is very difficult to check all 3 things, without delaying the start of the script also, if normally started (not via cron at system start) but after a longer uptime.

In the next verison I will
a) check if in any crontab on the system has an indication, that "@reboot" and also "umulusmx.sh" isbeing used
b) If system uptime is less than 120 seconds.
If both conditions met, I assume
a) that there is a cron entry which is starting CumulusMX at boot
b) based on the fact that the uptime is lets say 100 second, the system is currently started

In this case, the Start|Stop script will delay for 60 seconds in the hope, that all IP's are assigned when using DHCP, All USB Drives are mounted and WLAN has finnished the encryption and got an IP.
This will be in the next Verison which is coming soon.
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

cirdan52
Posts: 24
Joined: Mon 02 Feb 2015 7:42 pm
Weather Station: Vantage Pro2
Operating System: Raspbian (jessie)
Location: Ohio
Contact:

Re: CumulusMX - Linux/RasperryPi- Start | Stop | Restart Sc

Post by cirdan52 » Fri 23 Oct 2015 3:28 pm

FYI They just changed raspi-config to have the option of waiting for the network to come up before finishing the boot sequence. I haven't checked it out yet but you may want to look at it before you make your next release of the script.

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

Re: CumulusMX - Linux/RasperryPi- Start | Stop | Restart Sc

Post by jank » Fri 23 Oct 2015 9:40 pm

cirdan52 wrote:FYI They just changed raspi-config to have the option of waiting for the network to come up before finishing the boot sequence. I haven't checked it out yet but you may want to look at it before you make your next release of the script.
Thank you for the info
the new version is almost finnished. Only some improvments and cosmetic fixes needs to be done.
I am doing 2 things in this script:
a) Checking if there is a line in crontab which indicates an automatic start at boot (@reboot)
b) if the uptime of the raspberry Pi is less than 120 seconds.
In this case, I assume that just a reboot was done (and not a normal start of the Script) and the start will be delayed for 60 seconds

So I don't care anymore if the Raspberry is waiting for DHCP, WLAN or any USB Device which needs to come up.

By the way, I didn't find any option to delay the startup of the system when rebooting....but I will search further for such an option.
But anyway, in the script, I can't trust, that everybody enabled such an option or not....
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 - Linux/RasperryPi- Start | Stop | Restart Sc

Post by slashmusic » Mon 26 Oct 2015 11:04 am

Version 2.3.0 is available [26.10.2015]

- Fixed: System Uptime in Status will now being displayed correctly (System Uptime of RasberryPi(cumulus) is: 7 days 13 hours 30 minutes (1 week, 13 hours, 30 minutes))
+ when using option -l, new option to display all used variables in this script (output goes also to /tmp/cumulusmx_variables.txt

+ when starting CumulusMX with the script, CumulusMX need sme seconds to start. when using option -s directly after start, it might happen that Statuspage is stating that CumulusMX is not running. Added a fancy progress bar

+ Status Page: New look for the -s option (Status) More information is being dispalyed and clean output.
+ Status Page: Check if a new CumulusMX Version is available on Steve's Download Page and alerting if using an old version
+ Status Page: Check if a new cumulusmx.sh Script version is available
- Fixed: when the Raspberry Pi is using a external USB Drive or getting the IP address via DHCP, and starting the cumulusmx.sh script at reboot, sometimes CumulusMX is starting before USB Drive is mounted or IP Address is assigned.
In this version I will check and in case, CumulusMX start will be delayed

New version is available in the first Post
Image

cirdan52
Posts: 24
Joined: Mon 02 Feb 2015 7:42 pm
Weather Station: Vantage Pro2
Operating System: Raspbian (jessie)
Location: Ohio
Contact:

Re: CumulusMX - Linux/RasperryPi- Start | Stop | Restart Sc

Post by cirdan52 » Tue 27 Oct 2015 3:30 am

Tried out the new version and got an error doing the -s option:


Collecting Information from your system, please wait.......

find: `/CumulusMX/MXdiags/*.txt': No such file or directory
./cumulusmx.sh: line 506: [: -lt: unary operator expected
<<<<<<<<< Cumulus Status >>>>>>>>

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

Re: CumulusMX - Linux/RasperryPi- Start | Stop | Restart Sc

Post by slashmusic » Tue 27 Oct 2015 8:35 am

cirdan52 wrote:Tried out the new version and got an error doing the -s option:
Collecting Information from your system, please wait.......
find: `/CumulusMX/MXdiags/*.txt': No such file or directory
./cumulusmx.sh: line 506: [: -lt: unary operator expected
<<<<<<<<< Cumulus Status >>>>>>>>
Thank you very much for testing it, and yes...you are right.
It was again a hardcoded installation Path in the script instead of using a variable.
Meanwhile there is a fixed verion on page 1. (please try again)
I installed CumulusMX directly in the root of my RaspberryPi and not in the home directory.
When testing commands, I am doing this mostly on the command line and then, I sometimes forget to remove my path with the variable I defined in the script when detectiong the installation path.
cheers Jan
Image

cirdan52
Posts: 24
Joined: Mon 02 Feb 2015 7:42 pm
Weather Station: Vantage Pro2
Operating System: Raspbian (jessie)
Location: Ohio
Contact:

Re: CumulusMX - Linux/RasperryPi- Start | Stop | Restart Sc

Post by cirdan52 » Tue 27 Oct 2015 12:05 pm

Thanks Jan that fixed that problem.

Now going on to doing a -c option a couple of things are not what I was expecting:

i) The following ini files are having , (Comma) instead of periods/full stops (.)
This often happens, when migrating from Cumulus 1.x - http://sandaysoft.com/forum/viewtopic.php?f=27&t=12908.
If the list is empty, your ini files are okay

/home/pi/CumulusMX//Cumulus.ini

k) The following devices are in Read Only mode which is not good. If list is empty, your device is okay

tmpfs /sys/fs/cgroup tmpfs ro,nosuid,nodev,noexec,mode=755 0 0

Notice the double forward slashes in the ini line. I installed from scratch this time so I'm hoping it's just a simple syntax error in the script.
The Read Only line concerns me. As I quickly researched cgroup, it is changed from read/write to read only by systemd in the boot process so I am surmising that this line is an error in reporting this

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

Re: CumulusMX - Linux/RasperryPi- Start | Stop | Restart Sc

Post by slashmusic » Tue 27 Oct 2015 12:50 pm

cirdan52 wrote:Thanks Jan that fixed that problem.
Now going on to doing a -c option a couple of things are not what I was expecting:
i) The following ini files are having , (Comma) instead of periods/full stops (.)
This often happens, when migrating from Cumulus 1.x - http://sandaysoft.com/forum/viewtopic.php?f=27&t=12908.
If the list is empty, your ini files are okay

/home/pi/CumulusMX//Cumulus.ini
Notice the double forward slashes in the ini line. I installed from scratch this time so I'm hoping it's just a simple syntax error in the script.
No this is a syntax bug from me. I can reproduce and will change to just one trailing slash.
It's fixed and will be applied in the next version.
cirdan52 wrote: k) The following devices are in Read Only mode which is not good. If list is empty, your device is okay

tmpfs /sys/fs/cgroup tmpfs ro,nosuid,nodev,noexec,mode=755 0 0
The Read Only line concerns me. As I quickly researched cgroup, it is changed from read/write to read only by systemd in the boot process so I am surmising that this line is an error in reporting this
Yes I already recognized this some weeks ago, after I updated to Debian Jessie. this is something new. In Debian Wheezy, it worked.
The command checking for Read only devices was: grep "\sro[\s,]" /tmp/mounts | grep -v ':'
Now I wil lchange it to: grep --color=always "\sro[\s,]" /proc/mounts | grep -v ':' |grep -v "tmpfs"
so I am excluding all tmpfs filesystems and in case it is having a match, I will highlight the result in red with the --color option.
Example: /dev/root / ext4 ro,noatime,data=ordered 0 0
Meanwhile: also fixed and ready for the next version
Thank for testing it :-)
Jan
Image

richard_newberry
Posts: 294
Joined: Tue 12 Apr 2011 10:23 pm
Weather Station: Watson W-8186
Operating System: Debian Stretch (VMWARE Esxi 6.5)
Location: Leicester
Contact:

Re: CumulusMX - Linux/RasperryPi- Start | Stop | Restart Sc

Post by richard_newberry » Thu 03 Dec 2015 2:19 pm

Just to let you know this script only works as root or sudo not cumulus.
Desford Weather
http://www.desford-weather.co.uk
http://desford-weather.co.uk
Also on Desford weather underground.
Looking forward to cumulus on Linux platform it'll rock!!

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

Re: CumulusMX - Linux/RasperryPi- Start | Stop | Restart Sc

Post by slashmusic » Thu 03 Dec 2015 2:52 pm

richard_newberry wrote:Just to let you know this script only works as root or sudo not cumulus.
Do you have a user cumulus ?
I am aware, that you need to start is with sudo.

But also in the instructions from Steve, you can find:

Linux and OS X:
Open a terminal window, change to the Cumulus MX directory, and then type:
sudo mono CumulusMX.exe


and this is something I am also doing in my script.
Jan
Image

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

Re: CumulusMX - Linux/RasperryPi- Start | Stop | Restart Sc

Post by jank » Thu 03 Dec 2015 3:07 pm

richard_newberry wrote:Just to let you know this script only works as root or sudo not cumulus.
Now I understand what you are looking for, when reading your Message from post: barriers to not using root for MX?

you are tlaking about the fact when calling the cumulusmx.sh script without sudo, you are getting this reply

pi@cumulus /CumulusMX $ ./cumulusmx.sh
Sorry, you are not root - Please start with sudo!

So you are complaining, that you made the suggested changes of the permissions and now want to start the scirpt without sudo and it is being rejected.

Give me some time and I will try to make an exception for you.

ADD
I am not sure if you feel confortable to work with an editor on Linux (in this case nano)
But if so, here is what you might do
Cd into the installation of CumulusMX (where the scirpt cumulusmx.sh is located
sudo nano cumulusmx.sh
Now type: CTRL+W (search) and insert: <First, let's check>

you should see lines like this:

### First, let's check if Script is called as Root
if [ "$(whoami)" != "root" ]; then
echo "Sorry, you are not root - Please start with sudo!"
exit 1
fi

Please insert a # at the beginning all these 4 lines that it loosk like this:

### First, let's check if Script is called as Root
# if [ "$(whoami)" != "root" ]; then
# echo "Sorry, you are not root - Please start with sudo!"
# exit 1
# fi


insert CTRL+O and CTRL+X to save and exit
This should exclude the check for sudo
But I expect a lot of errors since my script is looking/writing into many system directories where pi has no access.
I think there might be a lot of more work, to make it working without having root rights

Please let me know if you need further help
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

richard_newberry
Posts: 294
Joined: Tue 12 Apr 2011 10:23 pm
Weather Station: Watson W-8186
Operating System: Debian Stretch (VMWARE Esxi 6.5)
Location: Leicester
Contact:

Re: CumulusMX - Linux/RasperryPi- Start | Stop | Restart Sc

Post by richard_newberry » Thu 03 Dec 2015 11:09 pm

Yes that would work however what about the lots of permission denied.

Also cant get the storage drive external hard drive to back up the database. All the permissions are correct.

Also cumulus needs access to ftp only root as access, i could change it to anoyamous but that wouldnt be practical.

Good script though
Desford Weather
http://www.desford-weather.co.uk
http://desford-weather.co.uk
Also on Desford weather underground.
Looking forward to cumulus on Linux platform it'll rock!!

richard_newberry
Posts: 294
Joined: Tue 12 Apr 2011 10:23 pm
Weather Station: Watson W-8186
Operating System: Debian Stretch (VMWARE Esxi 6.5)
Location: Leicester
Contact:

Re: CumulusMX - Linux/RasperryPi- Start | Stop | Restart Sc

Post by richard_newberry » Thu 03 Dec 2015 11:10 pm

Yes that would work however what about the lots of permission denied.

Also cant get the storage drive external hard drive to back up the database. All the permissions are correct.

Also cumulus needs access to ftp only root as access, i could change it to anoyamous but that wouldnt be practical.

Good script though, well thought out.
Desford Weather
http://www.desford-weather.co.uk
http://desford-weather.co.uk
Also on Desford weather underground.
Looking forward to cumulus on Linux platform it'll rock!!

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

Re: CumulusMX - Linux/RasperryPi- Start | Stop | Restart Sc

Post by jank » Fri 04 Dec 2015 11:08 am

richard_newberry wrote:Yes that would work however what about the lots of permission denied.
I just made some modifications to get rif od these Permission denied messages but there are some other glitches, when not running as root....but I am working on it......I need some time.
richard_newberry wrote: Also cant get the storage drive external hard drive to back up the database. All the permissions are correct.
Where is the storage drive mounted ? in /mnt/
richard_newberry wrote: Also cumulus needs access to ftp only root as access, i could change it to anoyamous but that wouldnt be practical.
I don't understand, what you are doing with FTP locally, but when you run an FTP Server, you need to configure who is having access to the FTP Server. By default, root is having always access....now it's up to you, to configure your FTP Server to also allow other users to acceess FTP and send and receive mails.
However, I don't understand the purpose of the FTP Server on your Rapsberry Pi.

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
jpsc
Posts: 163
Joined: Tue 23 Aug 2011 6:06 pm
Weather Station: Davis Vantage Vue, belfryboy USB
Operating System: Raspbian Jessie
Location: Wye valley, Herefordshire, UK
Contact:

Re: CumulusMX - Linux/RasperryPi- Start | Stop | Restart Sc

Post by jpsc » Sat 05 Dec 2015 12:54 am

I've read through the posts here but nothing seems to match my problem.

Code: Select all

pi@WeatherServer3 ~ $ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux 7.8 (wheezy)
Release:        7.8
Codename:       wheezy
I am running from a USB stick if that makes a difference. The problem seems to be with permissions and execute flags, both cumulusmx.sh and cumulusnow.sh

Code: Select all

pi@WeatherServer3 ~ $ ls -hls /mnt/thumb/CMX/cumulusmx.sh
56K -rwxrwxrwx 1 pi pi 53K Dec  3 18:22 /mnt/thumb/CMX/cumulusmx.sh
pi@WeatherServer3 ~ $ /mnt/thumb/CMX/cumulusmx.sh -h
-bash: /mnt/thumb/CMX/cumulusmx.sh: Permission denied
pi@WeatherServer3 ~ $ sudo /mnt/thumb/CMX/cumulusmx.sh -h
sudo: unable to execute /mnt/thumb/CMX/cumulusmx.sh: Permission denied
running it with bash works:

Code: Select all

pi@WeatherServer3 ~ $ sudo bash /mnt/thumb/CMX/cumulusmx.sh -h
I have also had to change the script because it can't find Cumulus from IPATH='CMX'
The original gives me:

Code: Select all

find: `/MXdiags/*.txt': No such file or directory
Directory CMX file does not exist or Variable <IPATH> is not properly set, or you are connected to wrong computer. I will quit now
Changed to

Code: Select all

## Assuming that CumulusMX is installed in /home/pi/CumulusMX - if not exist CumulusMX.exe, search HD for the correct installation Path
# if [ ! -f "/home/pi/CumulusMX/CumulusMX.exe" ];then
#      INSTPATH=$(find / -path "/mnt/*" -prune -o -type d -name "$IPATH" -print |head -n1) > /dev/null
#    else
      INSTPATH="/mnt/thumb/CMX"
# fi
I did make sure I preserved UNIX line ends but I had the permission problem before I edited.

Given all that:

Code: Select all

pi@WeatherServer3 ~ $ sudo bash /mnt/thumb/CMX/cumulusmx.sh -s
<<<<<<<<< Cumulus Status >>>>>>>>

Versioncheck
CumulusMX   Version: Cumulus MX v.3.0.0 build 3035 - Available Version: v3.0.0 (3035)
This Script Version: 2.3.0 (2015-10-13) - Available Version: 2.3.0 (2015-10-25)
CumulusNow  Version: 1.3 - Available Version: 1.3 (29.07.2015)
Statuscheck
CumulusMX is running
CumulusMX is running since: 2015-12-05 00:11
CumulusMX is  listening on TCP Port: 8998 (http://192.168.1.9:8998)
ProcessID (PID) of CumulusMX is: 2454
Environmentcheck
Path to CumulusMX is: /mnt/thumb/CMX/
Path to CumulusMX Backup Folder is: /mnt/thumb/CMX/Backup_CumulusMX/ - Backups to keep: 5
Path to CumulusMX DD Backup Folder is: /mnt/NAS/Backup/ - Backups to keep: 5
CumulusMX is being started at system boot (cron)
Systemcheck
System Uptime of RasberryPi(WeatherServer3) is: 34 minutes ()
Overall used diskspace of /mnt/thumb/CMX Folder is: 121M        /mnt/thumb/CMX
Free diskspace on this device: 3.8G of 7.0G Total, used 2.9G
Free diskspace in percent: 56%
I used -n to install cumulusnow.sh but thereafter I get:

Code: Select all

/mnt/thumb/CMX/cumulusmx.sh: line 250: /mnt/thumb/CMX/cumulusnow.sh: Permission denied
/mnt/thumb/CMX/cumulusmx.sh: line 250: exec: /mnt/thumb/CMX/cumulusnow.sh: cannot execute: Permission denied
John Cooper

Cumulus MX on RPi3 with SSD

http://weather.mountpleasanthouse.uk

Image

Post Reply