Welcome to the Cumulus Support forum.

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

Cumulus MX V4 beta test release 4.0.0 (build 4018) - 28 March 2024

Legacy Cumulus 1 release v1.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

Yet Another Dayfile Reader (PHP)

Other discussion about creating web sites for Cumulus that doesn't have a specific subforum

Moderator: daj

Vegit8
Posts: 127
Joined: Fri 27 Sep 2013 2:11 pm
Weather Station: Davis Vantage Pro2
Operating System: Win 10
Location: Dorset
Contact:

Re: Yet Another Dayfile Reader (PHP)

Post by Vegit8 »

A question...
I have implemented this on my website, is it possible to do the same thing for the Local interface - http://localhost:8998/index.html

Cheers
water01
Posts: 3215
Joined: Sat 13 Aug 2011 9:33 am
Weather Station: Ecowitt HP2551
Operating System: Windows 10 64bit
Location: Burnham-on-Sea
Contact:

Re: Yet Another Dayfile Reader (PHP)

Post by water01 »

It is possible but the Dayfile Reader is written in PHP therefore you would have to have the PHP installed and have running it's own Web Server (https://www.php.net/manual/en/features. ... server.php). Then you will have to either call it from altered index.html (the one in the interface folder) or directly call it from a URL i.e. http://localhost/CumulusMX/data/betel_r ... e.php:8000 (assuming two things the PHP webserver is using the standard 8000 port and you installed the dayfile reader in the data folder of your CumulusMX install directory).

Seems a lot of work when it is available on the web in another tab?

See you live in Ditcheat, home of good cheese and Paul Nicholls!!
David
Image
sfws
Posts: 1183
Joined: Fri 27 Jul 2012 11:29 am
Weather Station: Chas O, Maplin N96FY, N25FR
Operating System: rPi 3B+ with Buster (full)

Re: Yet Another Dayfile Reader (PHP)

Post by sfws »

David has got it right, the web server created by the MX engine is very basic. Much more sophisticated web servers are needed to cope with potential complexity of PHP (and databases).

In theory, you can do it the other way round, I imagine you could run the MX user interface on another web server, but there is a lot more to move than you might guess.
Vegit8
Posts: 127
Joined: Fri 27 Sep 2013 2:11 pm
Weather Station: Davis Vantage Pro2
Operating System: Win 10
Location: Dorset
Contact:

Re: Yet Another Dayfile Reader (PHP)

Post by Vegit8 »

Thanks guys.
I sort of thought that may be the case.
Yes, no shortage of cheese or butter here.
The horses are still riding out each day, but one behind each other instead of 2 abreast
User avatar
mcrossley
Posts: 12694
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Yet Another Dayfile Reader (PHP)

Post by mcrossley »

Vegit8 wrote: Mon 30 Mar 2020 9:33 pm The horses are still riding out each day, but one behind each other instead of 2 abreast
I would have thought that is the worst way of doing it, by slipstreaming the person in front you are breathing in anything they exhale. Cyclists are being told not to slipstream.
User avatar
HansR
Posts: 5871
Joined: Sat 20 Oct 2012 6:53 am
Weather Station: GW1100 (WS80/WH40)
Operating System: Raspberry OS/Bullseye
Location: Wagenborgen (NL)
Contact:

Re: Yet Another Dayfile Reader (PHP)

Post by HansR »

I am not native English, as many have remarked here ;) , but I would interpret 'The horses are still riding out each day, but one behind each other instead of 2 abreast' that Nicholls and his horses are still alive, but not racing any more, at least not very good. (Yes, I looked up Nicholls, he's not that famous that the Dutch would know him. Just curious about the remark).

Some British remarks are quite funny actually like 'wagging the dog by the tail', another one I remember.
Hans

https://meteo-wagenborgen.nl
CMX build 4017+ ● RPi 3B+ ● Raspbian Linux 6.1.21-v7+ armv7l ● dotnet 8.0.3
water01
Posts: 3215
Joined: Sat 13 Aug 2011 9:33 am
Weather Station: Ecowitt HP2551
Operating System: Windows 10 64bit
Location: Burnham-on-Sea
Contact:

Re: Yet Another Dayfile Reader (PHP)

Post by water01 »

Some British remarks are quite funny actually like 'wagging the dog by the tail', another one I remember.
It's actually "The tail wagging the dog", which describes a situation in which an important or powerful person, organization, etc., is being controlled by someone or something that is much less important or powerful
David
Image
User avatar
beteljuice
Posts: 3292
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: W10 - Threadripper 16core, etc
Location: Dudley, West Midlands, UK

Re: Yet Another Dayfile Reader (PHP)

Post by beteljuice »

Especially for Hans ...
Some British remarks are quite funny
... and when we don't understand something it's "Double Dutch" to us :mrgreen:
Image
......................Imagine, what you will KNOW tomorrow !
Vegit8
Posts: 127
Joined: Fri 27 Sep 2013 2:11 pm
Weather Station: Davis Vantage Pro2
Operating System: Win 10
Location: Dorset
Contact:

Re: Yet Another Dayfile Reader (PHP)

Post by Vegit8 »

For those concerned as to the well being of the stable hands. The horses and riders only walk slowly through the village. They only gallop when using one of the all weather training areas. One of which rises almost 200 feet in a very short distance.
There are 140 plus horses in training, and the National Hunt season ends at the end of April in any case. Most if not all horses will then be turned out to grass for a holiday!
edo89
Posts: 2
Joined: Fri 27 Mar 2020 8:35 pm
Weather Station: Davis VP2 Daytime
Operating System: Raspberry Pi4 - Raspbian

Re: Yet Another Dayfile Reader (PHP)

Post by edo89 »

Hi to all!

I have a problem with this reader...
If I use the reader in the standalone mode I have no problem, it works well.
http://meteobernate.altervista.org/weat ... /basic.php

But if I try to use it as a link of the menu of my website (leuven template) I have the error "Failed to open dayfile"
http://meteobernate.altervista.org/weat ... #data-area

I saw that in the past some people have the same problem but I'm not able to solve it... I can't understand where is the problem... :bash:

Thank you for your help!
sfws
Posts: 1183
Joined: Fri 27 Jul 2012 11:29 am
Weather Station: Chas O, Maplin N96FY, N25FR
Operating System: rPi 3B+ with Buster (full)

Re: Yet Another Dayfile Reader (PHP)

Post by sfws »

edo89 wrote: Sat 02 May 2020 5:01 pm I have the error "Failed to open dayfile"
What have you said for location of dayfile.txt in the script?
If you have the same path in the script for both your web pages, it will not work.

In index.php, it will look for that file starting at http://meteobernate.altervista.org/weather28/ and presumably not find it because it needs to start looking within sub-directory inc.

in basic.php, it finds the file because it does start looking at http://meteobernate.altervista.org/weather28/inc/
edo89
Posts: 2
Joined: Fri 27 Mar 2020 8:35 pm
Weather Station: Davis VP2 Daytime
Operating System: Raspberry Pi4 - Raspbian

Re: Yet Another Dayfile Reader (PHP)

Post by edo89 »

Thank you for your help, you were right because now the error was disappeared. :clap:

I also moved the betel_readDayfile (and the other files) in the main path with dayfile.txt because in a first time I was not able to switch from the parameters.
Now it works :P
http://meteobernate.altervista.org/weat ... #data-area
User avatar
beteljuice
Posts: 3292
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: W10 - Threadripper 16core, etc
Location: Dudley, West Midlands, UK

Re: Yet Another Update

Post by beteljuice »

Coming Soon ....

Yet Another Update.

No urgency, the way cookies are created (and therefore read) is changing, so need to be fixed.

The mod is simple, and if you wish to do it yourself so as you don't have to re-do all your options etc. ...

betel_readDayfile.php approx. line #1661

Code: Select all

foreach($displayUOM as $key => $val){

//$script .= "    document.cookie = 'theseUOM[".$key."] =".$val."; '+expires;\n";
$script .= "    document.cookie = 'theseUOM[".$key."] =".$val."; '+expires+'; sameSite=lax;'\n";
}
... be back soon with a new distro.
Image
......................Imagine, what you will KNOW tomorrow !
Mapantz
Posts: 1777
Joined: Sat 17 Dec 2011 11:55 am
Weather Station: Davis Vantage Pro2
Operating System: Windows 11 x64
Location: Dorset - UK
Contact:

Re: Yet Another Dayfile Reader (PHP)

Post by Mapantz »

Have you added the 'Feels Like' tables yet, beteljuice? :lol:
Image
water01
Posts: 3215
Joined: Sat 13 Aug 2011 9:33 am
Weather Station: Ecowitt HP2551
Operating System: Windows 10 64bit
Location: Burnham-on-Sea
Contact:

Re: Yet Another Dayfile Reader (PHP)

Post by water01 »

That was easy if you use Mark's original MySQL based script, just change the Apparent to Feels Like.

Code: Select all

        array(101,'MinFeelsLike','Min Feels Like',false,1,'cDewL'),
        array(102,'MaxFeelsLike','Max Feels Like',true,1,'cDewH'),
David
Image
Post Reply