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

BCJKiwi
Posts: 1255
Joined: Mon 09 Jul 2012 8:40 pm
Weather Station: Davis VP2 Cabled
Operating System: Windows 10 Pro
Location: Auckland, New Zealand
Contact:

Re: Yet Another Dayfile Reader (PHP)

Post by BCJKiwi »

Hmm
Couldn't see any difference when I tested it.

What figures are different?
When this was discussed before, Ken True had a different suggestion for resolving this but don't recall what that was.
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 »

the beteljuice thinks he has made it php 5.x > php 7.0.x compatible.
... also an existing non-fatal missing declaration fixed.

Could someone using php5 AND someone using php7 please test this attachment against what they current have.

DON'T FORGET to back-up your existing betel_readDayfile.php and to change any options you may edited to your personal preferences.
betel_readDayfile.zip
Thank You
You do not have the required permissions to view the files attached to this post.
Image
......................Imagine, what you will KNOW tomorrow !
jlmr731
Posts: 225
Joined: Sat 27 Aug 2016 12:11 am
Weather Station: Davis vantage pro 2
Operating System: Debian
Location: Wickliffe, Ohio
Contact:

Re: Yet Another Dayfile Reader (PHP)

Post by jlmr731 »

Tested in php 5.6 seems good
In php 7.1 still get the same error in apache logs
PHP Warning: Illegal string offset 'short' in /var/www/html/test_readDayfile.php on line 1126, referer: http://youngstownweather.dynu.com/dailysummary.php
[Tue Apr 18 18:31:32.780030 2017] [php7:notice] [pid 21281] [client 192.168.1.27:50878] PHP Stack trace:, referer: http://youngstownweather.dynu.com/dailysummary.php
[Tue Apr 18 18:31:32.780038 2017] [php7:notice] [pid 21281] [client 192.168.1.27:50878] PHP 1. {main}() /var/www/html/basic.php:0, referer: http://youngstownweather.dynu.com/dailysummary.php
[Tue Apr 18 18:31:32.780043 2017] [php7:notice] [pid 21281] [client 192.168.1.27:50878] PHP 2. include() /var/www/html/basic.php:11, referer: http://youngstownweather.dynu.com/dailysummary.php
[Tue Apr 18 18:31:32.780047 2017] [php7:notice] [pid 21281] [client 192.168.1.27:50878] PHP 3. drawCalendar() /var/www/html/test_readDayfile.php:1549, referer: http://youngstownweather.dynu.com/dailysummary.php
[Tue Apr 18 18:31:32.780406 2017] [php7:notice] [pid 21281] [client 192.168.1.27:50878] PHP Warning: Illegal string offset 'short' in /var/www/html/test_readDayfile.php on line 1126, referer: http://youngstownweather.dynu.com/dailysummary.php
[Tue Apr 18 18:31:32.780416 2017] [php7:notice] [pid 21281] [client 192.168.1.27:50878] PHP Stack trace:, referer: http://youngstownweather.dynu.com/dailysummary.php
[Tue Apr 18 18:31:32.780420 2017] [php7:notice] [pid 21281] [client 192.168.1.27:50878] PHP 1. {main}() /var/www/html/basic.php:0, referer: http://youngstownweather.dynu.com/dailysummary.php
[Tue Apr 18 18:31:32.780423 2017] [php7:notice] [pid 21281] [client 192.168.1.27:50878] PHP 2. include() /var/www/html/basic.php:11, referer: http://youngstownweather.dynu.com/dailysummary.php
[Tue Apr 18 18:31:32.780426 2017] [php7:notice] [pid 21281] [client 192.168.1.27:50878] PHP 3. drawCalendar() /var/www/html/test_readDayfile.php:1549, referer: http://youngstownweather.dynu.com/dailysummary.php
Hope that helps

Dont have a ton of data to go against maybe not being a full years worth cause this ? maybe?
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 »

Urggh ....

Your average of averages (bottom line) is missing !

I am not happy :bash:
edit: ... and I haven't got a clue what isn't happening :cry:
Image
......................Imagine, what you will KNOW tomorrow !
jlmr731
Posts: 225
Joined: Sat 27 Aug 2016 12:11 am
Weather Station: Davis vantage pro 2
Operating System: Debian
Location: Wickliffe, Ohio
Contact:

Re: Yet Another Dayfile Reader (PHP)

Post by jlmr731 »

beteljuice wrote:Urggh ....

Your average of averages (bottom line) is missing !

I am not happy :bash:
edit: ... and I haven't got a clue what isn't happening :cry:
Ugg yes I see that now, also tried with php 5.6 and looked that same :groan:

If there is anything that can be done like debugging let me know Ill try and help out

Even without average of averages I still love your work thanks so much !!!
User avatar
mcrossley
Posts: 12692
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 »

Odd, I tried my variation of this script on PHP 7.0 yesterday and it ran without any errors. :?

I'm just plucking up the courage to switch the live server to PHP 7.0 from 5.6 - the rest of the site seems to be working OK on my dev server, it only required a small tweak to the MX Graphs.
Grimers
Posts: 240
Joined: Tue 24 Nov 2015 9:07 am
Weather Station: Davis Vantage Pro2
Operating System: Windows 11 64-bit
Location: Newton Poppleford, Devon, UK
Contact:

Re: Yet Another Dayfile Reader (PHP)

Post by Grimers »

beteljuice, just wanted to bring to your attention that there are a lot of HTML validation errors in your code: https://validator.w3.org/nu/?doc=http%3 ... 2Fdata.php
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 »

The check link responds ...
Document checking completed. No errors or warnings to show.

Used the HTML parser. Externally specified character encoding was UTF-8.

Total execution time 591 milliseconds.
False news grimers ?
Image
......................Imagine, what you will KNOW tomorrow !
Grimers
Posts: 240
Joined: Tue 24 Nov 2015 9:07 am
Weather Station: Davis Vantage Pro2
Operating System: Windows 11 64-bit
Location: Newton Poppleford, Devon, UK
Contact:

Re: Yet Another Dayfile Reader (PHP)

Post by Grimers »

Hehe, sorry I went and validated it and forgot to delete the post. LOL.

Just noticed that the rainfall total for Spring is wrong, it seems to be calculating it 1.0 mm above the actual value.

It shows 123.6 not 122.6.

Image

Thanks!
Grimers
Posts: 240
Joined: Tue 24 Nov 2015 9:07 am
Weather Station: Davis Vantage Pro2
Operating System: Windows 11 64-bit
Location: Newton Poppleford, Devon, UK
Contact:

Re: Yet Another Dayfile Reader (PHP)

Post by Grimers »

beteljuice, have you got anywhere with this issue?
Mapantz
Posts: 1775
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 »

The bug appears in the seasonal part if your dayfile has missing data from it. You have the 26th and 27th of April missing. So, you could fill in the blanks in the dayfile, if you know data for those days, or wait and be hopeful that the beteljuice returns.
Image
User avatar
mcrossley
Posts: 12692
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 »

Hmm, don't think I have any missing data and the current summer total is wrong on mine...
Capture.PNG
I'll take a look this evening...
You do not have the required permissions to view the files attached to this post.
User avatar
PaulMy
Posts: 3775
Joined: Sun 28 Sep 2008 11:54 pm
Weather Station: Davis VP2 Plus 24-Hour FARS
Operating System: Windows8 and Windows10
Location: Komoka, ON Canada
Contact:

Re: Yet Another Dayfile Reader (PHP)

Post by PaulMy »

Mine http://www.komokaweather.com/weather/be ... maryCU.php also shows an extra 1 mm rainfall in Seasonal Summer 2017 (10.6 vs 9.6 actual). The sum for all past seasons' months seems correct.

Paul
Davis Vantage Pro2+
C1 www.komokaweather.com/komokaweather-ca
MX www.komokaweather.com/cumulusmx/index.htm /index.html /index.php
MX www.komokaweather.com/cumulusmxwll/index.htm /index.html /index.php
MX www. komokaweather.com/cumulusmx4/index.htm

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 »

Everyone mentions about this year's rainfall, but that extra one is added to count for heating day, cooling day, wind run, evapotrans, and sunshine -i.e. any accumulating observation - in any season where there is an incomplete (yet non-zero) seasonal sum. Look at Mark's evapotrans for Spring 2013 as another example (80.1 becomes 81.1) or heating days winter 2010 (674 becomes 675). I will leave Mark to spot the ok zero ones!
User avatar
mcrossley
Posts: 12692
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 »

OK, I see why we get the 'extra' 1 on incomplete months - it is the month incomplete flag itself (which equals "true"), true gets equated to "1" when doing an array_sum(). Now to fix it!...

Edit: now fixed in my script, I'll leave it to beteljuice to correct the released script as mine has been modified quite a bit for the released code. beteljuice can view my code to see what I have done - but the gist is to remove the partial flag from the season array and put it in a separate array as is done for the monthly data.
Post Reply