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

Default Cumulus web page working in PHP using realtime.txt

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.
Synewave
Posts: 642
Joined: Mon 25 Jan 2010 1:55 pm
Weather Station: Watson W-8681
Operating System: Raspian
Location: Brighton, UK
Contact:

Re: Default Cumulus web page working in PHP using realtime.t

Post by Synewave »

The way I achieved it is started off with DAJ's console script (which updates automatically), then realised the method could be used to drive the whole site using that realtime method. So after understanding how it works and plenty of customisation, it works a treat.
gemini06720
Posts: 1700
Joined: Mon 10 Aug 2009 10:16 pm
Weather Station: No weather station
Operating System: No operating system
Location: World...

Re: Default Cumulus web page working in PHP using realtime.t

Post by gemini06720 »

Synewave wrote:The way I achieved it is started off with DAJ's console script (which updates automatically), then realised the method could be used to drive the whole site using that realtime method. So after understanding how it works and plenty of customisation, it works a treat.
Sure, now all of your website (weather display) updating is being done on the user's computer... :twisted:
Synewave
Posts: 642
Joined: Mon 25 Jan 2010 1:55 pm
Weather Station: Watson W-8681
Operating System: Raspian
Location: Brighton, UK
Contact:

Re: Default Cumulus web page working in PHP using realtime.t

Post by Synewave »

gemini06720 wrote:
Synewave wrote:The way I achieved it is started off with DAJ's console script (which updates automatically), then realised the method could be used to drive the whole site using that realtime method. So after understanding how it works and plenty of customisation, it works a treat.
Sure, now all of your website (weather display) updating is being done on the user's computer... :twisted:
Is that an issue?
tjaliwalpa
Posts: 293
Joined: Sun 18 Apr 2010 9:47 am
Weather Station: Davis VP2
Operating System: Linux Lite Ubuntu 16.04
Location: Karoonda, SA
Contact:

Re: Default Cumulus web page working in PHP using realtime.t

Post by tjaliwalpa »

Synewave wrote:The way I achieved it is started off with DAJ's console script (which updates automatically), then realised the method could be used to drive the whole site using that realtime method. So after understanding how it works and plenty of customisation, it works a treat.
Just to see if and how it works, I've tried a few fields (temp and apparent temp) in my opening page using realtime.txt and java update every 20sec. As I said, I don't use a server with PHP so it isn't an option.

gemini06720, what is the issue with using java to update?
Bob
User avatar
daj
Posts: 2041
Joined: Tue 29 Jul 2008 8:00 pm
Weather Station: WH1081
Operating System: Pi & MX
Location: SW Scotland
Contact:

Re: Default Cumulus web page working in PHP using realtime.t

Post by daj »

There are various ways to crack a nut....Ray (gemini) may prefer an alternative. There is certainly nothing fundamentally wrong in using Ajax loads. It is far better to refresh a page changing only the data rather than the whole page again. Equally you should let your user know that you are doing data refreshed in the back ground -- most of us do as we show a count down timer so it is obvious.

One thing to consider -- if a user visits your site and Javascript is disabled on their browser they will not get much from your page/site. Equally I doubt they would get much from most pages on the internet. LOL

I maybe would not do Ajax loads for my whole site, but that's just a personal choice.
David
kippfordweather.uk
Cumulus MX & Raspberry Pi
gemini06720
Posts: 1700
Joined: Mon 10 Aug 2009 10:16 pm
Weather Station: No weather station
Operating System: No operating system
Location: World...

Re: Default Cumulus web page working in PHP using realtime.t

Post by gemini06720 »

Synewave wrote:
gemini06720 wrote:
Synewave wrote:The way I achieved it is started off with DAJ's console script (which updates automatically), then realised the method could be used to drive the whole site using that realtime method. So after understanding how it works and plenty of customisation, it works a treat.
Sure, now all of your website (weather display) updating is being done on the user's computer... :twisted:
Is that an issue?
To the contrary, you are somewhat relieving your host server... :D

Paul, rather than forcing a complete page refresh (with a meta tag) which forces the host server to produce a completely new page (and download that newly created/updated page to the user's computer), the JavaScript (which is running on the user's computer) looks for changes in the 'realtime.txt' file (I presume this is the file that is being used by your script) and updates the web page (that is stored in the user's browser cache directory) with only the values that have changed... ;)
Synewave
Posts: 642
Joined: Mon 25 Jan 2010 1:55 pm
Weather Station: Watson W-8681
Operating System: Raspian
Location: Brighton, UK
Contact:

Re: Default Cumulus web page working in PHP using realtime.t

Post by Synewave »

That's how I understood it worked, so that's good. :clap: It reads from realtime.txt and an additional realtime file containing all the other tags processed by Cumulus that I want to use.
fractonimbus
Posts: 159
Joined: Thu 03 Feb 2011 1:15 am
Weather Station: WH1091
Operating System: Windows 7 on a Dell Vostro
Location: Canberra

Re: Default Cumulus web page working in PHP using realtime.t

Post by fractonimbus »

David,

Quick question about Ajax and jQuery: I presume jQuery is an Ajax application?

Looking at your WeatherConsole package, it seems a good approach to use in place of my PHP escapades :-)

I like the idea of not having to refresh the whole page, and I'm noticing that the combination of PHP and meta refresh occasionally leaves some of the entries unfilled. Presumably due to slow processing of the PHP code.

DN
User avatar
daj
Posts: 2041
Joined: Tue 29 Jul 2008 8:00 pm
Weather Station: WH1081
Operating System: Pi & MX
Location: SW Scotland
Contact:

Re: Default Cumulus web page working in PHP using realtime.t

Post by daj »

fractonimbus wrote:I like the idea of not having to refresh the whole page, and I'm noticing that the combination of PHP and meta refresh occasionally leaves some of the entries unfilled. Presumably due to slow processing of the PHP code.

DN
Why you still doing a meta-refresh?! :?

PHP is only executed once, on the server, as it delivers the page. After than leave it to jquery/JS to read the data and update the data on the page.
David
kippfordweather.uk
Cumulus MX & Raspberry Pi
fractonimbus
Posts: 159
Joined: Thu 03 Feb 2011 1:15 am
Weather Station: WH1091
Operating System: Windows 7 on a Dell Vostro
Location: Canberra

Re: Default Cumulus web page working in PHP using realtime.t

Post by fractonimbus »

David,

I've abandoned (for the moment) PHP and am recoding the index page using your wconsole.html page as a guide. I agree it's vastly better than the PHP effort. See a mock up page with some of the variables responding to jquery/JS updates at www.dcnicholls.com/wx/ind_test.html . So far so good but not everything is yet working (ie page is partly static).

DN
User avatar
daj
Posts: 2041
Joined: Tue 29 Jul 2008 8:00 pm
Weather Station: WH1081
Operating System: Pi & MX
Location: SW Scotland
Contact:

Re: Default Cumulus web page working in PHP using realtime.t

Post by daj »

Excellent, well done.

I would consider adding a little count down to the page to let visitors know when it will next update, or just a message to say it will refresh every x minutes/seconds?

One 'flaw' with my 'console' code is that initially the data is blank, and then quickly filled out by the Ajax calls. I should really change it so that the initial page load has data, or at least shows a message while it loads the first set.
David
kippfordweather.uk
Cumulus MX & Raspberry Pi
Synewave
Posts: 642
Joined: Mon 25 Jan 2010 1:55 pm
Weather Station: Watson W-8681
Operating System: Raspian
Location: Brighton, UK
Contact:

Re: Default Cumulus web page working in PHP using realtime.t

Post by Synewave »

fractonimbus wrote:David,

I've abandoned (for the moment) PHP and am recoding the index page using your wconsole.html page as a guide. I agree it's vastly better than the PHP effort. See a mock up page with some of the variables responding to jquery/JS updates at http://www.dcnicholls.com/wx/ind_test.html . So far so good but not everything is yet working (ie page is partly static).

DN
Excellent job!
fractonimbus
Posts: 159
Joined: Thu 03 Feb 2011 1:15 am
Weather Station: WH1091
Operating System: Windows 7 on a Dell Vostro
Location: Canberra

Re: Default Cumulus web page working in PHP using realtime.t

Post by fractonimbus »

Hi David,

Yes, the lack of a countdown is just because I'm still working on it.

I also need (1) to work out how to parse the date and time to get the current static webpage values from the data in realtime.txt.

And (2) I need to work out the Javascript to calculate the Fire Danger Index.

And also (3) the Last Rainfall data, which is not part of the realtime.txt. Is there a way to get Cumulus to add parameters to realtime.txt, or to some small text file to upload at the same time?

Ideally the dawn dusk, sun and moon etc data would be nice to include, too, but I may have to let the regular upload process do that (which is what I did with the PHP page).

DN
Synewave
Posts: 642
Joined: Mon 25 Jan 2010 1:55 pm
Weather Station: Watson W-8681
Operating System: Raspian
Location: Brighton, UK
Contact:

Re: Default Cumulus web page working in PHP using realtime.t

Post by Synewave »

daj wrote:One 'flaw' with my 'console' code is that initially the data is blank, and then quickly filled out by the Ajax calls. I should really change it so that the initial page load has data, or at least shows a message while it loads the first set.
If you come up with something, I'd be really interested. The other problem is that if the Javascript is reading the realtime file at the time Cumulus is uploading it, the data shows strange HTML code.

I've overcome this somewhat by getting a good combination of realtime upload interval and the javascript refresh settings.
User avatar
daj
Posts: 2041
Joined: Tue 29 Jul 2008 8:00 pm
Weather Station: WH1081
Operating System: Pi & MX
Location: SW Scotland
Contact:

Re: Default Cumulus web page working in PHP using realtime.t

Post by daj »

fractonimbus wrote:And also (3) the Last Rainfall data, which is not part of the realtime.txt. Is there a way to get Cumulus to add parameters to realtime.txt, or to some small text file to upload at the same time?

Ideally the dawn dusk, sun and moon etc data would be nice to include, too, but I may have to let the regular upload process do that (which is what I did with the PHP page).

DN
You don't need to use the default realtime.txt file, you could build your own using webtags or create a second one. Example

realtime-extras.txt
<#sunrise> <#sunset> <#dawn> <#dusk>

Get Cumulus to process this file in realtime and it will upload too. Your code can then parse this additional file for the extra data
David
kippfordweather.uk
Cumulus MX & Raspberry Pi
Post Reply