If you use Cumulus, please donate Image

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

Discussion of version 3 of Cumulus, which runs on Windows, Linux, and OS X. All Cumulus MX queries in here, please.
jank
Posts: 281
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: 228
Joined: Tue Apr 12, 2011 10:23 pm
Weather Station: Watson W-8186
Operating System: Debian Jessie (VMWARE Esxi 6.0)
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
Kirby Muxloe Weather
http://kirbymuxloe-weather.dyndns.org web forward to http://kirbymuxloe-weather.co.uk
Also on Kirby Muxloe weather underground.
Looking forward to cumulus on Linux platform it'll rock!!

jank
Posts: 281
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: 228
Joined: Tue Apr 12, 2011 10:23 pm
Weather Station: Watson W-8186
Operating System: Debian Jessie (VMWARE Esxi 6.0)
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
Kirby Muxloe Weather
http://kirbymuxloe-weather.dyndns.org web forward to http://kirbymuxloe-weather.co.uk
Also on Kirby Muxloe 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: 4
Joined: Fri Jul 17, 2015 11:01 am
Weather Station: Ambient WS-2080
Operating System: Windows 7
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: 281
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: 140
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: 4
Joined: Fri Jul 17, 2015 11:01 am
Weather Station: Ambient WS-2080
Operating System: Windows 7
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


Return to “Cumulus MX”

Who is online

Users browsing this forum: No registered users and 4 guests