If you use Cumulus, please donate Image

Please read this post before posting

Latest Cumulus release v1.9.4 (build 1099) - Nov 28 2014
Latest Cumulus MX release - v3.0.0 build 3043 Jan 20 2017. See this post for download

Yet Another Dayfile Reader (PHP)

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

Moderators: daj, TNETWeather

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

Re: Yet Another Dayfile Reader (PHP)

Postby BCJKiwi » Sun Apr 16, 2017 9:43 pm

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: 2451
Joined: Tue Dec 09, 2008 1:37 pm
Weather Station: None !
Operating System: XP SP3 - honest
Location: Dudley, West Midlands, UK

Re: Yet Another Dayfile Reader (PHP)

Postby beteljuice » Tue Apr 18, 2017 9:29 pm

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: 100
Joined: Sat Aug 27, 2016 12:11 am
Weather Station: Davis vantage pro 2
Operating System: Debian
Location: Youngstown, Ohio
Contact:

Re: Yet Another Dayfile Reader (PHP)

Postby jlmr731 » Tue Apr 18, 2017 10:36 pm

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: 2451
Joined: Tue Dec 09, 2008 1:37 pm
Weather Station: None !
Operating System: XP SP3 - honest
Location: Dudley, West Midlands, UK

Re: Yet Another Dayfile Reader (PHP)

Postby beteljuice » Tue Apr 18, 2017 11:20 pm

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: 100
Joined: Sat Aug 27, 2016 12:11 am
Weather Station: Davis vantage pro 2
Operating System: Debian
Location: Youngstown, Ohio
Contact:

Re: Yet Another Dayfile Reader (PHP)

Postby jlmr731 » Wed Apr 19, 2017 2:08 am

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: 4932
Joined: Thu Jan 07, 2010 9:44 pm
Weather Station: Davis VP2
Operating System: Jessie Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Yet Another Dayfile Reader (PHP)

Postby mcrossley » Thu Apr 20, 2017 9:23 am

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.

User avatar
Grimers
Posts: 187
Joined: Tue Nov 24, 2015 9:07 am
Weather Station: Davis Vantage Pro2
Operating System: Windows 10 64-bit
Location: Newton Poppleford, Devon, UK
Contact:

Re: Yet Another Dayfile Reader (PHP)

Postby Grimers » Thu Jun 01, 2017 10:26 am

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
William Grimsley.

User avatar
beteljuice
Posts: 2451
Joined: Tue Dec 09, 2008 1:37 pm
Weather Station: None !
Operating System: XP SP3 - honest
Location: Dudley, West Midlands, UK

Re: Yet Another Dayfile Reader (PHP)

Postby beteljuice » Thu Jun 01, 2017 3:53 pm

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 !

User avatar
Grimers
Posts: 187
Joined: Tue Nov 24, 2015 9:07 am
Weather Station: Davis Vantage Pro2
Operating System: Windows 10 64-bit
Location: Newton Poppleford, Devon, UK
Contact:

Re: Yet Another Dayfile Reader (PHP)

Postby Grimers » Fri Jun 02, 2017 9:12 pm

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!
William Grimsley.

User avatar
Grimers
Posts: 187
Joined: Tue Nov 24, 2015 9:07 am
Weather Station: Davis Vantage Pro2
Operating System: Windows 10 64-bit
Location: Newton Poppleford, Devon, UK
Contact:

Re: Yet Another Dayfile Reader (PHP)

Postby Grimers » Tue Jun 06, 2017 7:54 am

beteljuice, have you got anywhere with this issue?
William Grimsley.

User avatar
Mapantz
Posts: 430
Joined: Sat Dec 17, 2011 11:55 am
Weather Station: Davis Vantage Pro2
Operating System: Windows 10 x64 - A beast.
Location: Wareham, Dorset - UK

Re: Yet Another Dayfile Reader (PHP)

Postby Mapantz » Tue Jun 06, 2017 2:07 pm

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
Image

User avatar
mcrossley
Posts: 4932
Joined: Thu Jan 07, 2010 9:44 pm
Weather Station: Davis VP2
Operating System: Jessie Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Yet Another Dayfile Reader (PHP)

Postby mcrossley » Tue Jun 06, 2017 3:17 pm

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: 1502
Joined: Sun Sep 28, 2008 11:54 pm
Weather Station: Davis Vantage Pro 2 w/Envoy USB
Operating System: Windows-8
Location: Komoka, ON Canada
Contact:

Re: Yet Another Dayfile Reader (PHP)

Postby PaulMy » Tue Jun 06, 2017 4:24 pm

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

sfws
Posts: 312
Joined: Fri Jul 27, 2012 11:29 am
Weather Station: Mixed manufacturers
Operating System: off-line W10 pc
Location: UK

Re: Yet Another Dayfile Reader (PHP)

Postby sfws » Tue Jun 06, 2017 4:32 pm

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: 4932
Joined: Thu Jan 07, 2010 9:44 pm
Weather Station: Davis VP2
Operating System: Jessie Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Yet Another Dayfile Reader (PHP)

Postby mcrossley » Tue Jun 06, 2017 5:30 pm

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.


Return to “Web site - General”

Who is online

Users browsing this forum: No registered users and 5 guests