Author Topic: AQI Error  (Read 464 times)

0 Members and 1 Guest are viewing this topic.

Offline scottct1

  • Senior Member
  • **
  • Posts: 57
    • Newington, CT Weather
AQI Error
« on: March 13, 2024, 02:40:02 PM »
All my scripts are up to date... but just started getting this error.  Not sure what it means.  https://www.newingtonweather.com

Code: [Select]
Warning: DOMDocument::load(): Opening and ending tag mismatch: meta line 27 and head in http://feeds.enviroflash.info/rss/realtime/134.xml, line: 28 in /home/weather/public_html/get-aqi-rss.php on line 37

Warning: DOMDocument::load(): attributes construct error in http://feeds.enviroflash.info/rss/realtime/134.xml, line: 33 in /home/weather/public_html/get-aqi-rss.php on line 37

Warning: DOMDocument::load(): Couldn't find end of Start Tag script line 33 in http://feeds.enviroflash.info/rss/realtime/134.xml, line: 33 in /home/weather/public_html/get-aqi-rss.php on line 37

Warning: DOMDocument::load(): StartTag: invalid element name in http://feeds.enviroflash.info/rss/realtime/134.xml, line: 38 in /home/weather/public_html/get-aqi-rss.php on line 37

Warning: DOMDocument::load(): Opening and ending tag mismatch: meta line 25 and html in http://feeds.enviroflash.info/rss/realtime/134.xml, line: 42 in /home/weather/public_html/get-aqi-rss.php on line 37

Warning: DOMDocument::load(): Premature end of data in tag meta line 24 in http://feeds.enviroflash.info/rss/realtime/134.xml, line: 42 in /home/weather/public_html/get-aqi-rss.php on line 37

Warning: DOMDocument::load(): Premature end of data in tag meta line 23 in http://feeds.enviroflash.info/rss/realtime/134.xml, line: 42 in /home/weather/public_html/get-aqi-rss.php on line 37

Warning: DOMDocument::load(): Premature end of data in tag meta line 4 in http://feeds.enviroflash.info/rss/realtime/134.xml, line: 42 in /home/weather/public_html/get-aqi-rss.php on line 37

Warning: DOMDocument::load(): Premature end of data in tag head line 3 in http://feeds.enviroflash.info/rss/realtime/134.xml, line: 42 in /home/weather/public_html/get-aqi-rss.php on line 37

Warning: DOMDocument::load(): Premature end of data in tag html line 2 in http://feeds.enviroflash.info/rss/realtime/134.xml, line: 42 in /home/weather/public_html/get-aqi-rss.php on line 37

Warning: Undefined array key 0 in /home/weather/public_html/get-aqi-rss.php on line 48

Warning: Trying to access array offset on value of type null in /home/weather/public_html/get-aqi-rss.php on line 48

Deprecated: preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated in /home/weather/public_html/get-aqi-rss.php on line 48

Warning: Undefined array key 0 in /home/weather/public_html/get-aqi-rss.php on line 58

Warning: Trying to access array offset on value of type null in /home/weather/public_html/get-aqi-rss.php on line 58

Deprecated: preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated in /home/weather/public_html/get-aqi-rss.php on line 58

Warning: Undefined array key 0 in /home/weather/public_html/get-aqi-rss.php on line 72

Warning: Trying to access array offset on value of type null in /home/weather/public_html/get-aqi-rss.php on line 72

Deprecated: preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated in /home/weather/public_html/get-aqi-rss.php on line 72

Any ideas?
Scott - NewingtonWeather.COM - Newington, Connecticut's Weather Source!
Davis Vantage Pro 2 Plus - WeatherFlow Tempest for Lightning - Weather-Display Software

Offline scottct1

  • Senior Member
  • **
  • Posts: 57
    • Newington, CT Weather
Re: AQI Error
« Reply #1 on: March 13, 2024, 02:53:40 PM »
Looks like it was an issue with enviroflash as it has cleared up on its own. :)
Scott - NewingtonWeather.COM - Newington, Connecticut's Weather Source!
Davis Vantage Pro 2 Plus - WeatherFlow Tempest for Lightning - Weather-Display Software

Offline scottct1

  • Senior Member
  • **
  • Posts: 57
    • Newington, CT Weather
Re: AQI Error
« Reply #2 on: March 13, 2024, 03:05:07 PM »
And its happening again.  ](*,)
Scott - NewingtonWeather.COM - Newington, Connecticut's Weather Source!
Davis Vantage Pro 2 Plus - WeatherFlow Tempest for Lightning - Weather-Display Software

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9298
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: AQI Error
« Reply #3 on: March 13, 2024, 03:26:03 PM »
I think it is two issues:
1) your webserver is having problems with curl/file-streams to connect to external websites for data.  Running check-fetch-times.php?show=versions shows it is unable to contact my server for version updates (so is using a cached copy of the data file).
looking at a view-source of wxforecast,php shows
Quote
<!-- point forecastURL = 'https://api.weather.gov/gridpoints/BOX/21,50/forecast' -->
<!-- zone  forecastURL = 'https://api.weather.gov/zones/forecast/CTZ002/forecast' -->
<!-- logged 'Fetch fail' to './cache/advforecast2-log-2024-03-13.txt' -->
<!-- curl fetching 'https://api.weather.gov/gridpoints/BOX/21,50/forecast' -->
<!-- curl Error: Operation timed out after 6005 milliseconds with 0 bytes received -->
<!-- HTTP stats:  RC=0 dest=23.54.40.16 port=443 (from sce=144.126.131.153)
      Times: dns=0.010 conn=0.017 pxfer=0.051 get=5.955 total=6.006 secs -->
and a view-source of wxadvisory.php shows
Quote
<!-- nws-alerts noCron=true .. running nws-alerts.php inline -->
<!-- nws-alerts.php - V2.00 - 30-Jan-2024 -->
<!-- 2 unique Zone entries found. Zones='CTZ002,CTC0035' -->
<!-- cache age 484 seconds - no fetch needed -->
<!-- manual update of cache requested -->
<!-- Cron job not used -->

<!-- 3:19:03 -->
<!-- Error: Resolving timed out after 2001 milliseconds -->
<!-- Source: https://api.weather.gov/alerts/active.atom?zone=CTZ002 -->
<!-- non XML source: https://api.weather.gov/alerts/active.atom?zone=CTZ002 -->
<!-- HTTP stats:  RC=0 dest= port=0 (from sce=)
      Times: dns=0.000 conn=0.000 pxfer=0.000 get=5.029 total=5.029 secs -->
<!-- header type='' -->
<!-- 1st attempt in getting CTZ002 preliminary URL failed -->

<!-- 3:19:09 -->
<!-- Error: Resolving timed out after 2000 milliseconds -->
<!-- Source: https://api.weather.gov/alerts/active.atom?zone=CTZ002 -->
<!-- non XML source: https://api.weather.gov/alerts/active.atom?zone=CTZ002 -->
<!-- HTTP stats:  RC=0 dest= port=0 (from sce=)
      Times: dns=0.000 conn=0.000 pxfer=0.000 get=15.035 total=15.035 secs -->
<!-- header type='' -->
<!-- 2nd attempt failed & skipped CTZ002  -->

<!-- $zSearch no entry found - generated 'no alert' entry -->

<!-- 3:19:24 -->
<!-- Error: Resolving timed out after 2000 milliseconds -->
<!-- Source: https://api.weather.gov/alerts/active.atom?zone=CTC003 -->
<!-- non XML source: https://api.weather.gov/alerts/active.atom?zone=CTC003 -->
<!-- HTTP stats:  RC=0 dest= port=0 (from sce=)
      Times: dns=0.000 conn=0.000 pxfer=0.000 get=10.080 total=10.080 secs -->
<!-- header type='' -->
<!-- 1st attempt in getting CTC003 preliminary URL failed -->
<!-- XML source: https://api.weather.gov/alerts/active.atom?zone=CTC003 -->
<!-- HTTP stats:  RC=200 dest=23.54.40.16 port=443 (from sce=144.126.131.153)
      Times: dns=0.010 conn=0.020 pxfer=0.039 get=0.166 total=0.205 secs -->
<!-- header type='application/atom+xml' -->
<!-- 2nd attempt CTC003 successful -->

<!-- $zSearch no entry found - generated 'no alert' entry -->
<!-- NO cache files updated -->
<!-- Total process time: 32.3590 seconds -->
which is WAAAAY to long.  Something is wrong with your webserver's connectivity to api.weather.gov .. that needs to be fixed by your website hoster's tech support.

2) in get-aqi-rss.php you have
Quote
$urlRealtime = "http://feeds.enviroflash.info/rss/realtime/134.xml";  //San Jose, CA - Current Air Quality
which gets the AQI from my local AQ district in San Jose, CA -- you'll need to find a different feed for your location.
It's failing due to the connectivity issues I cited above, but even when connected, it will display my (not your) AQI until you change that setting
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 scottct1

  • Senior Member
  • **
  • Posts: 57
    • Newington, CT Weather
Re: AQI Error
« Reply #4 on: March 13, 2024, 04:05:02 PM »
Interesting...

I am starting to think its a DNS issue with the servers resolver. 

I just tried doing some simple digs, and 3 out of 5 failed.  I will alert the ISP since the DNS servers are theirs.

Also nice catch Ken on the wrong area, I will take care of that too.  :)

Thanks!
Scott - NewingtonWeather.COM - Newington, Connecticut's Weather Source!
Davis Vantage Pro 2 Plus - WeatherFlow Tempest for Lightning - Weather-Display Software

Offline scottct1

  • Senior Member
  • **
  • Posts: 57
    • Newington, CT Weather
Re: AQI Error
« Reply #5 on: March 13, 2024, 07:33:34 PM »
Ok the ISP had me change my resolver on the server to new servers.

So check-fetch-times.php?show=versions is loading fine now.

wxadvisory.php is showing <!-- Total process time: 0.0001 seconds --> so that looks better.

I changed get-aqi-rss.php  from 134 to https://feeds.enviroflash.info/rss/realtime/56.xml for Hartford, CT.

Everything was working good for a few hours and now getting a new batch of errors.

Code: [Select]
Warning: DOMDocument::load(): Opening and ending tag mismatch: meta line 27 and head in http://feeds.enviroflash.info/rss/realtime/56.xml, line: 28 in /home/weather/public_html/get-aqi-rss.php on line 37

Warning: DOMDocument::load(): attributes construct error in http://feeds.enviroflash.info/rss/realtime/56.xml, line: 33 in /home/weather/public_html/get-aqi-rss.php on line 37

Warning: DOMDocument::load(): Couldn't find end of Start Tag script line 33 in http://feeds.enviroflash.info/rss/realtime/56.xml, line: 33 in /home/weather/public_html/get-aqi-rss.php on line 37

Warning: DOMDocument::load(): StartTag: invalid element name in http://feeds.enviroflash.info/rss/realtime/56.xml, line: 38 in /home/weather/public_html/get-aqi-rss.php on line 37

Warning: DOMDocument::load(): Opening and ending tag mismatch: meta line 25 and html in http://feeds.enviroflash.info/rss/realtime/56.xml, line: 42 in /home/weather/public_html/get-aqi-rss.php on line 37

Warning: DOMDocument::load(): Premature end of data in tag meta line 24 in http://feeds.enviroflash.info/rss/realtime/56.xml, line: 42 in /home/weather/public_html/get-aqi-rss.php on line 37

Warning: DOMDocument::load(): Premature end of data in tag meta line 23 in http://feeds.enviroflash.info/rss/realtime/56.xml, line: 42 in /home/weather/public_html/get-aqi-rss.php on line 37

Warning: DOMDocument::load(): Premature end of data in tag meta line 4 in http://feeds.enviroflash.info/rss/realtime/56.xml, line: 42 in /home/weather/public_html/get-aqi-rss.php on line 37

Warning: DOMDocument::load(): Premature end of data in tag head line 3 in http://feeds.enviroflash.info/rss/realtime/56.xml, line: 42 in /home/weather/public_html/get-aqi-rss.php on line 37

Warning: DOMDocument::load(): Premature end of data in tag html line 2 in http://feeds.enviroflash.info/rss/realtime/56.xml, line: 42 in /home/weather/public_html/get-aqi-rss.php on line 37

Warning: Undefined array key 0 in /home/weather/public_html/get-aqi-rss.php on line 48

Warning: Trying to access array offset on value of type null in /home/weather/public_html/get-aqi-rss.php on line 48

Deprecated: preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated in /home/weather/public_html/get-aqi-rss.php on line 48

Warning: Undefined array key 0 in /home/weather/public_html/get-aqi-rss.php on line 58

Warning: Trying to access array offset on value of type null in /home/weather/public_html/get-aqi-rss.php on line 58

Deprecated: preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated in /home/weather/public_html/get-aqi-rss.php on line 58

Warning: Undefined array key 0 in /home/weather/public_html/get-aqi-rss.php on line 72

Warning: Trying to access array offset on value of type null in /home/weather/public_html/get-aqi-rss.php on line 72

Deprecated: preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated in /home/weather/public_html/get-aqi-rss.php on line 72

And now these as well...

Code: [Select]
Warning: Undefined array key 0 in /home/weather/public_html/ajax-dashboard6.php on line 2028

Deprecated: round(): Passing null to parameter #1 ($num) of type int|float is deprecated in /home/weather/public_html/ajax-dashboard6.php on line 2028
Mar-14


Warning: Undefined array key 0 in /home/weather/public_html/ajax-dashboard6.php on line 2036

Warning: Undefined array key 1 in /home/weather/public_html/ajax-dashboard6.php on line 2042

Deprecated: round(): Passing null to parameter #1 ($num) of type int|float is deprecated in /home/weather/public_html/ajax-dashboard6.php on line 2042
Mar-15


Warning: Undefined array key 1 in /home/weather/public_html/ajax-dashboard6.php on line 2050

Warning: Undefined array key 2 in /home/weather/public_html/ajax-dashboard6.php on line 2056

Deprecated: round(): Passing null to parameter #1 ($num) of type int|float is deprecated in /home/weather/public_html/ajax-dashboard6.php on line 2056
Mar-16


Warning: Undefined array key 2 in /home/weather/public_html/ajax-dashboard6.php on line 2064

I wish I had a clue of what was going on as other then this I didn't change anything....


« Last Edit: March 13, 2024, 08:22:13 PM by scottct1 »
Scott - NewingtonWeather.COM - Newington, Connecticut's Weather Source!
Davis Vantage Pro 2 Plus - WeatherFlow Tempest for Lightning - Weather-Display Software

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9298
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: AQI Error
« Reply #6 on: March 13, 2024, 08:40:03 PM »
You are running 6.92d of the ajax-dashboard6.php -- update it to 6.95h and those issues should disappear.
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 scottct1

  • Senior Member
  • **
  • Posts: 57
    • Newington, CT Weather
Re: AQI Error
« Reply #7 on: March 13, 2024, 09:32:12 PM »
Thanks Ken!
Scott - NewingtonWeather.COM - Newington, Connecticut's Weather Source!
Davis Vantage Pro 2 Plus - WeatherFlow Tempest for Lightning - Weather-Display Software

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9298
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: AQI Error
« Reply #8 on: March 13, 2024, 10:06:22 PM »
Don't forget to update the other 4 scripts from the 6.95h distribution:
get-aqi-rss.php
raintodate.php
cloud-base.php
heavens.php

along with the ajax-dashboard6.php and ajaxWDwx3.js
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 scottct1

  • Senior Member
  • **
  • Posts: 57
    • Newington, CT Weather
Re: AQI Error
« Reply #9 on: March 14, 2024, 02:35:12 PM »
Thanks Ken,

I ended up blowing out and uploading fresh copies of some of the scripts, as I had a lot of stuff in there which no longer exists (such as WU History) and now the page appears to be working.

Of course when I did that I messed up a few things...

Its now saying snow season is "Snow season July 1st to June 30th"  which is wrong and also says that we measure the snow with "3 Snow manually measured usually around 7AM and 7PM"

Where do I go to change these things?

Thanks again for your help!
« Last Edit: March 14, 2024, 02:36:45 PM by scottct1 »
Scott - NewingtonWeather.COM - Newington, Connecticut's Weather Source!
Davis Vantage Pro 2 Plus - WeatherFlow Tempest for Lightning - Weather-Display Software

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9298
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: AQI Error
« Reply #10 on: March 14, 2024, 06:01:34 PM »
All the footnotes are in AltAjaxDashboardConfig6php
Quote
$Foot1    = langtransstr('Rain season: Jan 1st to Dec 31st');  // Rain season is usually Jan-Dec
$Foot2    = langtransstr('Snow season July 1st to June 30th'); // Snow season is usually July to June or Jan to Dec
$Foot3    = langtransstr('Snow manually measured usually around 7AM and 7PM');  // What times you measure snow
$Foot4    = langtransstr('Updated at Noon Central Time');  // Time ET is updated.  In WD it is at NOON!
//           Footnote 5 is the description of the Irrigation Index
$Foot5    = langtransstr('Estimated amount of water needed to replace the water used by plants and evaporation from the past week. (Negative numbers mean amount of water needed, positive numbers mean excess water is present)');
//           Footnote 6 is the description of the Air Quality Index.  Be sure to give credit to the agency you get your reading from!
$Foot6    = langtransstr('Air Quality Index is provided by Minnesota Polution Control Agency and is updated hourly between the hours of 6AM and Midnight');
$Foot7    = langtransstr('Leaf Wetness is surface moisture on foliage.  0 being totally dry and 15 being totally saturated');
$Foot8    = langtransstr('Soil moisture and temperatures are from sensors burried in the ground at the levels specified');
$Foot9    = langtransstr('Solar Index represents either an absolute scale of solar energy (W/m&sup2;) using the station&rsquo;s recorded maximum or a percentage of computed theoretical solar maximum using the station&rsquo;s location and time of day.  These indices differ most when the sun is low on the horizon. The current scale is shown, and will toggle if it or the icon is clicked');
$today = getdate();
$month = $today['month'];
$day = $today['mday'];
$Foot10   = langtransstr('Historical average only to day ').$day.langtransstr(' of just the month of ').$month.langtransstr(' for this station since ').((date('z')>$SStartUpDay)?$SStartYr:$SStartYr+1);
$Foot11   = langtransstr('Historical average rain this season to day ').$day.langtransstr(' of ').$month.langtransstr(' for this station since ').((date('z')>$SStartUpDay)?$SStartYr:$SStartYr+1);
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