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: 293
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.4.0

Postby jank » Thu Jun 08, 2017 12:12 pm

Hello richard
this has nothing todo with any drivers, but only the syntax of your OS when using this command:

ifconfig eth0 | grep 'inet '

On all Linux versions I had so far it is displaying this as a result line for exmaple on a Suse enterprise system:
inet addr:192.168.123.123 Bcast:192.168.123.255 Mask:255.255.255.0
Of this way on my german Debian Jessie:
inet Adresse:192.168.193.6 Bcast:192.168.193.255 Maske:255.255.255.0
My query in the script is now trying to seperate the IP Address and the Netmask from this line
ifconfig eth0 | grep 'inet ' | cut -d: -f2 | awk '{ print $1}'
by searching for the line which contain the word "inet "
deleting the first part of characters in front of the :
and removing everything after the result.

As you can see, on all my systemems I am using independent which language the ifconfig result replies always with
inet addr:192.168.123.123 Bcast:192.168.123.255 Mask:255.255.255.0
but your OS is replying with out a : in the result
inet 192.168.1.4 netmask 255.255.255.0 broadcast 192.168.1.255
with the result that my "cut" command is not working anymore

This is why always INET is being displayed.


Question, if you type this command, what are you getting as a result ?

ip addr list eth0 |grep "inet " |cut -d' ' -f6|cut -d/ -f1
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: 265
Joined: Tue Apr 12, 2011 10:23 pm
Weather Station: Watson W-8186
Operating System: Debian Stretch (VMWARE Esxi 6.5)
Location: Leicester
Contact:

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

Postby richard_newberry » Thu Jun 08, 2017 12:42 pm

I get with that command 192.168.1.4
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: 293
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.4.0

Postby jank » Fri Jun 09, 2017 11:56 am

can you please do me a favour and insert these commands

cd /tmp
wget goo.gl/RFGQhm
mv RFGQhm network_check.sh
chmod +x network_check.sh
./network_check.sh


What is this doing. It is CD into the /tmp folder,
downloading a bash script
renaming this bash script
Make the bash Scirpt executable
starting the bash script.

It is very simple, it is trying to retrieve some network parameters from your Linux system.
Please have a look into it before you start it: cat network_check.sh
Don't trust any bash script you are downloading from the internet !

Please paste the result.....maybe this is working for all languages and for all linux systems
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: 265
Joined: Tue Apr 12, 2011 10:23 pm
Weather Station: Watson W-8186
Operating System: Debian Stretch (VMWARE Esxi 6.5)
Location: Leicester
Contact:

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

Postby richard_newberry » Fri Jun 09, 2017 2:50 pm

IP: netmask
Mask:
Gateway: 192.168.1.254
DNS: 192.168.1.6 192.168.1.13
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!!

kapo
Posts: 246
Joined: Thu Jan 03, 2013 1:59 pm
Weather Station: Davis VP2
Operating System: Windows 10
Location: Vihtavuori, Laukaa, Finland

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

Postby kapo » Mon Jul 03, 2017 10:43 am

I have two weather stations. Second here at home with Davis Vantage Pro2 hardware and another at our summer home with Fine offset hardware. Both stations work with Raspberry 3 model B and are powered with CumulusMX. They also work with that start / stop script. Everything works well. Thanks to the script author and thanks to Steve for this CumulusMX.

User avatar
radilly
Posts: 27
Joined: Fri Jul 17, 2015 11:01 am
Weather Station: Ambient WS-2080
Operating System: Raspian Jessie
Location: McMurray, PA, US
Contact:

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

Postby radilly » Sat Jul 22, 2017 8:40 pm

I'm curious about the assertion that CumulusMX cannot be "deamonized" ( or "daemonized" if you will). What is getting in the way?

I finally ported from Windows box running 3038 to a Pi 3 running 3043 today and it was surprisingly painless. It appears all my data came across intact, and I haven't yet come across anything that needs to be reconfigured. (I essentially ran a "diff" to find all the files the previous installation added or changed relative to the 3038 package, and overlayed those file on the 3043 install. I was a little nervous from some of what I had read...)

I looked at the interactive script (1100+ lines) and it's quite rich and the output is slick for a shell script. I had in mind to start with something considerably simpler; something that might be accessible through the service or systemctl commands. Somewhere in this thread someone mentioned different runlevels, and I'd be just as happy to run headless without the desktop started by default. (Maybe that's a separate thread I've not found yet.)

Thanks a bunch-
Bob

jank
Posts: 293
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.4.0

Postby jank » Sun Jul 23, 2017 9:57 am

radilly wrote:I looked at the interactive script (1100+ lines) and it's quite rich and the output is slick for a shell script. I had in mind to start with something considerably simpler; something that might be accessible through the service or systemctl commands. Somewhere in this thread someone mentioned different runlevels, and I'd be just as happy to run headless without the desktop started by default. (Maybe that's a separate thread I've not found yet.)

Hello Bob
Yes this script grew over the past month day by day and there are a lot of functions build in. (use the ./cumulusmx.sh -h to see whats possible)
Regarding your "headless" question.

there are several possibillities to run this script headless.
Normally headless means, no keyboard and no mouse. You don't need to run your raspberry into the graphical mode, it's just fine when you start it directly into a ssh session. once the raspi is up, make a ssh connecitons using putty from one of your windows boxes and start cumulusmx.
Login as root and start the script by command line.

If you want to start the script (and cumulus) automatically when your raspberry reboots (Like startup folder or autoexec.bat on your windows computer) , there are 2 options.

1) by using a init.d script (please read the first page, there is a short instruciotn how to use it and where you can find it
http://sandaysoft.com/forum/viewtopic.php?f=27&t=14753

2) by using a cron entry with option @reboot (Please search the internet for mor options

As far as I know, option 2 did not work with debian 7 anymore......thats the reason why I created a simple init.d script......so I think option 1 is the one you are looking for ?

cheers 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
rogerthn
Posts: 141
Joined: Thu Apr 11, 2013 6:31 pm
Weather Station: Oregon Scientific WMR88
Operating System: Raspbian GNU/Linux 8
Location: Trollhättan Sweden
Contact:

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

Postby rogerthn » Sun Jul 23, 2017 5:56 pm

radilly wrote:I had in mind to start with something considerably simpler

I am running CumulusMX headless as below on Debian 7
pi crontab

Code: Select all

@reboot /usr/bin/screen -fa -d -m -S Cumulus $HOME/start_CumulusMX.sh

start_CumulusMX.sh

Code: Select all

#!/bin/bash
/bin/sleep 69
cd /home/pi/CumulusMX
sudo mono CumulusMX.exe

To interact with CumulusMX

Code: Select all

screen -r Cumulus

<CTRL>a to detach
Image

User avatar
radilly
Posts: 27
Joined: Fri Jul 17, 2015 11:01 am
Weather Station: Ambient WS-2080
Operating System: Raspian Jessie
Location: McMurray, PA, US
Contact:

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

Postby radilly » Sun Jul 23, 2017 8:10 pm

Hey folks-

Thanks for the feedback. Seems like the direction of Debian (and thus Raspbian) is systemd (https://wiki.debian.org/systemd). Its been (quite) a few years since I wrote code to launch daemons, but it was init.d-based as I recall. I believe that is the now dated System V approach, which uses runlevel which seems simpler (or maybe more familiar) than the systemd startup approach.

Oh, boy... :oops: As I typed "systemd" I just realized I never searched the forum for that word. I found viewtopic.php?f=27&t=16087 (which you commented on Jan). I've read enough about systemd now, that the thread looks somewhat familiar in what it describes.

As an aside, I have the habit of running code I want to disconnect the terminal from under nohup (https://en.wikipedia.org/wiki/Nohup) - which is ancient (like me :roll: ). It also redirects the output to nohup.out which can be helpful in debugging. I'm using that for a python script which monitors my web cam (and power cycles it when needed) at the moment. Because CumulusMX.exe generates so little output, I thought it would be a good fit for nohup.... pretty ideal actually, because the config is handled through a browser.

Not that Cumulus hadn't been very reliable, but SysV had a respawn option intended to cover the case where the daemon crashed. In the aforementioned post, I spotted "Restart=always" which appears to be the equivalent. I'll post here ... and maybe there if I learn anything interesting.

It might be interesting to see if your script could be modified to interact with Cumulus running as a service under systemd. Without having spent much time looking at it, I would guess it is doable.

Thanks again, folks, for the responses!
Bob

weathersoft
Posts: 7
Joined: Thu Jun 29, 2017 12:13 pm
Weather Station: Davis Vantage Pro2
Operating System: Raspbian

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

Postby weathersoft » Thu Jul 27, 2017 3:45 am

I am running Cumulus MX on Raspberry Pi Raspbian Jessie. On my first go at this, I downloaded and installed this cumulusmx.sh script, but then once I learnt about systemd I realised that (as far as I can see) this script is not needed at all as the daemon is easily handled natively by systemd. There is also no need to install the "screen" utility.

All I did to get Cumulus MX to run as a service on Raspbian Jessie was the following:

Step 1 - Create a file "/lib/systemd/system/CumulusMX.service" with the following contents:

Code: Select all

[Unit]
Description=Cumulus weather software
After=multi-user.target

[Service]
Type=simple
WorkingDirectory=/home/pi/CumulusMX
ExecStart=/usr/bin/mono CumulusMX.exe
User=pi
Group=pi
Restart=on-failure

[Install]
WantedBy=multi-user.target

Step 2 - Reload the systemd service list

Code: Select all

sudo systemctl daemon-reload

Step 3 - Enable the new service

Code: Select all

sudo systemctl enable CumulusMX.service

And that's it! Cumulus MX will now be running as a service on your Raspberry Pi :) . If it ever fails, systemd will automatically attempt to restart it due to the "Restart=on-failure" line in the above file. To check on the service, you can issue the following command:

Code: Select all

sudo systemctl status CumulusMX.service

You can also easily stop/start/restart the service as follows:

Code: Select all

sudo systemctl stop CumulusMX.service
sudo systemctl start CumulusMX.service
sudo systemctl restart CumulusMX.service

So unless I am missing something, both the cumulusmx.sh script and the screen utility are obsolete under Jessie or any other Unix system that has systemd :clap: .

l2k
Posts: 4
Joined: Tue Dec 06, 2016 10:00 pm
Weather Station: wh1080 fine offset (pce fws-20)
Operating System: linux mint/debian stretch
Contact:

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

Postby l2k » Wed Aug 02, 2017 10:57 pm

weathersoft wrote:I am running Cumulus MX on Raspberry Pi Raspbian Jessie. On my first go at this, I downloaded and installed this cumulusmx.sh script, but then once I learnt about systemd I realised that (as far as I can see) this script is not needed at all as the daemon is easily handled natively by systemd. There is also no need to install the "screen" utility.

All I did to get Cumulus MX to run as a service on Raspbian Jessie was the following:

[CUT]



thanks for your instructions, work perfectly under jessie (and i agree with you, with systemd there is no reason to use cumulusmx.sh anymore - however thanks to the author!).

Steve Spingys
Posts: 3
Joined: Tue Aug 01, 2017 12:03 pm
Weather Station: N96GY
Operating System: Windows 10

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

Postby Steve Spingys » Tue Aug 08, 2017 4:45 pm

Hi Folks,
Could do with some advice on this, tried the systemd service but getting a access denied (see status below). I'm a bit new to this pi code, do I need to chance access to CumulusMX ?


pi@raspberrypi:~/CumulusMX $ sudo systemctl status CumulusMX.service -l
● CumulusMX.service - Cumulus weather software
Loaded: loaded (/lib/systemd/system/CumulusMX.service; enabled)
Active: inactive (dead) since Sun 2017-08-06 20:23:07 BST; 1 day 21h ago
Process: 517 ExecStart=/usr/bin/mono CumulusMX.exe (code=exited, status=0/SUCCESS)
Main PID: 517 (code=exited, status=0/SUCCESS)

Aug 06 20:22:59 raspberrypi systemd[1]: Started Cumulus weather software.
Aug 06 20:23:03 raspberrypi mono[517]: Current culture: English (United Kingdom)
Aug 06 20:23:07 raspberrypi mono[517]: Serial: 74FECEABEB2DA94ECB5EBA0CD11A7137
Aug 06 20:23:07 raspberrypi mono[517]: [ERROR] FATAL UNHANDLED EXCEPTION: System.UnauthorizedAccessException: Access to the path "/home/pi/CumulusMX/serial.txt" is denied.
Aug 06 20:23:07 raspberrypi mono[517]: at System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean anonymous, FileOptions options) [0x00000] in <filename unknown>:0
Aug 06 20:23:07 raspberrypi mono[517]: at System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share) [0x00000] in <filename unknown>:0
Aug 06 20:23:07 raspberrypi mono[517]: at (wrapper remoting-invoke-with-check) System.IO.FileStream:.ctor (string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare)
Aug 06 20:23:07 raspberrypi mono[517]: at System.IO.StreamWriter..ctor (System.String path, Boolean append, System.Text.Encoding encoding, Int32 bufferSize) [0x00000] in <filename unknown>:0
Aug 06 20:23:07 raspberrypi mono[517]: at System.IO.StreamWriter..ctor (System.String path, Boolean append, System.Text.Encoding encoding) [0x00000] in <filename unknown>:0
Aug 06 20:23:07 raspberrypi mono[517]: at (wrapper remoting-invoke-with-check) System.IO.StreamWriter:.ctor (string,bool,System.Text.Encoding)
Aug 06 20:23:07 raspberrypi mono[517]: at System.IO.File.WriteAllText (System.String path, System.String contents, System.Text.Encoding encoding) [0x00000] in <filename unknown>:0
Aug 06 20:23:07 raspberrypi mono[517]: at System.IO.File.WriteAllText (System.String path, System.String contents) [0x00000] in <filename unknown>:0
Aug 06 20:23:07 raspberrypi mono[517]: at CumulusMX.Cumulus..ctor (Int32 HTTPport, Int32 WSport) [0x00000] in <filename unknown>:0
Aug 06 20:23:07 raspberrypi mono[517]: at CumulusMX.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0

Any pointers please
Thanks Steve S

Steve Spingys
Posts: 3
Joined: Tue Aug 01, 2017 12:03 pm
Weather Station: N96GY
Operating System: Windows 10

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

Postby Steve Spingys » Tue Aug 08, 2017 6:16 pm

Hi Folks,
I don't seem to be able to get this systemd service to run CumulusMX as it denies access to the root files (serial.txt realtime.txt etc).
Do I need to change permissions or should this service run as a sudo?
Cheers Steve S

l2k
Posts: 4
Joined: Tue Dec 06, 2016 10:00 pm
Weather Station: wh1080 fine offset (pce fws-20)
Operating System: linux mint/debian stretch
Contact:

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

Postby l2k » Tue Aug 22, 2017 10:12 am

Steve Spingys wrote:Hi Folks,
I don't seem to be able to get this systemd service to run CumulusMX as it denies access to the root files (serial.txt realtime.txt etc).
Do I need to change permissions or should this service run as a sudo?
Cheers Steve S


i can't verify now, probably it's not a nice thing but in the service file i modified:

User=pi
Group=pi

to

User=root
Group=root

Steve Spingys
Posts: 3
Joined: Tue Aug 01, 2017 12:03 pm
Weather Station: N96GY
Operating System: Windows 10

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

Postby Steve Spingys » Tue Sep 05, 2017 7:13 pm

Many thanks I2k,
That did the trick.


Return to “Cumulus MX”

Who is online

Users browsing this forum: iz0dpp and 9 guests