Welcome to the Cumulus Support forum.

Latest Cumulus MX V4 release 4.4.2 (build 4085) - 12 March 2025

Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024

Legacy Cumulus 1 release 1.9.4 (build 1099) - 28 November 2014
(a patch is available for 1.9.4 build 1099 that extends the date range of drop-down menus to 2030)

Download the Software (Cumulus MX / Cumulus 1 and other related items) from the Wiki

If you are posting a new Topic about an error or if you need help PLEASE read this first viewtopic.php?p=164080#p164080

External program

Topics about the Beta trials up to Build 3043, the last build by Cumulus's founder Steve Loft. It was by this time way out of Beta but Steve wanted to keep it that way until he made a decision on his and Cumulus's future.

Moderator: mcrossley

Locked
thegasman
Posts: 41
Joined: Sun 24 Mar 2013 6:42 pm
Weather Station: WMR88
Operating System: Raspbian on Pi2
Location: Ayr, Scotland, United Kingdom
Contact:

External program

Post by thegasman »

Hi,

I wonder if anyone can help..

I'm having fundamental problems with the 'run external programs' feature of CumulusMX (v3.0 build 3038 on a Raspberry Pi2).
Whenever I enter a program to execute into the 'program' box, the program executes succesfully once, but it causes all subsequent ftp uploads to fail until Cumulus is restarted -going back and removing the program to run from the settings isn't enough.
I started with a tiny Python script to write a timestamp into a text file as a test. This runs succesfully, and the timestamp is written, but the simultaneous and all further ftp uploads fail. I have also tried a bash script containing nothing just in case the Python was throwing an error. Same outcome.
Ftplog.txt contains the following relevant details:
2016-05-09 19:35:02.139 Connecting to ftp.doonfootweather.x10.mx
220---------- Welcome to Pure-FTPd [privsep] [TLS] ----------
220-You are user number 8 of 50 allowed.
220-Local time is now 14:35. Server port: 21.
220-This is a private system - No anonymous login
220-IPv6 connections are also welcome on this server.
220 You will be disconnected after 5 minutes of inactivity.
USER cumulus@doonfootweather.x10.mx
331 User cumulus@doonfootweather.x10.mx OK. Password required
PASS <omitted>
230 OK. Current restricted directory is /
FEAT
211-Extensions supported:
EPRT
IDLE
MDTM
SIZE
MFMT
REST STREAM
MLST type*;size*;sizd*;modify*;UNIX.mode*;UNIX.uid*;UNIX.gid*;unique*;
MLSD
AUTH TLS
PBSZ
PROT
UTF8
TVFS
ESTA
PASV
EPSV
SPSV
ESTP
211 End.
Text encoding: System.Text.UTF8Encoding
OPTS UTF8 ON
200 OK, UTF-8 enabled
Disposing FtpClient object...
Testing connectivity using Socket.Poll()...
Testing connectivity using Socket.Poll()...
There is stale data on the socket, maybe our connection timed out. Re-connecting.
Testing connectivity using Socket.Poll()...
The data was: 421 Timeout - try typing a little faster next time
Not sending QUIT because the connection has already been closed.
Disposing FtpSocketStream...
I'm stumped. Can anyone help?

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

Re: External program

Post by steve »

Launching the external program happens just before ftp login, so it's possible that for some reason the program launch causes a problem on your system. You could turn on debug logging, and see if any interesting messages appear in the diags file regarding the external program. You could also look at your system logs.
Steve
thegasman
Posts: 41
Joined: Sun 24 Mar 2013 6:42 pm
Weather Station: WMR88
Operating System: Raspbian on Pi2
Location: Ayr, Scotland, United Kingdom
Contact:

Re: External program

Post by thegasman »

Ok, it took me a while to get debug logging on - had to add 'logging=1' manually to Cumulus.ini as suggested elsewhere.

Here is the error:
2016-05-09 21:40:02.003 Executing program /home/pi/CumulusMX/trial.sh
2016-05-09 21:40:02.025 External program started
2016-05-09 21:40:02.963 System.NullReferenceException: Object reference not set to an instance of an object
at CumulusMX.Cumulus. () [0x00000] in <filename unknown>:0
at CumulusMX.Cumulus.DoHTMLFiles () [0x00000] in <filename unknown>:0
at System.Threading.Thread.StartInternal () [0x00000] in <filename unknown>:0
Means nothing to me I'm afraid.
PS. Here is the content of my file 'trial.sh'
#!/bin/bash
#echo ""
Martin
User avatar
steve
Cumulus Author
Posts: 26672
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: External program

Post by steve »

Mono doesn't give very helpful stack dumps (no line numbers) so it's hard to say where exactly this exception occurs, except that it's apparently after the ftp connection has been established, but before it has uploaded any files (assuming what was seen in the ftp log you posted earlier is always the same).

I think that the external program is a red herring, and it is the updating of the internet settings that is causing an item to be set to null, where Cumulus expects an empty string. But I did change the code in a recent build to make sure that any null items were changed to empty strings. If this is indeed the problem, then after restarting Cumulus, the problem should go away - is that not the case? And if you just update the internet settings without specifying an external program, the same problem should happen - is that the case?
Steve
thegasman
Posts: 41
Joined: Sun 24 Mar 2013 6:42 pm
Weather Station: WMR88
Operating System: Raspbian on Pi2
Location: Ayr, Scotland, United Kingdom
Contact:

Re: External program

Post by thegasman »

Hi Steve,
I think that the external program is a red herring, and it is the updating of the internet settings that is causing an item to be set to null, where Cumulus expects an empty string.
You are absolutely right, any change to the internet settings causes all subsequent ftp uploads to fail, and restarting Cumulus with no further changes fixes it.
As you mentioned you had made some changes to this in recent builds I have updated today from 3036 to 3038, and lo and behold the problem seems to have resolved.

So not only were you right, but you have already fixed it! :lol:

Thanks for your help, and I will keep my version fully up-to-date from now on.

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

Re: External program

Post by steve »

I would have suggested the latest build but you said you were already using it.
Steve
thegasman
Posts: 41
Joined: Sun 24 Mar 2013 6:42 pm
Weather Station: WMR88
Operating System: Raspbian on Pi2
Location: Ayr, Scotland, United Kingdom
Contact:

Re: External program

Post by thegasman »

Apologies for the typo regarding the version I was running on my first post.

Martin
Locked