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

Yet Another Dayfile Reader (PHP)

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

Moderator: daj

User avatar
Dador
Posts: 352
Joined: Thu 24 Nov 2011 2:22 pm
Weather Station: Davis VP2 Plus & Ecowitt
Operating System: Windows 10
Location: Rybnik, Poland
Contact:

Re: Yet Another Dayfile Reader (PHP)

Post by Dador »

Thanks,

I compared your file and mine and came up with something that wasn't bad for me.

Well, if you have solar sensors added to the station later than after the first launch, it is worth editing this section in the code carefully. For me it was bad and the whole calendar for solar data didn't work :bash: .

Code: Select all

$date_sunsensorOK = array('2016/6/11');  // format 'yyyy/m/d', will assume zero values from this date are true
$date_sunsensorFAIL = array('');  // format 'yyyy/m/d/ will assume zero values from this date are null

$date_solarOK = array('2016/6/11');  // format 'yyyy/m/d', will assume zero values from this date are true
$date_solarFAIL = array('');  // format 'yyyy/m/d/ will assume zero values from this date are null

$date_UVOK = array('2019/6/20');  // format 'yyyy/m/d', will assume zero values from this date are true
$date_UVFAIL = array('');  // format 'yyyy/m/d/ will assume zero values from this date are null
Now the script works fine and even better than before.
AndyKF650
Posts: 818
Joined: Thu 20 Aug 2020 8:35 am
Weather Station: Davis VP2 Plus
Operating System: RPiv5B 64bit Linux 12 Bookworm
Location: Jersey Channel Islands
Contact:

Re: Yet Another Dayfile Reader (PHP)

Post by AndyKF650 »

hi there

Glad to help out, yes my solar cells were added well after the rest of the weather sensors.
Mrc
Posts: 70
Joined: Mon 11 Apr 2016 12:39 pm
Weather Station: Ecowitt hp2551
Operating System: Windows 10
Location: Finland

Re: Yet Another Dayfile Reader (PHP)

Post by Mrc »

Hi. Any idea why the average data seems to be wrong? It's about the sun sensor because I didn't have it until last year. So the sunshine, solar energy and uv average data is wrong..
You do not have the required permissions to view the files attached to this post.
AndyKF650
Posts: 818
Joined: Thu 20 Aug 2020 8:35 am
Weather Station: Davis VP2 Plus
Operating System: RPiv5B 64bit Linux 12 Bookworm
Location: Jersey Channel Islands
Contact:

Re: Yet Another Dayfile Reader (PHP)

Post by AndyKF650 »

Hi there

I think that you need to clean up the data for your solar set. The clue for this is contained in the betel_readDayfile.php file and at the end of the user adjustment section which for me is at about lines 193 to 203. You need set "sanitize" to "true" so that the null data is removed from the calculation, then the averages, for you, will only average 1 year rather than incorrectly trying to average 10 years.

I have included a snip from my file for information.

Code: Select all

// Cumulus provides 0 or 0.0 for missing or invalid data - this can make a nonsense of minimum and average values.
// The best thing to do is to edit your dayfile.txt and nullify (,,) any false data.
// However; depending upon your location, some datasets can reasonably be expected to be > 0 (remember these are daily values)
// These COULD include:
// ... 'windspd', 'windgust', 'windrun', 'HoursSun', 'Solar', 'HighUV', 'evt'

$SANITIZE = true; // true OR false - attempt to ignore zero in the following datasets:
// $zero_as_null = array('windspd', 'windgust', 'windrun', 'HoursSun', 'Solar', 'HighUV'); // datasets to 'fix' - EDIT TO SUIT
 $zero_as_null = array('evt', 'windrun', 'coolday', 'heatday', 'tFLmax'); // datasets to 'fix' - EDIT TO SUIT

// *** END * END * END USER VARIABLES *********************************************************************************************************
flort
Posts: 248
Joined: Thu 17 Dec 2020 9:06 am
Weather Station: Davis Vantage Vue
Operating System: Raspbian GNU/Linux 10 (buster)
Location: Tin Can Bay, Queensland, Australia

Re: Yet Another Dayfile Reader (PHP)

Post by flort »

Don't forget to set your start dates also for your solar. You will find this on lines 65 to 72. Refer previous post by Dador at the top of this page.

Regards,
Trevor
Mrc
Posts: 70
Joined: Mon 11 Apr 2016 12:39 pm
Weather Station: Ecowitt hp2551
Operating System: Windows 10
Location: Finland

Re: Yet Another Dayfile Reader (PHP)

Post by Mrc »

Thank you! Now it works and everything is fine! :D
Vegit8
Posts: 132
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 »

Moving site issue

I have moved my site to IONOS, and after a couple of simple issues it is now running - EXCEPT for the dayfile reader page.

It loads from the URL http://www.geoffwebber.co.uk/weather/be ... ummary.php - but no data / content is displayed.

In order to avoid criticism - I have

Re read the Dayfile - How To file
I have contacted IONOS who assure me PHP (v8.3) is running
I can load the actual dayfile via the browser - so I know it is there and current

My site on the previous host (LCN) had worked perfectly for years.
I just downloaded the /weather directory from there and then uploaded the same to IONOS. Both are / were first level from the root.

I have not included MXDiags as I beleive this problem is beyond MX, all the releveant files are being uploaded to my new location.

Any / all suggestions gratefully received - Cheers
AndyKF650
Posts: 818
Joined: Thu 20 Aug 2020 8:35 am
Weather Station: Davis VP2 Plus
Operating System: RPiv5B 64bit Linux 12 Bookworm
Location: Jersey Channel Islands
Contact:

Re: Yet Another Dayfile Reader (PHP)

Post by AndyKF650 »

Hi there

It seems like you have covered most of the bases but did you check the loading point for the betel_readDayfile.php at about line 47. For me the line reads

Code: Select all

$dayfile = './dayfile.txt'; // to work correctly this should be a relative address NOT full url
As far as I remember this is the only reference to the correct load point. It maybe your file setup with IONOS is different to your previous provider.
User avatar
De Hout
Posts: 92
Joined: Thu 09 Oct 2014 5:40 pm
Weather Station: Davis Vantage Pro2+ FARS
Operating System: Windows 11 | CU v1.9.4 (10992)
Location: Alkmaar, The Netherlands
Contact:

Re: Yet Another Dayfile Reader (PHP)

Post by De Hout »

Vegit8 wrote: Tue 21 Jan 2025 1:38 pm
I have contacted IONOS who assure me PHP (v8.3) is running
First check this:
https://www.ionos.com/help/hosting/mana ... -versions/

I doubt PHP is running, because if I look at the source code of your page I can see your PHP code.
That should not be possible when PHP is running.

I suggest you use the attached test.php file which contains the code below.

Code: Select all

<?php
phpinfo();
?>
Unzip the attached file, and upload test.php to your webspace root and check if it works: http://www.geoffwebber.co.uk/test.php
If PHP works correctly, you should see an info listing of the installed PHP version.
You do not have the required permissions to view the files attached to this post.
Derk

Image
Vegit8
Posts: 132
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 »

HI
Thanks for the reply..

Yes that was my thought, but I have already checked my account, and the screen you have suggested confirms the PHP version running (apparently) for my domain.

Confused? - I am
php_running.png
You do not have the required permissions to view the files attached to this post.
flort
Posts: 248
Joined: Thu 17 Dec 2020 9:06 am
Weather Station: Davis Vantage Vue
Operating System: Raspbian GNU/Linux 10 (buster)
Location: Tin Can Bay, Queensland, Australia

Re: Yet Another Dayfile Reader (PHP)

Post by flort »

AndyK is on the right track. The location of dayfile.txt is in relation to the location of betel_readDayfile.php. As they are both located in the same directory your location needs to just read 'dayfile.txt' not 'weather/dayfile.txt'.

Regards,
Trevor
Vegit8
Posts: 132
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 »

Hi Trevor

Yes I added the /weather/ after my original file that did not have that path did not work.
Now reverted to the original version, which still doesnt work.

I have also planted a test file (test.php) in the root and in my weather directory
The script reads
<?php
echo "PHP is running!";
?>

I would have thought that browsing to that address would have resulted in just the message (the echo bit) being displayed, not the whole contents of the .php file.
Which sort of reinforces my view that php is NOT running

UPDATE:
After yet another call to IONOS, they finally took on board that (despite whatever their systems were saying) there was an issue with PHP, it suddenly stated working!!!
I have to say CHATGPT, was a great help with testing solutions and also gave me words to challenge them with..

Happy days

Impressed with the speed of response from their servers.
User avatar
JennyLeez
Posts: 336
Joined: Wed 16 Dec 2009 2:32 am
Weather Station: La Crosse WS3083
Operating System: Windows XP, Win7 & Win 10
Location: Wairoa, Hawkes Bay. New Zealand.
Contact:

Re: Yet Another Dayfile Reader (PHP)

Post by JennyLeez »

Good Day,

From my reading this was distributed for PHP version 7.
Is there an updated version please for PHP 8 or 8.1

Thanks in advance.

Jenny
Wairoa, Hawkes Bay, New Zealand Weather Station:
http://wairoa.net/weather/index.htm
Cumulus Topsites:
http://cumulussites.net/
Image
water01
Posts: 3669
Joined: Sat 13 Aug 2011 9:33 am
Weather Station: Ecowitt HP2551
Operating System: Windows 10/11 64bit Synology NAS
Location: Burnham-on-Sea
Contact:

Re: Yet Another Dayfile Reader (PHP)

Post by water01 »

The last one that betaljuice released 7.1.4 at the bottom of the first post works perfectly OK on 8.1.31
David
Image
User avatar
JennyLeez
Posts: 336
Joined: Wed 16 Dec 2009 2:32 am
Weather Station: La Crosse WS3083
Operating System: Windows XP, Win7 & Win 10
Location: Wairoa, Hawkes Bay. New Zealand.
Contact:

Re: Yet Another Dayfile Reader (PHP)

Post by JennyLeez »

Ok thx David.
I will use that one :)
Wairoa, Hawkes Bay, New Zealand Weather Station:
http://wairoa.net/weather/index.htm
Cumulus Topsites:
http://cumulussites.net/
Image
Post Reply