Page 58 of 59

Re: Yet Another Dayfile Reader (PHP)

Posted: Sun 11 Aug 2024 10:16 am
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.

Re: Yet Another Dayfile Reader (PHP)

Posted: Sun 11 Aug 2024 10:58 am
by AndyKF650
hi there

Glad to help out, yes my solar cells were added well after the rest of the weather sensors.

Re: Yet Another Dayfile Reader (PHP)

Posted: Sun 20 Oct 2024 4:03 am
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..

Re: Yet Another Dayfile Reader (PHP)

Posted: Sun 20 Oct 2024 7:10 am
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 *********************************************************************************************************

Re: Yet Another Dayfile Reader (PHP)

Posted: Sun 20 Oct 2024 11:36 am
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

Re: Yet Another Dayfile Reader (PHP)

Posted: Sun 20 Oct 2024 1:21 pm
by Mrc
Thank you! Now it works and everything is fine! :D

Re: Yet Another Dayfile Reader (PHP)

Posted: Tue 21 Jan 2025 1:38 pm
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

Re: Yet Another Dayfile Reader (PHP)

Posted: Tue 21 Jan 2025 1:53 pm
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.

Re: Yet Another Dayfile Reader (PHP)

Posted: Tue 21 Jan 2025 7:25 pm
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.

Re: Yet Another Dayfile Reader (PHP)

Posted: Wed 22 Jan 2025 8:10 am
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

Re: Yet Another Dayfile Reader (PHP)

Posted: Wed 22 Jan 2025 9:31 am
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

Re: Yet Another Dayfile Reader (PHP)

Posted: Wed 22 Jan 2025 10:23 am
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.

Re: Yet Another Dayfile Reader (PHP)

Posted: Tue 28 Jan 2025 10:39 am
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

Re: Yet Another Dayfile Reader (PHP)

Posted: Tue 28 Jan 2025 2:46 pm
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

Re: Yet Another Dayfile Reader (PHP)

Posted: Tue 28 Jan 2025 11:18 pm
by JennyLeez
Ok thx David.
I will use that one :)