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

WU-forecast.php

Discussion of Ken True's web site templates

Moderator: saratogaWX

User avatar
ConligWX
Posts: 1571
Joined: Mon 19 May 2014 10:45 pm
Weather Station: Davis vPro2+ w/DFARS + AirLink
Operating System: Ubuntu 22.04 LTS
Location: Bangor, NI
Contact:

WU-forecast.php

Post by ConligWX »

Looks like WU API data is now returning fcttext_metric = null and showing an error. this appears to be some city's but not all as mentioned here:

https://apicommunity.wunderground.com/w ... 5-november
Regards Simon

https://www.conligwx.org - @conligwx
Davis Vantage Pro2 Plus with Daytime FARS • WeatherLink Live • Davis AirLink • PurpleAir •

Image
User avatar
saratogaWX
Posts: 1170
Joined: Wed 06 May 2009 5:02 am
Weather Station: Davis Vantage Pro Plus
Operating System: Windows 10 Professional
Location: Saratoga, CA, USA
Contact:

Re: WU-forecast.php

Post by saratogaWX »

Yes, that is what is 'confusing' the WU-forecast.php V3.03 script -- the missing 'fcttext_metric' entry in the JSON returned.

I've got a beta workaround (v3.04-beta) that uses the 'fcttext' (Imperial) text forecast and (tries to) replace the F forecasts with C forecasts leaving the rest of the forecast text unchanged. It doesn't try to change the wind forecasts from MPH to km/h, and I've observed that some international forecasts using languages other than that country's language may have null values for both (and so fail).

Try if you like the attached beta .. I'm not releasing an 'offical' update for this as it's just a quick workaround for their broken API JSON feed.
You do not have the required permissions to view the files attached to this post.
User avatar
ConligWX
Posts: 1571
Joined: Mon 19 May 2014 10:45 pm
Weather Station: Davis vPro2+ w/DFARS + AirLink
Operating System: Ubuntu 22.04 LTS
Location: Bangor, NI
Contact:

Re: WU-forecast.php

Post by ConligWX »

Thanks :clap:
Regards Simon

https://www.conligwx.org - @conligwx
Davis Vantage Pro2 Plus with Daytime FARS • WeatherLink Live • Davis AirLink • PurpleAir •

Image
Mapantz
Posts: 1777
Joined: Sat 17 Dec 2011 11:55 am
Weather Station: Davis Vantage Pro2
Operating System: Windows 11 x64
Location: Dorset - UK
Contact:

Re: WU-forecast.php

Post by Mapantz »

I think they've fixed it now? My forecast has been on/off all day, for the last 4 days I think?! One hour it's fine, then it's down for an hour etc However, it has been working fine for the last 5 or 6 hours.
Image
User avatar
ConligWX
Posts: 1571
Joined: Mon 19 May 2014 10:45 pm
Weather Station: Davis vPro2+ w/DFARS + AirLink
Operating System: Ubuntu 22.04 LTS
Location: Bangor, NI
Contact:

Re: WU-forecast.php

Post by ConligWX »

Mapantz wrote:I think they've fixed it now? My forecast has been on/off all day, for the last 4 days I think?! One hour it's fine, then it's down for an hour etc However, it has been working fine for the last 5 or 6 hours.
Yep got an email from the api team reporting the issue is now fixed.
Regards Simon

https://www.conligwx.org - @conligwx
Davis Vantage Pro2 Plus with Daytime FARS • WeatherLink Live • Davis AirLink • PurpleAir •

Image
User avatar
ConligWX
Posts: 1571
Joined: Mon 19 May 2014 10:45 pm
Weather Station: Davis vPro2+ w/DFARS + AirLink
Operating System: Ubuntu 22.04 LTS
Location: Bangor, NI
Contact:

Re: WU-forecast.php

Post by ConligWX »

is this broken again?

I'm getting error mesdsage:

Warning: Division by zero in WU-forecast.php on line 631

WU-forecast-json-0-en.txt is zero bites so looks like no data is being downloaded.
Regards Simon

https://www.conligwx.org - @conligwx
Davis Vantage Pro2 Plus with Daytime FARS • WeatherLink Live • Davis AirLink • PurpleAir •

Image
User avatar
saratogaWX
Posts: 1170
Joined: Wed 06 May 2009 5:02 am
Weather Station: Davis Vantage Pro Plus
Operating System: Windows 10 Professional
Location: Saratoga, CA, USA
Contact:

Re: WU-forecast.php

Post by saratogaWX »

Doing a view-source on wxforecast.php?force=1 shows
<!-- WU-forecast.php (ML) Version 3.04 beta - 22-Feb-2017 on PHP 7.1.11 -->
<!-- temps in C -->
<!-- autoSetTemplate using narrow aspect. -->
<!-- WU_API Raw URL='https://www.wunderground.com/cgi-bin/fi ... :ICODOWNN2' -->
<!-- WU API New URL='http://api.wunderground.com/api/47678e7 ... OWNN2.json' -->
<!-- loading from https://api.wunderground.com/api/47678e ... OWNN2.json. -->
<!-- curl fetching 'https://api.wunderground.com/api/47678e ... OWNN2.json' -->
<!-- Error: Operation timed out after 4001 milliseconds with 0 out of 0 bytes received -->
<!-- HTTP stats: RC=0 dest=23.43.34.106 port=443
Times: dns=0.060 conn=0.062 pxfer=0.000 get=4.001 total=4.001 secs -->
So there's a timeout issue between your webserver and api.wunderground.com server -- WU is not responding within 4 seconds (a long time for an API) and zero results are received.

A 'normal' fetch (as on my site currently) shows
<!-- WU-forecast.php (ML) Version 3.03 - 22-Feb-2017 on PHP 7.1.11 -->
<!-- temps in F -->
<!-- autoSetTemplate using narrow aspect. -->
<!-- WU_API Raw URL='http://www.wunderground.com/cgi-bin/fin ... uery=95070' -->
<!-- WU API New URL='http://api.wunderground.com/api/c991975 ... 95070.json' -->
<!-- loading from https://api.wunderground.com/api/c99197 ... 95070.json. -->
<!-- curl fetching 'https://api.wunderground.com/api/c99197 ... 95070.json' -->
<!-- HTTP stats: RC=200 dest=23.52.163.36
Times: dns=0.013 conn=0.051 pxfer=0.215 get=0.271 total=0.486 secs -->
<!-- RC=200 OK, bytes=26180 -->
User avatar
ConligWX
Posts: 1571
Joined: Mon 19 May 2014 10:45 pm
Weather Station: Davis vPro2+ w/DFARS + AirLink
Operating System: Ubuntu 22.04 LTS
Location: Bangor, NI
Contact:

Re: WU-forecast.php

Post by ConligWX »

Ah.. ok might be my firewall slowing the request I'll take a look.. thanks.
Regards Simon

https://www.conligwx.org - @conligwx
Davis Vantage Pro2 Plus with Daytime FARS • WeatherLink Live • Davis AirLink • PurpleAir •

Image
User avatar
ConligWX
Posts: 1571
Joined: Mon 19 May 2014 10:45 pm
Weather Station: Davis vPro2+ w/DFARS + AirLink
Operating System: Ubuntu 22.04 LTS
Location: Bangor, NI
Contact:

Re: WU-forecast.php

Post by ConligWX »

saratogaWX wrote: So there's a timeout issue between your webserver and api.wunderground.com server -- WU is not responding within 4 seconds (a long time for an API) and zero results are received.

A 'normal' fetch (as on my site currently) shows
<!-- WU-forecast.php (ML) Version 3.03 - 22-Feb-2017 on PHP 7.1.11 -->
Thank god for Backups... :lol:

disabled all firewall, IPS, Web and Application rules, but still no joy.

played about with the WU-forecast.php but could not figure it out. restarted apache. still no joy, though my PC (win10) calls the api url within a split second.

ended up restoring the webfolder from a backup. and it is now working. so something in the configuration was screwed up. :groan:

Thanks for the help though Ken. :clap:
Regards Simon

https://www.conligwx.org - @conligwx
Davis Vantage Pro2 Plus with Daytime FARS • WeatherLink Live • Davis AirLink • PurpleAir •

Image
Mapantz
Posts: 1777
Joined: Sat 17 Dec 2011 11:55 am
Weather Station: Davis Vantage Pro2
Operating System: Windows 11 x64
Location: Dorset - UK
Contact:

Re: WU-forecast.php

Post by Mapantz »

It looks like it is back to playing up again! :(
Image
User avatar
saratogaWX
Posts: 1170
Joined: Wed 06 May 2009 5:02 am
Weather Station: Davis Vantage Pro Plus
Operating System: Windows 10 Professional
Location: Saratoga, CA, USA
Contact:

Re: WU-forecast.php

Post by saratogaWX »

Looks like it's working again on your site.

When it fails, do a view-source on the page
<!-- WU-forecast.php (ML) Version 3.02 - 01-Nov-2014 on PHP 5.6.32 -->
<!-- WU_API Raw URL='https://www.wunderground.com/q/zmw:00000.70.03862' -->
<!-- WU API New URL='http://api.wunderground.com/api/f7ca747 ... 03862.json' -->
<!-- loading from ./cache/WU-forecast-json-0-en.txt (26136 bytes) -->
<!-- using charsetInput='UTF-8' charsetOutput='ISO-8859-1' doIconv='1' doRTL='' -->
<!-- processing JSON entries for forecast -->
<!-- rawJSON size is 25684 bytes -->
<!-- WU_prepareJSON: Success. Valid UTF-8. -->
<!-- json_decode returns - No errors -->
to see what it said. If needed, look at the cached JSON file highlighted above to see if forecast info was included. WU sometimes omits the forecast JSON info while their models update the detailed forecasts. It happens with our NWS and the new api.weather.gov site also.
User avatar
ConligWX
Posts: 1571
Joined: Mon 19 May 2014 10:45 pm
Weather Station: Davis vPro2+ w/DFARS + AirLink
Operating System: Ubuntu 22.04 LTS
Location: Bangor, NI
Contact:

Re: WU-forecast.php

Post by ConligWX »

I used to get sometimes a 0 byte files json file, and then it would not update at all. I have added a check for 0 byte and if so delete this file before it refreshes. still does not stop incomplete files however.
Regards Simon

https://www.conligwx.org - @conligwx
Davis Vantage Pro2 Plus with Daytime FARS • WeatherLink Live • Davis AirLink • PurpleAir •

Image
Mapantz
Posts: 1777
Joined: Sat 17 Dec 2011 11:55 am
Weather Station: Davis Vantage Pro2
Operating System: Windows 11 x64
Location: Dorset - UK
Contact:

Re: WU-forecast.php

Post by Mapantz »

It went blank again..

Code: Select all

<!-- WU-forecast.php (ML) Version 3.03 - 22-Feb-2017 on PHP 5.6.32 -->
<!-- loading from https://api.wunderground.com/api/f7ca74754ae07fca/forecast10day/geolookup/lang:EN/q/zmw:00000.70.03862.json. -->
<!-- curl fetching 'https://api.wunderground.com/api/f7ca74754ae07fca/forecast10day/geolookup/lang:EN/q/zmw:00000.70.03862.json' -->
<!-- HTTP stats:  RC=200 dest=213.248.117.32 port=443 (from sce=185.145.203.195)
      Times: dns=0.028 conn=0.029 pxfer=0.038 get=0.648 total=0.685 secs -->
<!-- RC=200 OK, bytes=24485 -->
<!-- saved cache to ./cache/WU-forecast-json-0-en.txt (24485 bytes) -->
<!-- using charsetInput='UTF-8' charsetOutput='ISO-8859-1' doIconv='1' doRTL='' -->
<!-- processing JSON entries for forecast -->
<!-- rawJSON size is 24027 bytes -->
<!-- json_decode returns  - No errors
Image
User avatar
ConligWX
Posts: 1571
Joined: Mon 19 May 2014 10:45 pm
Weather Station: Davis vPro2+ w/DFARS + AirLink
Operating System: Ubuntu 22.04 LTS
Location: Bangor, NI
Contact:

Re: WU-forecast.php

Post by ConligWX »

In the last few months it had been very hit and miss. Not sure it they are to blame or not.

Just double check your DNS and time are pretty much 100% ok and nothing your end (network related) is making the data truncated at all. I think I did move DNS from Google to OpenDNS which seems slightly faster with my ISP. My time is pulled from uk.pool.ntp.org.
Regards Simon

https://www.conligwx.org - @conligwx
Davis Vantage Pro2 Plus with Daytime FARS • WeatherLink Live • Davis AirLink • PurpleAir •

Image
Mapantz
Posts: 1777
Joined: Sat 17 Dec 2011 11:55 am
Weather Station: Davis Vantage Pro2
Operating System: Windows 11 x64
Location: Dorset - UK
Contact:

Re: WU-forecast.php

Post by Mapantz »

Toxic17 wrote:In the last few months it had been very hit and miss. Not sure it they are to blame or not.

Just double check your DNS and time are pretty much 100% ok and nothing your end (network related) is making the data truncated at all. I think I did move DNS from Google to OpenDNS which seems slightly faster with my ISP. My time is pulled from uk.pool.ntp.org.
I checked your forecast last night, and it wasn't working either.

https://apicommunity.wunderground.com/w ... 5-november

A few people complained about it yesterday.
Image
Post Reply