Please read the posts in the Announcements section about the current status of Cumulus development now that I have retired

Please read this post before posting

Latest Cumulus release v1.9.4 (build 1099) - Nov 28 2014
Latest Cumulus MX release - v3.0.0 build 3043 Jan 20 2017. See this post 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.
jank
Posts: 302
Joined: Sat Jun 13, 2015 5:57 pm
Weather Station: weatherstation
Operating System: Debian Wheezy
Location: Germany

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

Postby jank » Wed Jan 24, 2018 6:56 pm

wwuk wrote:
FrontBottom wrote:Just want to say thanks.

This script is awesome.

Cheers
Chris


....., many thanks to the author..

Chris


Thanks Chris&Chris, your are welcome
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

tait97
Posts: 1
Joined: Sun Mar 11, 2018 5:08 pm
Weather Station: WeatherDuino Pro2 PLUS
Operating System: Raspberry

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

Postby tait97 » Sun Mar 11, 2018 11:11 pm

Just want to say thanks.

This script is awesome. :clap: :clap: :clap: :clap:

malmeida
Posts: 36
Joined: Thu Oct 06, 2016 7:16 pm
Weather Station: Maplin N96FY
Operating System: Raspbian

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

Postby malmeida » Tue Mar 20, 2018 9:58 pm

I have updated Script version but now when I use sudo ./cumulusmx.sh -s, it says:
nc: port number invalid: x,x,x,x
and:
CumulusMX is not listening on TCP Port: 8998

malmeida
Posts: 36
Joined: Thu Oct 06, 2016 7:16 pm
Weather Station: Maplin N96FY
Operating System: Raspbian

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

Postby malmeida » Fri Apr 06, 2018 10:52 am

Anyway, when I access port number:8998 I can see the dashboard. It seems it has no effect.

cdvreede
Posts: 1
Joined: Wed Apr 11, 2018 11:22 am
Weather Station: 1080
Operating System: Pi

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

Postby cdvreede » Thu Apr 19, 2018 10:49 am

need some help here. Finally got "MX" running on a Pi2 hooked up to a 1081 via USB. Of course I had to use Wheezy as OS and one of the last 3.xx versions of Mono to get it going. Running now under a SSH session but while it's without a screen it's not yet really headless and set-and-forget.
I understand that this script will autostart?? If so can someone give me simple instructions on how to get that going?? my setup is standard - user Pi and I run by first going to /cumulusmx and then Sudo Mono CumulusMX.exe. Runs rock stable through SSH but really want this to be an appliance and reserve SSH for any maintenance.

Anyone out there let me know what to do??

thnx

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

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

Postby jank » Fri Apr 27, 2018 1:14 pm

cdvreede wrote:Anyone out there let me know what to do??thnx


Hello, at least reading the first post of this topic might help and should be the basics for more questions about this.
In short words: You can use the Linux program called "screen" to start CumulusMX and move it into the background and logout form the PI.
But since this is not so easy, I wrote this bash script which is able to handle all CumulusMX related via simple menu options.
So first you should read the first post and downlaod the cumulusmx.sh Start|Stop 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

ExperiMentor
Posts: 40
Joined: Tue Nov 24, 2015 11:30 pm
Weather Station: Fine Offset
Operating System: Windows 7; Linux
Location: Switzerland

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

Postby ExperiMentor » Sun May 06, 2018 10:38 pm

Here is a much easier method .... This gives a totally headless Pi (Pi Zero W is best...), accessed only using SSH (PuTTY).
If you need instructions how to set up an SD card so that a headless Pi connects to your WiFi, reply below and I'll add instructions.

Use cron to start CumulusMX.exe as a background task (that's the & at the end of the line)
And I also use cron to do a daily reboot in the early hours (just in case anything went wrong)...

Then when you want to STOP Cumulus, just edit cron to comment out the line which starts Cumulus (ie temporarily put a # at the beginning) and do a sudo reboot

that is:
crontab -e
.... and add the following lines at the end: adjust directory name eg to CumulusMX as needed
# Start Cumulus as background task 30s after reboot (delay to allow WiFi to startup)
@reboot (sleep 30;cd /home/pi/Cumulus;sudo mono CumulusMX.exe) &

# Reboot each day at 0258
58 02 * * * sudo reboot

When you want to stop Cumulus:
crontab -e
.... add the # as shown here in red:
# Start Cumulus as background task 30s after reboot (delay to allow WiFi to startup)
# @reboot (sleep 30;cd /home/pi/Cumulus;sudo mono CumulusMX.exe) &

sudo reboot
.... and the RPi will restart without running Cumulus.

Don't forget to remove that # from crontab or else it will not restart at 0258 tomorrow :)

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

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

Postby jank » Tue May 15, 2018 2:39 pm

Yes, the above things are similar to the things the Start|Stop Script is doing, but the script offers a lot more more things (./cumulusmx.sh -h).
As far as I remember the "@reboot" does not work anymore in Debian Jessie and above ......
But anyway .....only with CRON entries it is also possible to use CumulusMX on a Raspberry Pi....
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

ExperiMentor
Posts: 40
Joined: Tue Nov 24, 2015 11:30 pm
Weather Station: Fine Offset
Operating System: Windows 7; Linux
Location: Switzerland

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

Postby ExperiMentor » Tue May 15, 2018 3:33 pm

jank wrote:As far as I remember the "@reboot" does not work anymore in Debian Jessie and above ......


@reboot works fine on every version of Raspbian that I have ever tried.
It certainly works on the current release, which is RASPBIAN STRETCH based on Debian Stretch.

DesertRat
Posts: 3
Joined: Thu Feb 20, 2014 7:23 am
Weather Station: Davis Vantage Pro 2
Operating System: Windows 7
Location: Arizona USA

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

Postby DesertRat » Mon Aug 13, 2018 10:00 am

I migrated my Windows 7 Cumulus installation over to a CumulusMX running on a RPi 3B+. The installation and migration of my data went flawless. CumulusMX runs very well on my RPi . However, I have run into an issue. I tried using the init.d script-cumulusmx.sh combination to Start|Stop|Restart CumulusMX on my RPi. I couldn't make it work. Since I'm using Raspbian Stretch and SystemD is going to become the norm of most Linux distros, I decided to take it on. So I now have my CumulusMX.service script:
[Unit]
Description=Start CumulusMX
After=multi-user.target

[Service]
Type=idle
ExecStart=/bin/bash /home/pi/CumulusMX/CumulusMX/cumulusmx.sh > /home/pi/CumulusMX/systemd.log 2>&1

[Install]
WantedBy=multi-user.target

calling my cumulusmx.sh script. It works just fine except for some reason after I reboot my RPi, cumulusmx.sh -s says that CumulusMX is running, but not listening on TCP port 8998. I've tried moving it around to different ports in the config file, but it doesn't make a difference. Now, if I manually run sudo ./cumulusmx.sh -p 8998, Cumulus MX starts listening on that port. It is only during the boot call to the script, that the listener fails to attach to TCP port 8998. If I manually start Cumulus MX from terminal LX, everything works correctly. There isn't anything of any value reported to the logs as to why the TCP connection fails during boot up. So my question to the forum is, is there something different I could do with my SystemD service script? Or does anybody have any ideas for troubleshooting. I'm at a dead end. I would really like CumulusMX to restart correctly and automatically on reboot for obvious reasons. Thanks

ExperiMentor
Posts: 40
Joined: Tue Nov 24, 2015 11:30 pm
Weather Station: Fine Offset
Operating System: Windows 7; Linux
Location: Switzerland

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

Postby ExperiMentor » Mon Aug 13, 2018 1:39 pm

Not a full reply, but maybe some pointers?

First, a Pi 3B+ is unnecessarily overpowered for running CumulusMX. It runs with plenty to spare on a Pi Zero W.

Second, it's easy to start CumulusMX on reboot by adding an appropriate "@reboot ..." line into crontab. I've never needed to brave the additional complexities of init.d or SystemD. I combine that with an automatic overnight reboot.

Third, you say you can manually run "sudo ./cumulusmx.sh -p 8998" OK. This means that your cumulusmx.sh file is in (or path can be accessed from) "./" and you are specifying the port as a parameter. But in your "CumulusMX.service script",
* the specified path has a lot of subdirectories (maybe one layer too many??) ie "/home/pi/CumulusMX/CumulusMX/cumulusmx.sh"
* you are not specifying the port as a parameter

Finally, have you placed an appropriate "sleep" somewhere to ensure your network connection has got up and running before starting Cumulus? I could see that causing a fail to connect ...

I can't help more without knowing your Pi's directory structure and where you placed things, and without learning SystemD. But hope that's useful?

DesertRat
Posts: 3
Joined: Thu Feb 20, 2014 7:23 am
Weather Station: Davis Vantage Pro 2
Operating System: Windows 7
Location: Arizona USA

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

Postby DesertRat » Mon Aug 13, 2018 4:31 pm

ExperiMentor wrote:Not a full reply, but maybe some pointers?

First, a Pi 3B+ is unnecessarily overpowered for running CumulusMX. It runs with plenty to spare on a Pi Zero W.

Second, it's easy to start CumulusMX on reboot by adding an appropriate "@reboot ..." line into crontab. I've never needed to brave the additional complexities of init.d or SystemD. I combine that with an automatic overnight reboot.

Third, you say you can manually run "sudo ./cumulusmx.sh -p 8998" OK. This means that your cumulusmx.sh file is in (or path can be accessed from) "./" and you are specifying the port as a parameter. But in your "CumulusMX.service script",
* the specified path has a lot of subdirectories (maybe one layer too many??) ie "/home/pi/CumulusMX/CumulusMX/cumulusmx.sh"
* you are not specifying the port as a parameter

Finally, have you placed an appropriate "sleep" somewhere to ensure your network connection has got up and running before starting Cumulus? I could see that causing a fail to connect ...

I can't help more without knowing your Pi's directory structure and where you placed things, and without learning SystemD. But hope that's useful?


First the RPi 3B+ is what I had, so its what I used. The directory structure is correct ( /home/pi/CumulusMX/CumulusMX/ ). There is an extra folder layer of CumulusMX/, but that is accounded for in the HOME statement within the script. Port 8998 is the default script, so it is being called for within the script itself. I don't have to manually (-p 8998) call out the port, it will default to it manually and it works that way. Yes, I have tried the sleep command, it didn't help. There seems to be something preventing CumulusMX from binding to any TCP port during boot. Even though, SystemD is told to wait for Multi-User.Target and Type =idle which together are telling Stretch to wait until everything is up before proceeding. Yeah, I could probably make it work with crontab, but I don't want to, lol!!!

DesertRat
Posts: 3
Joined: Thu Feb 20, 2014 7:23 am
Weather Station: Davis Vantage Pro 2
Operating System: Windows 7
Location: Arizona USA

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

Postby DesertRat » Mon Aug 13, 2018 7:41 pm

Ok, I think I figured it out. I tried the ExecStartPre=/bin sleep 30, but it didn't fix my issue either. Then I found faintly related issue another linux based forum and so I tried some things. This is what worked for me on the TCP port 8998 connection issue on Raspbian 9 (Stretch)

My cumulusmx.service file:

[Unit]
Description=Start CumulusMX
After=multi-user.target

[Service]
Type=oneshot
ExecStart=/bin/bash /home/pi/CumulusMX/CumulusMX/cumulusmx.sh
RemainAfterExit=true

[Install]
WantedBy=multi-user.target

Remember after you create your cumulusmx.service script in /lib/systemd/system, you need to run the following lines to enable SystemD to process it at boot:
sudo systemctl daemon-reload
sudo systemctl enable CumulusMX.service

Yes, I know I have an extra CumulusMX folder in my path. If I was going to be in my Cumulus Pi all the time, I would probably par it back. But since its working, and I have already changed the path where necessary in the cumulus scripts, I'm just going to leave it. It works, don't fix. You can customize your paths however you desire. I hope this post helps those moving to SYSTEMD boot initialization. Good luck everyone in Cumulusland. Weather On!!!

andrea_iw2ntf
Posts: 3
Joined: Fri Aug 17, 2018 8:11 pm
Weather Station: Davis VP2
Operating System: Raspbian

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

Postby andrea_iw2ntf » Sun Aug 19, 2018 1:01 pm

Hello to all,

I have a small problem, which in the end is only an "aesthetic" fact, with the latest version of raspbian the PID number does not appear in the statistics screen.

It is a negligible factor I think.
I am using the 2.5.5.0 startup script cumulus with init.d and not with crontab.

Even starting it with crontab does not change anything.

It does not change anything if I start it with
sudo /home/pi/CumulusMX/cumulusmx.sh

What can I do? With raspbian jessie no problem, with the stretch version you have this small flaw. I'm wrong?

I know very little linux, it's just that I'm interested.
Thanks, andrea iw2ntf
You do not have the required permissions to view the files attached to this post.

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

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

Postby jank » Thu Aug 30, 2018 11:10 am

andrea_iw2ntf wrote:Hello to all,

I have a small problem, which in the end is only an "aesthetic" fact, with the latest version of raspbian the PID number does not appear in the statistics screen.

thats strange.....the PID is the process ID of MONO and the command to get the PID is very simple

MONOPID=$(pgrep mono && echo)

PLease login to your Raspberry Pi and insert this command to check if it is running
pgrep mono && echo

If there is no result, check this command please: ps -axu |grep mono
and this command: whereis pgrep
thanks jan

btw: My Status screen is showing this:
Linux OS Version: "Raspbian GNU/Linux" - DEBIAN - 9 (STRETCH) - 4.14.34-v7+
ProcessID (PID) of CumulusMX is: 548
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


Return to “Cumulus MX”

Who is online

Users browsing this forum: phipps and 2 guests