Welcome to the new home of the Cumulus Support forum.

Latest Cumulus release v1.9.4 (build 1099) - Nov 28 2014
Latest Cumulus MX release - v3.0.0 build 3044 7 December 2018. See the Wiki for download

Realtime extra program not firing

Discussion of version 3 of Cumulus, which runs on Windows, Linux, and OS X. All Cumulus MX queries in here, please.

Moderator: mcrossley

Post Reply
weathersoft
Posts: 5
Joined: Thu 29 Jun 2017 12:13 pm
Weather Station: Davis Vantage Pro2
Operating System: Raspbian

Realtime extra program not firing

Post by weathersoft » Thu 20 Jul 2017 5:20 am

I have been trying to get an extra script to fire when the Realtime processing runs in Cumulus MX, but I can't get it to work.

In the Web/FTP Settings I have the options Enable Realtime, Enable realtime FTP and Realtime.txt FTP all checked. The realtime.txt file is successfully being uploaded to the FTP server, so I know the standard realtime processing is firing. Under External programs I have entered the following in Realtime program: "/home/pi/cumulusFTP.sh". When I check in Cumulus.ini it has the following line:

Code: Select all

RealtimeProgram=/home/pi/cumulusFTP.sh
I have my script cumulusFTP.sh set up in /home/pi and with execute rights to everyone. I can run it by entering "/home/pi/cumulusFTP.sh" at the command line and it executes. I know it has executed because I have the following as the first line of the script:

Code: Select all

echo "Sending realtime file to remote server" >/tmp/temp.tmp
When I execute the script manually the file /tmp/temp.tmp is updated as expected. But it never gets updated at any other time, so I know that it is not getting executed by Cumulus. I have tried restarting Cumulus MX but that doesn't help either. What could be going wrong? Why is Cumulus not executing the script?

I am running Cumulus MX 3.0.0 b3043 under mono v3.2.8 on Raspberry PI Raspbian Linux.

Can anyone assist?

User avatar
steve
Cumulus Author
Posts: 26714
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: Realtime extra program not firing

Post by steve » Thu 20 Jul 2017 7:01 am

I'm no expert at this, but have you tried /bin/bash as the command and your script as the parameter?
Steve

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

Re: Realtime extra program not firing

Post by weathersoft » Fri 21 Jul 2017 1:25 am

Steve, apparently you are an expert at this! I did as you suggested and it started working straight away.

I think the Cumulus doc could do with a bit of updating in this area. It suggests that the field should contain a "program or command to be run", but it seems that at least in the Unix case a shell script doesn't count as a "program", which is odd since I believe people with .BAT/.CMD scripts on Windows are executing these directly. Anyway, I should have tried using /bin/bash ... silly me. And this forum topic will serve to alert anyone else who is trying this in future so all good.

For reference for anyone else doing something similar, I now have this in the Cumulus.ini and is working:

Code: Select all

RealtimeProgram=/bin/bash
RealtimeParams=/home/pi/cumulusFTP.sh
Thanks for the help!

Steepleian
Posts: 31
Joined: Sat 29 Mar 2014 7:33 am
Weather Station: WH2950
Operating System: Debian 9
Location: Steeple Claydon
Contact:

Re: Realtime extra program not firing

Post by Steepleian » Sat 22 Jul 2017 8:49 am

weathersoft wrote:Steve, apparently you are an expert at this! I did as you suggested and it started working straight away.

I think the Cumulus doc could do with a bit of updating in this area. It suggests that the field should contain a "program or command to be run", but it seems that at least in the Unix case a shell script doesn't count as a "program", which is odd since I believe people with .BAT/.CMD scripts on Windows are executing these directly. Anyway, I should have tried using /bin/bash ... silly me. And this forum topic will serve to alert anyone else who is trying this in future so all good.

For reference for anyone else doing something similar, I now have this in the Cumulus.ini and is working:

Code: Select all

RealtimeProgram=/bin/bash
RealtimeParams=/home/pi/cumulusFTP.sh
Thanks for the help!
Did you make the shell script executable using chmod +x ?

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

Re: Realtime extra program not firing

Post by weathersoft » Sun 23 Jul 2017 8:02 am

Did you make the shell script executable using chmod +x ?
Oh yes, it was definitely executable. chmod 755 was done right after the script was created. Directory listing as shown here:

Code: Select all

pi@raspberrypi:~ $ ls -l cumulusFTP.sh
-rwxr-xr-x 1 pi pi 259 Jul 21 11:28 cumulusFTP.sh
I could also verify that by executing it from the command line as "/home/pi/cumulusFTP.sh", which wouldn't have worked if it was not executable.

Post Reply