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

nossis
Posts: 89
Joined: Wed 28 Nov 2012 6:12 am
Weather Station: Davis Vantage Pro 2
Operating System: Win 10
Location: Perth AU
Contact:

Re: Yet Another Dayfile Reader (PHP)

Post by nossis »

Hi westonweather,

That would make sense. Sorry to say, but it has me beat.
What I have done in these circumstances in the past is started again. Maybe?
I am off to bed now, tis a bit late here.
User avatar
steve
Cumulus Author
Posts: 26702
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: Yet Another Dayfile Reader (PHP)

Post by steve »

Those funny characters look like the UTF-8 byte order marks, so I think you have an encoding problem. Did you heed the instructions "ALL files should be edited / saved as UTF-8 no BOM"?

I hope I'm not confusing things, I keep dipping into this thread, but I haven't read all the posts :oops:
Steve
westonweather
Posts: 166
Joined: Sun 29 Dec 2013 8:37 am
Weather Station: WMR88
Operating System: Windows 7
Location: Weston-super-Mare
Contact:

Re: Yet Another Dayfile Reader (PHP)

Post by westonweather »

steve wrote:Those funny characters look like the UTF-8 byte order marks, so I think you have an encoding problem. Did you heed the instructions "ALL files should be edited / saved as UTF-8 no BOM"?

I hope I'm not confusing things, I keep dipping into this thread, but I haven't read all the posts :oops:
Hi Steve, I did read / do that. I just tried rebooting the server too. No change. Going to try nossis suggestion and delete / re-install all files.
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 »

@ westonweather

According to 'inspectors' betel_readDayfile.php is only 6B (6 bytes !)
Image
......................Imagine, what you will KNOW tomorrow !
westonweather
Posts: 166
Joined: Sun 29 Dec 2013 8:37 am
Weather Station: WMR88
Operating System: Windows 7
Location: Weston-super-Mare
Contact:

Re: Yet Another Dayfile Reader (PHP)

Post by westonweather »

beteljuice wrote:@ westonweather

According to 'inspectors' betel_readDayfile.php is only 6B (6 bytes !)
It's something the server is doing. I just FTP'd the files directly from westonweather.co.uk to my other server http://www.andyworth.co.uk/basic.php and it nearly works, excepting for the error message "Warning: array_sum() [function.array-sum]: The argument should be an array in /home/andywort/public_html/betel_readDayfile.php on line 856"

So, for some reason it's not compatible with the server that runs www.westonweather.co.uk which is odd as everything else on there works ok. Strange!

Any ideas about the error message?
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 »

As Steve said are you saving your files as "UTF-8 without BOM" prior to you uploading as this is very important.
David
Image
westonweather
Posts: 166
Joined: Sun 29 Dec 2013 8:37 am
Weather Station: WMR88
Operating System: Windows 7
Location: Weston-super-Mare
Contact:

Re: Yet Another Dayfile Reader (PHP)

Post by westonweather »

water01 wrote:As Steve said are you saving your files as "UTF-8 without BOM" prior to you uploading as this is very important.
Yes, I downloaded Notepad++ to be sure. All files are definitely encoded correctly.

It's essentially working on www.andyworth.co.uk/basic.php excepting the error that comes up.
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 »

Since these are warnings only how about changing

Code: Select all

error_reporting(E_ALL ^ E_NOTICE);    
to

Code: Select all

error_reporting(0);  
as this will stop it throwing errors on warnings.

Will have to look up what version of PHP would cause that warning but it could be that your hosting service is not running an up-to-date version as I don't get the warning.

EDIT: the array_sum function is only available in the last release of Version 4 (4.0.4) and Version 5.0 onwards, is it possible your hosting service is running an old version of PHP?

The way to check is to run phpinfo and that will tell you the version.
Last edited by water01 on Fri 14 Feb 2014 8:17 pm, edited 1 time in total.
David
Image
westonweather
Posts: 166
Joined: Sun 29 Dec 2013 8:37 am
Weather Station: WMR88
Operating System: Windows 7
Location: Weston-super-Mare
Contact:

Re: Yet Another Dayfile Reader (PHP)

Post by westonweather »

water01 wrote:Since these are warnings only how about changing

Code: Select all

error_reporting(E_ALL ^ E_NOTICE);    
to

Code: Select all

error_reporting(0);  
as this will stop it throwing errors on warnings.

Will have to look up what version of PHP would cause that warning but it could be that your hosting service is not running an up-to-date version as I don't get the warning.
I changed it and that's shut it up. I love the script. It really does work very well for archive records. Saves a manual process that I have been doing every day this year so far!

Hmm, to move the entire website to the server that runs this or not, that is the question...
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 »

@ westonweather

I was trying to see what was happening on your site(s) but you have removed all the files.

What I think has happened is a bit of a double whammy.

Your weather site host is running php v5.2, although not explicitly documented it seems that it doesn't understand the error_report() directives given.

This seems to result in a 'blank' output if it finds anything it thinks it should be reporting.

The report you got off your other server is a simple advisory that should have been suppressed - but I should have found the 'problem' in the first place !

You wouldn't believe the headache I had coding for twitch level :bash:

It looks like I missed at least one (there may be more) when a user has less than one years data !!

Please try new release v1.4.5 - but you will probably have to set error_reporting(0) or try removing it completely !
Image
......................Imagine, what you will KNOW tomorrow !
mikkimii
Posts: 42
Joined: Fri 23 Mar 2012 3:17 pm
Weather Station: Davis VP2
Operating System: Windows 7 x64 Pro
Location: Vilppula, Finland

Re: Yet Another Dayfile Reader (PHP)

Post by mikkimii »

KarlS wrote:I can assure you there is a huge difference between -20°C (cold), -30°C (bloody cold) and -40°C (dangerously cold)
I can confirm this ;)

Thanks beteljuice :clap:
Br,
Mika
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 »

@ ALL

The beteljuice has discovered that there is no standard to temperature colour keys (surprise, surprise)
Further, various countries / organisations have different colour ranges in different orders and many of them 'stretch' a particular range to suit.

As has been noted earlier by others, cold countries 'lose out', with one colour band representing large jumps in temperature.

Here is an example of what's about >http://wattsupwiththat.com/2008/06/26/c ... verything/<

Some use white, some don't. It may be around zero or it may be around 50C, then there is what colour do you use in 'comfortable' area. Some use yellow, some use green.

I found a chart I liked, then when looking for where the 'comfort' range would be I realised they were one of the very few that didn't use green !

I'll think about it, unless someone comes up with a presentable solution for say -50C > 50C ( or -45ish > 45ish)
Image
......................Imagine, what you will KNOW tomorrow !
westonweather
Posts: 166
Joined: Sun 29 Dec 2013 8:37 am
Weather Station: WMR88
Operating System: Windows 7
Location: Weston-super-Mare
Contact:

Re: Yet Another Dayfile Reader (PHP)

Post by westonweather »

beteljuice wrote:@ westonweather

I was trying to see what was happening on your site(s) but you have removed all the files.

What I think has happened is a bit of a double whammy.

Your weather site host is running php v5.2, although not explicitly documented it seems that it doesn't understand the error_report() directives given.

This seems to result in a 'blank' output if it finds anything it thinks it should be reporting.

The report you got off your other server is a simple advisory that should have been suppressed - but I should have found the 'problem' in the first place !

You wouldn't believe the headache I had coding for twitch level :bash:

It looks like I missed at least one (there may be more) when a user has less than one years data !!

Please try new release v1.4.5 - but you will probably have to set error_reporting(0) or try removing it completely !
Thanks for looking at this. I installed the new version (all files set to UTF8 no BOM) and actually commented out the error checking command, however http://www.westonweather.co.uk server still gives a blank page, same files installed on http://www.andyworth.co.uk/basic.php work fine.

I'm pretty certain now that it is the old version of PHP (5.2.1) which is the issue and as I'm the host I'll have to try and sort it. It's an odd "busybox" based Linux box that is no longer supported, so this may be an issue; in which case I'll either set up a Windows Apache server with PHP or move to the "paid for" andyworth server, which is something I am trying to avoid doing.
westonweather
Posts: 166
Joined: Sun 29 Dec 2013 8:37 am
Weather Station: WMR88
Operating System: Windows 7
Location: Weston-super-Mare
Contact:

Re: Yet Another Dayfile Reader (PHP)

Post by westonweather »

Probably also worth pointing out that on www.andyworth.co.uk/basic.php "May" is blank in all cases. Is that something that will "fix" itself once I have data for May? All the other months have 0.0 in the boxes.
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 »

Interesting ....

I can't decide ATM whether May is the exception or all the other 0.0 months :lol:

I shall be 'borrowing' your dayfile.txt for testing purposes if that's alright ?
Image
......................Imagine, what you will KNOW tomorrow !
Post Reply