Page 23 of 26

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

Posted: Thu Oct 06, 2016 11:07 am
by jank
fonixmunkee wrote:Just started playing around with Cumulus MX and this script is a life-saver. Thank you very much!

You are welcome. Exactly this was my intension last year,
when I started one year ago.

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

Posted: Mon Oct 10, 2016 9:01 pm
by Kipuka
I am hoping to use this script to start cumulusmx as boot up. Power supply here is pretty didgy so it is essential that i can get cmx to restart when the power comes back on. In a perfect world i have a script to boot the rpi when power returns and then this script to restart cmx once rpi has booted. my irrigation system is dependent upon data from my weather station which it gets from WU, CMX, VP2 so if CMX is down the irrigation system is not able to function properly.

so far i have installed the script and updated the conf file to reflect the appropriate ipath. the script runs fine using sudo ./...

I am stuck trying to get the script to run at boot up. i dont see anything in your lines to be inserted in cron that just say, run this script at boot up. and i am guessing that if i create a file in /etc/init.d that contains the command for launching the script...but i am not sure how to do this.

Can someone please help me to understand how to make it so this script will run at boot up? And if there is some way to make it so the rpi boots at the resumption of power, that would be perfect.

thanks!

Mark

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

Posted: Tue Oct 11, 2016 1:23 am
by VTHokie74
I tried editing crontab to add an @reboot ... entry to start Cumulus on a reboot. I could not get it to work. jamk has another option discussed in this topic:

viewtopic.php?f=27&t=14753

The init.d method worked for me. Also you might want to run raspi-config and choose the option to wait on network at reboot. I found this allows my router and modem to boot up after a power failure.

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

Posted: Tue Oct 11, 2016 10:29 am
by jank
VTHokie74 wrote:I tried editing crontab to add an @reboot ... entry to start Cumulus on a reboot. I could not get it to work. jamk has another option discussed in this topic:
viewtopic.php?f=27&t=14753
The init.d method worked for me. Also you might want to run raspi-config and choose the option to wait on network at reboot. I found this allows my router and modem to boot up after a power failure.

I also want to mention, that some people had also trouble to get the init.d script working (for any reason I don't know)
In this case, in the most current version of the CumulusMX Start|Stop script, there is a new option which is a kind of watchdog.
In simple words, you create a new Cron entry which is checking every 10 minutes, if CumulusMX is running.
If not, it will be started,
if yes, nothing happens.
Disadvantage: In case you want to make some maintenance work on your raspberry pi and want to stop CumulusMX, it will be started every 10 Minutes :-)

Please see this post: http://sandaysoft.com/forum/viewtopic.php?f=27&t=13767&p=120459#p120459

For all who have trouble strating CumulusMX with the init.d Startup Script at system boot, here is a command to check, if the init.d startup scirpt is correctly inserted into the runlevel of your system.
1) install a small program called: chkconfig
sudo apt-get install chkconfig
2) run the command to check if the startup script should be started at system boot
chkconfig |grep cumu
as a result you should see:

cumulusmx on

If you not see this result (line), you probably missed to enter the following command to insert the startup script into the runlevels

sudo update-rc.d cumulusmx defaults

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

Posted: Fri Dec 02, 2016 12:26 pm
by takezo
Hi All!

I use to run cumulusMX scripts from this link:


apparently the script start cumulusmx correctly but dashboard doesn't show nothing. I have try to run the service without the script and I have seen next error starting the service:


Code: Select all

takezo@-WEATHER:~/scripts/Cumulus/CumulusMX $ sudo mono CumulusMX.exe
Current culture: Spanish (Spain)
Serial: C1C14BD8D8C0C9F8B78320EFD1263EE1
Cumulus MX v.3.0.0 build 3041
Today.ini = data/today.ini
Last update=2016-12-01T12:30:00
Looking for Fine Offset station, VendorID=0x1941 ProductID=0x8021
sysname=Linux release=4.4.34 machine=armv6l
Fine Offset station found
Connected to station
Error reading data from station - it may need resetting
Error reading data from station - it may need resetting
Error reading data from station - it may need resetting
Error reading data from station - it may need resetting
[ERROR] FATAL UNHANDLED EXCEPTION: System.Net.Sockets.SocketException: Address already in use
  at System.Net.Sockets.Socket.Bind (System.Net.EndPoint local_end) [0x00000] in <filename unknown>:0
  at System.Net.EndPointListener..ctor (System.Net.IPAddress addr, Int32 port, Boolean secure) [0x00000] in <filename unknown>:0
  at System.Net.EndPointManager.GetEPListener (System.String host, Int32 port, System.Net.HttpListener listener, Boolean secure) [0x00000] in <filename unknown>:0
  at System.Net.EndPointManager.AddPrefixInternal (System.String p, System.Net.HttpListener listener) [0x00000] in <filename unknown>:0
  at System.Net.EndPointManager.AddListener (System.Net.HttpListener listener) [0x00000] in <filename unknown>:0




any idea..?

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

Posted: Sat Dec 03, 2016 10:52 am
by water01
You need to reset your station, this has nothing to do with the script.

On a point of order posting the same query in multiple Topics will not get you an answer any quicker and is consider bad forum manners.

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

Posted: Fri Jan 20, 2017 9:42 pm
by BigOkie
Jank,

I noticed in the last two version updates of your script that the version check seems to have mismatched text.

Here's what I see on the last one:

Code: Select all

Version check
CumulusMX   Version: Cumulus MX v.3.0.0 build 3042 - Available Version: ://sa
This Script Version: 2.5.3.0 (2016-09-27) - Available Version: 2.5.3.0 (2016-09-27)
CumulusNow  Version: 1.3 - Available Version: 1.4 (12.09.2016)
Linux  OS   Version: "Raspbian GNU/Linux" - DEBIAN - 8 (JESSIE) - 4.4.13-v7+
Mono Version: Mono JIT compiler version 4.0.5 (Stable 4.0.5.1/1d8d582 Thu Nov 12 12:22:41 UTC 2015)


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

Posted: Fri Jan 20, 2017 9:48 pm
by steve
Sorry - have I broken this by changing the version number in the news panel into a link to the announcement post?

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

Posted: Fri Jan 20, 2017 10:34 pm
by jank
steve wrote:Sorry - have I broken this by changing the version number in the news panel into a link to the announcement post?

Yes, I will fix it with an Update this Weekend.
Should Not be a Problem, Steve

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

Posted: Sat Jan 21, 2017 5:28 pm
by slashmusic
Version 2.5.3.1 is available [21.01.2017]

o fixed CumulusMX version check since Steve modified the Forum website.


(Attention: People who already using a cumulusmxsh.conf and updating from an earlier Version do NOT need to add new parameters or replace their existing cumulusmxsh.conf with the file in this update.
When running the script the first time, new Parameters will be added automatically to cumulusmxsh.conf)

New version is available in the first Post

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

Posted: Thu Jan 26, 2017 11:17 pm
by dazza1223
o hi there ive downloaded the cumulusmx.sh and
ive
CumulusMX_HOME=/home/pi/USB/Davis
CumulusMX_USER=pi
but whern i reboot i do the /etc/init.d/cumulusmx status
command and i get a error

Jan 26 23:05:46 CumulusMX init.d-Script: CumulusMX is being started at system boot within 0 seconds
Checking CumulusMX... Service not running


and where i run the Start Script cumulusmx.sh to start CumulusMX
right at the top i get a error saying (find: `/tmp/CumulusMX.pid': No such file or directory)
but it still starts

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

Posted: Fri Jan 27, 2017 1:40 am
by BigOkie
dazza1223 wrote:o hi there ive downloaded the cumulusmx.sh and
ive
CumulusMX_HOME=/home/pi/USB/Davis
CumulusMX_USER=pi
but whern i reboot i do the /etc/init.d/cumulusmx status
command and i get a error

Jan 26 23:05:46 CumulusMX init.d-Script: CumulusMX is being started at system boot within 0 seconds
Checking CumulusMX... Service not running


and where i run the Start Script cumulusmx.sh to start CumulusMX
right at the top i get a error saying (find: `/tmp/CumulusMX.pid': No such file or directory)
but it still starts


The one about the service I have no idea.

However, the second one referring to /tmp/CumulusMX.pid is expected. That file is only present when Cumulus is running. When you first start that message is expected since it's not present because CMX isn't running.

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

Posted: Fri Jan 27, 2017 10:29 am
by dazza1223
o ok so that one.... and yh it say somthink about waiting for usb drive to mount and then it time out

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

Posted: Fri Jan 27, 2017 10:49 am
by jank
dazza1223 wrote:o ok so that one.... and yh it say somthink about waiting for usb drive to mount and then it time out


I am absolutely sure, that your "Problem" is related to the etc/init.d/cumulus startup Script.
Let me explain how it works:
The init.d folder on linux can be compared to the Services in Windows.
The startup scripts in the init.d folder tell the Linux system in which runlevel a program should be started.
The Problem in my case is, that your installation is installed on a USB device and I fear, that the init.d start script is being called before the USB drive is mounted.
So I used a delay in this startup script to wait until theUSB drive has being mounted......but this does not always work (as in your case)
I also did the same for network settings....waiting for X seocnds until the Raspberry obtained an IP address when using DHCP or checking until network is available.....
For any reason, at least the "wait fur USB" often did not work properly.....
But, If you see these problems, but want ot start CumulusMX when you start the Raspberry, there is a workaround available.
First read this: viewtopic.php?f=27&t=13767&p=120756&hilit=Watchdog+Option#p120756 maybe this will solve your problem

If the article did not solve your problem, please use the workaround mentioned here: viewtopic.php?f=27&t=13767&p=120459#p120459

cheers Jan

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

Posted: Tue Feb 21, 2017 2:30 pm
by slashmusic
Version 2.5.4.0 is available [21.02.2017]

o I fixed a long term issue. the init.d Script http://sandaysoft.com/forum/viewtopic.php?f=27&t=14753 will not start cumulusmx.sh when CumulusMX is installed on an external drive like USB Stick or USB Harddisk.
The Verison 2.5.4.0 will fix this problem. In additio to the settings which need to be made in the cumulusmxsh.conf file, you need to edit also the cumulusmx.sh script at line 16.
The correct path to the CumulusMX installation folder needs to be inserted. If CumulusMX is installed in /home/pi/CumulusMX nothing needs to be done. Only if installed in a path other then /home/pi/CumulusMX
sudo nano cumulusmx.sh
navigate down to line 16 ---> INSTPATH="media/usb/CumulusMX"
CTRL+O to save file