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
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
-
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
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
Sure, now all of your website (weather display) updating is being done on the user's computer...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.
-
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
Is that an issue?gemini06720 wrote:Sure, now all of your website (weather display) updating is being done on the user's computer...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.
-
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
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.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.
gemini06720, what is the issue with using java to update?
Bob
- 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
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.
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.
-
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
To the contrary, you are somewhat relieving your host server...Synewave wrote:Is that an issue?gemini06720 wrote:Sure, now all of your website (weather display) updating is being done on the user's computer...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.
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
That's how I understood it worked, so that's good.
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
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
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
- 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
Why you still doing a meta-refresh?!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
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.
-
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
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
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
- 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
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.
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.
-
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
Excellent job!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
-
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
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
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
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.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.
I've overcome this somewhat by getting a good combination of realtime upload interval and the javascript refresh settings.
- 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
You don't need to use the default realtime.txt file, you could build your own using webtags or create a second one. Examplefractonimbus 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
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