Welcome to the Cumulus Support forum.

Latest Cumulus MX V4 release 4.0.1 (build 4023) - 16 May 2024

(Note that 4.1.0 (build 4024) - 05 June 2024 remains available, but usage of this version is not recommended - particularly for Davis stations - and the included utility in this distribution for migrating to v4 is known to contain errors affecting conversion of dayfile.txt)

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

realtime interval issue

Discussion and questions about Cumulus weather station software version 1. This section is the main place to get help with Cumulus 1 software developed by Steve Loft that ceased development in November 2014.
Post Reply
DaveNZ
Posts: 373
Joined: Mon 07 Dec 2009 10:27 pm
Weather Station: Davis VP2
Operating System: Windows 7 64-bit
Location: Howick, Auckland, New Zealand
Contact:

realtime interval issue

Post by DaveNZ »

Hi, I have recently launched a new weather site that updates key data values every 5 seconds.

In my cumulus settings, I upload one file to the server, a custom live-tags.php file.
It gets processed and uploaded every 5 seconds.

The problem arises when I try to include realtime.txt in the uploads as well (our NZ weather network needs that file).
When that is enabled, my website only updates every 10 seconds. It doesn't matter if the realtime.txt is uploaded using the standard "Realtime.txt FTP" checkbox, or manually specifying it in the Files tab of internet settings, the effect is the same.

It appears that those 2 files are only being updated by Cumulus every 10 seconds when I monitor the 'Date modified' timestamps of both files.

Any way around this? Maybe set the realtime to 2.5 seconds to get an effective interval of 5 seconds? :lol:
duke

Re: realtime interval issue

Post by duke »

This comes up fairly regularly and the most likely cause of your problem is in this post. If you do a search you'll find similar posts. Hope this helps.
DaveNZ
Posts: 373
Joined: Mon 07 Dec 2009 10:27 pm
Weather Station: Davis VP2
Operating System: Windows 7 64-bit
Location: Howick, Auckland, New Zealand
Contact:

Re: realtime interval issue

Post by DaveNZ »

The uploads look just fine, every 5 seconds. But the files themselves are only be updated by Cumulus every 10 seconds
User avatar
mcrossley
Posts: 12966
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: realtime interval issue

Post by mcrossley »

A more efficent method would be to only upload your PHP tags file, and redirect realtime.txt to a PHP script that simulates it from the tags?
DaveNZ
Posts: 373
Joined: Mon 07 Dec 2009 10:27 pm
Weather Station: Davis VP2
Operating System: Windows 7 64-bit
Location: Howick, Auckland, New Zealand
Contact:

Re: realtime interval issue

Post by DaveNZ »

mcrossley wrote:A more efficent method would be to only upload your PHP tags file, and redirect realtime.txt to a PHP script that simulates it from the tags?
Yes, I was thinking of going down that route.
Might not be able to replicate realtime.txt perfectly but it should be good enough
User avatar
mcrossley
Posts: 12966
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: realtime interval issue

Post by mcrossley »

I still create a realtime.txt file plus a real-time gauges file along with a real-time PHP file every 5 seconds, but all on the local server, only file copies no ftp.
User avatar
steve
Cumulus Author
Posts: 26701
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: realtime interval issue

Post by steve »

The answer to your original question is almost certainly as in the post Duke linked to. Your assertion that they are being uploaded every 5 seconds but only updated every 10 seconds is noted. However, I can't think of any way that could happen. Perhaps the contents are being updated but not the timestamp?
Steve
DaveNZ
Posts: 373
Joined: Mon 07 Dec 2009 10:27 pm
Weather Station: Davis VP2
Operating System: Windows 7 64-bit
Location: Howick, Auckland, New Zealand
Contact:

Re: realtime interval issue

Post by DaveNZ »

steve wrote:The answer to your original question is almost certainly as in the post Duke linked to. Your assertion that they are being uploaded every 5 seconds but only updated every 10 seconds is noted. However, I can't think of any way that could happen. Perhaps the contents are being updated but not the timestamp?
Possibly that could be the case. Anyway, I went for the approach suggested by Mark, with a realtime.txt produced from my live tags file.
It was surprisingly simple and quick to implement :)
User avatar
laulau
Posts: 678
Joined: Tue 13 Oct 2009 10:52 pm
Weather Station: WeatherDuino Pro2
Operating System: Win 7
Location: Meyenheim, Alsace, FR
Contact:

Re: realtime interval issue

Post by laulau »

DaveNZ wrote: It was surprisingly simple and quick to implement :)
Could you please explain or share some code ?
Thanks
Laurent

Image
DaveNZ
Posts: 373
Joined: Mon 07 Dec 2009 10:27 pm
Weather Station: Davis VP2
Operating System: Windows 7 64-bit
Location: Howick, Auckland, New Zealand
Contact:

Re: realtime interval issue

Post by DaveNZ »

laulau wrote:
DaveNZ wrote: It was surprisingly simple and quick to implement :)
Could you please explain or share some code ?
Thanks
Firstly, using htaccess mod_rewrite, realtime.txt is mapped to realtime.php.
In this file all I do is read in the live data as an array, and perform some quick tidying up of the pressure trend value so it is formatted properly (and yes, I am using a 1 hour change instead of the cumulus 3 hour average rate).

Code: Select all

$d = get_live_data();

// Remove negative sign from 'negative zero'
$pressureTrend = round($d['pressure1hrAgo'] - $d['pressure'], 1);
if ($pressureTrend == "-0")
	$pressureTrend = 0;

// Add plus sign if trend is positive
if ($pressureTrend >= 0)
	$pressureTrend = "+" . $pressureTrend;

Then I just output the new data like this, inserting zero's for values that would require extra calculation/code and are not required for our weather network map.

Code: Select all

$fields = array(
	$d['day'] . "/" . $d['month'] . "/" . substr($d['year'], 2),
	$d['time'],
	$d['temperature'],
	$d['humidity'],
	$d['dewpoint'],
	$d['windSpeed'],
	$d['latestWindSpeed'],
	$d['latestWindBearing'],
	$d['rainRate'],
	$d['todayRain'],
	$d['pressure'],
	convert_bearing($d['latestWindBearing']),
	0, // beaufort
	"km/h",
	"C",
	"hPa",
	"mm",
	$d['todayWindRun'],
	$pressureTrend,
	$d['rainThisMonth'],
	$d['rainThisYear'],
	0, // yesterday rain
	0, // inside temp
	0, // inside hum
	0, // wind chill
	$d['temperatureTrend'],
	$d['todayMaxTemperature'],
	$d['todayMaxTemperatureTime'],
	$d['todayMinTemperature'],
	$d['todayMinTemperatureTime'],
	$d['todayMaxWindSpeed'],
	$d['todayMaxWindSpeedTime'],
	$d['todayMaxWindGust'],
	$d['todayMaxWindGustTime'],
	$d['todayMaxPressure'],
	$d['todayMaxPressureTime'],
	$d['todayMinPressure'],
	$d['todayMinPressureTime']
);

echo implode(" ", $fields);
User avatar
laulau
Posts: 678
Joined: Tue 13 Oct 2009 10:52 pm
Weather Station: WeatherDuino Pro2
Operating System: Win 7
Location: Meyenheim, Alsace, FR
Contact:

Re: realtime interval issue

Post by laulau »

Thanks,
I'll try it soon.
Laurent

Image
Post Reply