Author Topic: 6.95h PHP 8.3 UV dashboard errors  (Read 2398 times)

0 Members and 1 Guest are viewing this topic.

Offline ALITTLEweird1

  • Mark
  • Global Moderator
  • Forecaster
  • *****
  • Posts: 956
    • North Bend Weather
6.95h PHP 8.3 UV dashboard errors
« on: January 19, 2025, 09:35:47 PM »
Anyone have errors popping up using php 8.3 with the dashboard 6.95H only in the evening hours while using a Davis UV sensor? My mobile dashboard does not show these errors.

Quote
Deprecated: round(): Passing null to parameter #1 ($num) of type int|float is deprecated in /homepages/8/d252567151/htdocs/ajax-dashboard6.php on line 2028

Line 2028...   <?php $VPuv2 = round($UVfcstUVI[$UVptr - $evening], 0);
« Last Edit: January 19, 2025, 10:11:11 PM by ALITTLEweird1 »
"Nature can do without man, but man cannot do without nature."


Software: WeatherDisplay
Hardware: Davis VP2 + VP2 Solar + VP2 UV + Lightning Detector + Reolink Webcam + Soil temp + Soil Moisture

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9697
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: 6.95h PHP 8.3 UV dashboard errors
« Reply #1 on: January 20, 2025, 03:24:48 PM »
It's likely due to having $UVfcstUVI array not filled in by get-UV-forecast-inc.php so it's a 'null' and thus the Deprecated message.

The stock ajax-dashboard6.php does an include for the script, so the values should be filled in, but somehow, in your copy, it's not.

I suggest making a copy of your currently ajax-dashboard6.php and replacing ajax-dashboard6.php with a fresh copy from the legacy 6.95h distribution .. does the error still occur?  If not, then it is likely a mod to ajax-dashboard6.php may be the cause.

If it still happens with the stock ajax-dashboard6.php, let me know and I'll dig deeper.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline ALITTLEweird1

  • Mark
  • Global Moderator
  • Forecaster
  • *****
  • Posts: 956
    • North Bend Weather
Re: 6.95h PHP 8.3 UV dashboard errors
« Reply #2 on: January 20, 2025, 07:04:36 PM »
I just did a fresh install of the dashboard, we'll see if that error comes back tonight.

After that install, I'm now getting this error on my page.

Quote
Warning: Undefined variable $avgmonthsnow1 in /homepages/8/d252567151/htdocs/ajax-dashboard6.php on line 499

Warning: Undefined variable $avgmonthsnow1 in /homepages/8/d252567151/htdocs/ajax-dashboard6.php on line 506

Line 499.... $sndiff = $snowmonthin - $avgmonthsnow1; //calculate difference in snow vs avg, inches

Line 506...  $avgmonthsnow1 = ($avgmonthsnow1 * .3937);  //Removed for version 3 of the ajax script from Ken True (Thanks Tim for the find)

I don't use any snow settings, that's turned off in the config file and I didn't get this error with my other 6.95H dashboard script.

Config file settings...

Quote
$useSNOW   = false;            // Normally always TRUE unless you want TIDE to Display. SNOW & TIDE CANNOT BE BOTH TRUE!!!
                              // Snow will over-ride the lightning section if you have snow on the ground.
$useTIDE   = true;           // Set to True to display TIDE information.
"Nature can do without man, but man cannot do without nature."


Software: WeatherDisplay
Hardware: Davis VP2 + VP2 Solar + VP2 UV + Lightning Detector + Reolink Webcam + Soil temp + Soil Moisture

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9697
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: 6.95h PHP 8.3 UV dashboard errors
« Reply #3 on: January 20, 2025, 07:19:04 PM »
Ahh.. that's caused by
Quote
$avgmonthsno1  = 0;
which should read as
Quote
$avgmonthsnow1  = 0;

That typo has been there for a long time 6.95a at least.. sorry I'd not fixed that in 6.95h.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9697
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: 6.95h PHP 8.3 UV dashboard errors
« Reply #4 on: January 20, 2025, 08:19:01 PM »
Now the UV issue surfaces..  Looking at the view-source of the page shows the get-UV-forecast-inc.php is being invoked, but...
Quote
               <!-- get-UV-forecast-inc.php V1.09 - 12-Feb-2021 -->
<!-- UV forecast courtesy of and Copyright &copy; KNMI/ESA (http://www.temis.nl/). Used with permission. -->
<!-- UV data load from from cache ./cache/uv-forecast.txt -->
<!-- Date='30-Jan-2023', UV='1.3' DOW='Monday' YMD='20230130' -->
<!-- Date='31-Jan-2023', UV='1.4' DOW='Tuesday' YMD='20230131' -->
<!-- Date='01-Feb-2023', UV='1.5' DOW='Wednesday' YMD='20230201' -->
<!-- Date='02-Feb-2023', UV='1.4' DOW='Thursday' YMD='20230202' -->
<!-- Date='03-Feb-2023', UV='1.3' DOW='Friday' YMD='20230203' -->
<!-- Date='04-Feb-2023', UV='1.4' DOW='Saturday' YMD='20230204' -->
<!-- after date=20250120 processing, shifted 6 entries -->
the entries are in the far past (today is 20-Jan-2025) -- I suspect that the cache file /cache/uv-forecast.txt is not writable.. check the permissions and set it to 755 if you can.

I did view-source:https://www.northbendweather.com/?force=1 to reload all caches and saw
Quote
<!-- get-UV-forecast-inc.php V1.09 - 12-Feb-2021 -->
<!-- UV forecast courtesy of and Copyright &copy; KNMI/ESA (http://www.temis.nl/). Used with permission. -->
<!-- curl fetching 'https://www.temis.nl/uvradiation/nrt/uvindex.php?lon=-121.7766&lat=47.4992' -->
<!-- HTTP stats:  RC=200 dest=34.242.175.47 port=443 (from sce=74.208.58.89)
      Times: dns=0.024 conn=0.131 pxfer=0.362 get=0.174 total=0.536 secs -->
<!-- force reload from URL https://www.temis.nl/uvradiation/nrt/uvindex.php?lon=-121.7766&lat=47.4992 -->
<!-- UV data load from from cache ./cache/uv-forecast.txt -->
<!-- Date='20-Jan-2025', UV='1.0' DOW='Monday' YMD='20250120' -->
<!-- Date='21-Jan-2025', UV='1.0' DOW='Tuesday' YMD='20250121' -->
<!-- Date='22-Jan-2025', UV='1.1' DOW='Wednesday' YMD='20250122' -->
<!-- Date='23-Jan-2025', UV='1.1' DOW='Thursday' YMD='20250123' -->
<!-- Date='24-Jan-2025', UV='1.0' DOW='Friday' YMD='20250124' -->
<!-- Date='25-Jan-2025', UV='1.1' DOW='Saturday' YMD='20250125' -->
and the page displays normally.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline ALITTLEweird1

  • Mark
  • Global Moderator
  • Forecaster
  • *****
  • Posts: 956
    • North Bend Weather
Re: 6.95h PHP 8.3 UV dashboard errors
« Reply #5 on: January 20, 2025, 09:27:29 PM »
Now the UV issue surfaces..  Looking at the view-source of the page shows the get-UV-forecast-inc.php is being invoked, but...
Quote
               <!-- get-UV-forecast-inc.php V1.09 - 12-Feb-2021 -->
<!-- UV forecast courtesy of and Copyright &copy; KNMI/ESA (http://www.temis.nl/). Used with permission. -->
<!-- UV data load from from cache ./cache/uv-forecast.txt -->
<!-- Date='30-Jan-2023', UV='1.3' DOW='Monday' YMD='20230130' -->
<!-- Date='31-Jan-2023', UV='1.4' DOW='Tuesday' YMD='20230131' -->
<!-- Date='01-Feb-2023', UV='1.5' DOW='Wednesday' YMD='20230201' -->
<!-- Date='02-Feb-2023', UV='1.4' DOW='Thursday' YMD='20230202' -->
<!-- Date='03-Feb-2023', UV='1.3' DOW='Friday' YMD='20230203' -->
<!-- Date='04-Feb-2023', UV='1.4' DOW='Saturday' YMD='20230204' -->
<!-- after date=20250120 processing, shifted 6 entries -->
the entries are in the far past (today is 20-Jan-2025) -- I suspect that the cache file /cache/uv-forecast.txt is not writable.. check the permissions and set it to 755 if you can.

I did view-source:https://www.northbendweather.com/?force=1 to reload all caches and saw
Quote
<!-- get-UV-forecast-inc.php V1.09 - 12-Feb-2021 -->
<!-- UV forecast courtesy of and Copyright &copy; KNMI/ESA (http://www.temis.nl/). Used with permission. -->
<!-- curl fetching 'https://www.temis.nl/uvradiation/nrt/uvindex.php?lon=-121.7766&lat=47.4992' -->
<!-- HTTP stats:  RC=200 dest=34.242.175.47 port=443 (from sce=74.208.58.89)
      Times: dns=0.024 conn=0.131 pxfer=0.362 get=0.174 total=0.536 secs -->
<!-- force reload from URL https://www.temis.nl/uvradiation/nrt/uvindex.php?lon=-121.7766&lat=47.4992 -->
<!-- UV data load from from cache ./cache/uv-forecast.txt -->
<!-- Date='20-Jan-2025', UV='1.0' DOW='Monday' YMD='20250120' -->
<!-- Date='21-Jan-2025', UV='1.0' DOW='Tuesday' YMD='20250121' -->
<!-- Date='22-Jan-2025', UV='1.1' DOW='Wednesday' YMD='20250122' -->
<!-- Date='23-Jan-2025', UV='1.1' DOW='Thursday' YMD='20250123' -->
<!-- Date='24-Jan-2025', UV='1.0' DOW='Friday' YMD='20250124' -->
<!-- Date='25-Jan-2025', UV='1.1' DOW='Saturday' YMD='20250125' -->
and the page displays normally.

I was just getting ready to message you when i saw the error pop up again. I just changed the uv-forecast.txt file to 755 and ran the check-fetch-times to correct the page. I'll give it some time too see what happens. Thanks Ken.
"Nature can do without man, but man cannot do without nature."


Software: WeatherDisplay
Hardware: Davis VP2 + VP2 Solar + VP2 UV + Lightning Detector + Reolink Webcam + Soil temp + Soil Moisture

Offline ALITTLEweird1

  • Mark
  • Global Moderator
  • Forecaster
  • *****
  • Posts: 956
    • North Bend Weather
Re: 6.95h PHP 8.3 UV dashboard errors
« Reply #6 on: January 20, 2025, 10:05:11 PM »
The error just came up again. Same as my first post. Running check-fetch-times clears it, but them comes back.
"Nature can do without man, but man cannot do without nature."


Software: WeatherDisplay
Hardware: Davis VP2 + VP2 Solar + VP2 UV + Lightning Detector + Reolink Webcam + Soil temp + Soil Moisture

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9697
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: 6.95h PHP 8.3 UV dashboard errors
« Reply #7 on: January 21, 2025, 08:32:46 AM »
Also, your testtags.txt template file seems to be missing
Quote
$highuvyest =  '%highuvyest%';   // Yesterday's high UV
so the message
Quote
Warning: Undefined variable $highuvyest in /homepages/8/d252567151/htdocs/ajax-dashboard6.php on line 2021
appears.

You might try the attached testtags.txt template file .. it does have the complete set to run the ajax-dashboard6
« Last Edit: January 21, 2025, 08:44:33 AM by saratogaWX »
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline ALITTLEweird1

  • Mark
  • Global Moderator
  • Forecaster
  • *****
  • Posts: 956
    • North Bend Weather
Re: 6.95h PHP 8.3 UV dashboard errors
« Reply #8 on: January 21, 2025, 09:36:31 AM »
So strange. I'll get that added after work today. Thanks
"Nature can do without man, but man cannot do without nature."


Software: WeatherDisplay
Hardware: Davis VP2 + VP2 Solar + VP2 UV + Lightning Detector + Reolink Webcam + Soil temp + Soil Moisture

Offline ALITTLEweird1

  • Mark
  • Global Moderator
  • Forecaster
  • *****
  • Posts: 956
    • North Bend Weather
Re: 6.95h PHP 8.3 UV dashboard errors
« Reply #9 on: January 21, 2025, 06:19:16 PM »
Also, your testtags.txt template file seems to be missing
Quote
$highuvyest =  '%highuvyest%';   // Yesterday's high UV
so the message
Quote
Warning: Undefined variable $highuvyest in /homepages/8/d252567151/htdocs/ajax-dashboard6.php on line 2021
appears.

You might try the attached testtags.txt template file .. it does have the complete set to run the ajax-dashboard6

Just got that fixed. Now I just wait till sunset to see if that fixed the issue.
"Nature can do without man, but man cannot do without nature."


Software: WeatherDisplay
Hardware: Davis VP2 + VP2 Solar + VP2 UV + Lightning Detector + Reolink Webcam + Soil temp + Soil Moisture

Offline ALITTLEweird1

  • Mark
  • Global Moderator
  • Forecaster
  • *****
  • Posts: 956
    • North Bend Weather
Re: 6.95h PHP 8.3 UV dashboard errors
« Reply #10 on: January 21, 2025, 08:10:32 PM »
The error came back.

Quote
Warning: Undefined array key 0 in /homepages/8/d252567151/htdocs/ajax-dashboard6.php on line 2029

Deprecated: round(): Passing null to parameter #1 ($num) of type int|float is deprecated in /homepages/8/d252567151/htdocs/ajax-dashboard6.php on line 2029

Line 2029... <?php $VPuv2 = round($UVfcstUVI[$UVptr - $evening], 0);

Lines 2043 and 2057 are the same as 2029.
"Nature can do without man, but man cannot do without nature."


Software: WeatherDisplay
Hardware: Davis VP2 + VP2 Solar + VP2 UV + Lightning Detector + Reolink Webcam + Soil temp + Soil Moisture

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9697
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: 6.95h PHP 8.3 UV dashboard errors
« Reply #11 on: January 22, 2025, 06:41:02 AM »
Yep.. same issue as before.  The ./cache/uv-forecast.txt contains a forecast from 2023
Quote
<!-- get-UV-forecast-inc.php V1.09 - 12-Feb-2021 -->
<!-- UV forecast courtesy of and Copyright &copy; KNMI/ESA (http://www.temis.nl/). Used with permission. -->
<!-- UV data load from from cache ./cache/uv-forecast.txt -->
<!-- Date='30-Jan-2023', UV='1.3' DOW='Monday' YMD='20230130' -->
<!-- Date='31-Jan-2023', UV='1.4' DOW='Tuesday' YMD='20230131' -->
<!-- Date='01-Feb-2023', UV='1.5' DOW='Wednesday' YMD='20230201' -->
<!-- Date='02-Feb-2023', UV='1.4' DOW='Thursday' YMD='20230202' -->
<!-- Date='03-Feb-2023', UV='1.3' DOW='Friday' YMD='20230203' -->
<!-- Date='04-Feb-2023', UV='1.4' DOW='Saturday' YMD='20230204' -->
<!-- after date=20250122 processing, shifted 6 entries -->
when that error shows.

Somehow, the ./cache/uv-forecast.txt is getting clobbered with old data.  The get-UV-forecast-inc.php script is being loaded, it's just the old data is being rolled off, and the $UVfcstUVI array is left with nulls for the data.

Do you have any cron jobs running that might copy that file from an old version of the cache file?

Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline ALITTLEweird1

  • Mark
  • Global Moderator
  • Forecaster
  • *****
  • Posts: 956
    • North Bend Weather
Re: 6.95h PHP 8.3 UV dashboard errors
« Reply #12 on: January 22, 2025, 11:18:06 AM »
I don't have a cron running that. Maybe I can try creating a new cache file too see if that does anything.
"Nature can do without man, but man cannot do without nature."


Software: WeatherDisplay
Hardware: Davis VP2 + VP2 Solar + VP2 UV + Lightning Detector + Reolink Webcam + Soil temp + Soil Moisture

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9697
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: 6.95h PHP 8.3 UV dashboard errors
« Reply #13 on: January 22, 2025, 04:22:59 PM »
Check the Weather-Display settings.. maybe you are uploading an old ./cache/uv-forecast.php from 2023.
I note that the get-UV-forecast-inc.php script always has both headers and contents of the fetch from the temis.nl site.

The 2023 version only has contents (no headers) so it is not coming from the script -- its coming from another source (maybe Weather-Display download and upload file?).
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline ALITTLEweird1

  • Mark
  • Global Moderator
  • Forecaster
  • *****
  • Posts: 956
    • North Bend Weather
Re: 6.95h PHP 8.3 UV dashboard errors
« Reply #14 on: January 22, 2025, 05:31:00 PM »
I did find the cache file in my website cache folder and it is wrong. I was under the impression that the script itself created the cache file for the UV forecast and not WD.
"Nature can do without man, but man cannot do without nature."


Software: WeatherDisplay
Hardware: Davis VP2 + VP2 Solar + VP2 UV + Lightning Detector + Reolink Webcam + Soil temp + Soil Moisture

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9697
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: 6.95h PHP 8.3 UV dashboard errors
« Reply #15 on: January 22, 2025, 05:47:59 PM »
Yes, the get-UV-forecast-inc.php script DOES do an auto-refresh from temis.org, but...
only when the cache file is missing, or older than 1 hour (3600 seconds)

Something else is uploading the 2023 file to your site, and when it does, it will take an hour to have the script refresh the cache with current data.

Check in WD, Control Panel, FTP&Connections, HTTP download TAB if there is anything with Remote File of './cache/uv-forecast.txt'
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline ALITTLEweird1

  • Mark
  • Global Moderator
  • Forecaster
  • *****
  • Posts: 956
    • North Bend Weather
Re: 6.95h PHP 8.3 UV dashboard errors
« Reply #16 on: January 22, 2025, 06:11:47 PM »
Yes, the get-UV-forecast-inc.php script DOES do an auto-refresh from temis.org, but...
only when the cache file is missing, or older than 1 hour (3600 seconds)

Something else is uploading the 2023 file to your site, and when it does, it will take an hour to have the script refresh the cache with current data.

Check in WD, Control Panel, FTP&Connections, HTTP download TAB if there is anything with Remote File of './cache/uv-forecast.txt'

There's nothing in there that has an UV stuff. I did find in the WD downloads folder a uv-forecast.txt file with Jan and Feb with the year of 2023. But I don't know where that's coming from or what's creating it. It's been so long since I had to mess with that. Also, the date on the file in 1-30-23
"Nature can do without man, but man cannot do without nature."


Software: WeatherDisplay
Hardware: Davis VP2 + VP2 Solar + VP2 UV + Lightning Detector + Reolink Webcam + Soil temp + Soil Moisture

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9697
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: 6.95h PHP 8.3 UV dashboard errors
« Reply #17 on: January 22, 2025, 06:15:38 PM »
That date matches the problem file date.

I'd suggest deleting that file, and look in WD, Control Panel, Web Files/Web Page Setup, Custom Web Page TAB
and see if the uv-forecast.txt file is listed.. if so, delete the entry.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline ALITTLEweird1

  • Mark
  • Global Moderator
  • Forecaster
  • *****
  • Posts: 956
    • North Bend Weather
Re: 6.95h PHP 8.3 UV dashboard errors
« Reply #18 on: January 22, 2025, 06:22:58 PM »
There was no uv-forecast.txt in the custom webpage tab. I deleted that .txt file in the downloads folder and just restarted WD.
"Nature can do without man, but man cannot do without nature."


Software: WeatherDisplay
Hardware: Davis VP2 + VP2 Solar + VP2 UV + Lightning Detector + Reolink Webcam + Soil temp + Soil Moisture

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9697
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: 6.95h PHP 8.3 UV dashboard errors
« Reply #19 on: January 23, 2025, 10:44:30 AM »
Looks like the deletion of the rogue uv-forecast.txt has fixed the issue.  The get-UV-forecast-inc.php is calmly doing the refresh from temis.org and no warning messages on your dashboard this early and later morning.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline ALITTLEweird1

  • Mark
  • Global Moderator
  • Forecaster
  • *****
  • Posts: 956
    • North Bend Weather
Re: 6.95h PHP 8.3 UV dashboard errors
« Reply #20 on: January 23, 2025, 11:39:04 AM »
Everything is looking good. Just strange to me how all this happened when everything was working fine till I upgraded to 8.3

Anyways, thanks for all your help Ken.
"Nature can do without man, but man cannot do without nature."


Software: WeatherDisplay
Hardware: Davis VP2 + VP2 Solar + VP2 UV + Lightning Detector + Reolink Webcam + Soil temp + Soil Moisture

 

anything