Please read the posts in the Announcements section about the current status of Cumulus development now that I have retired

Please read this post before posting

Latest Cumulus release v1.9.4 (build 1099) - Nov 28 2014
Latest Cumulus MX release - v3.0.0 build 3043 Jan 20 2017. See this post for download

WU-forecast.php

Discussion of Ken True's web site templates

Moderator: saratogaWX

User avatar
Toxic17
Posts: 542
Joined: Mon May 19, 2014 10:45 pm
Weather Station: Davis Vantage Pro2 Plus
Operating System: Debian 9.1 Stretch
Location: Bangor, NI
Contact:

WU-forecast.php

Postby Toxic17 » Tue Nov 07, 2017 11:04 pm

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
https://twitter.com/conligwx
Davis Vantage Pro2+ - CumulusMX v3.0.0 (build 3043) + Saratoga/PWS
Image

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

Re: WU-forecast.php

Postby saratogaWX » Tue Nov 07, 2017 11:23 pm

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
Toxic17
Posts: 542
Joined: Mon May 19, 2014 10:45 pm
Weather Station: Davis Vantage Pro2 Plus
Operating System: Debian 9.1 Stretch
Location: Bangor, NI
Contact:

Re: WU-forecast.php

Postby Toxic17 » Tue Nov 07, 2017 11:26 pm

Thanks :clap:
Regards Simon

https://www.conligwx.org
https://twitter.com/conligwx
Davis Vantage Pro2+ - CumulusMX v3.0.0 (build 3043) + Saratoga/PWS
Image

User avatar
Mapantz
Posts: 446
Joined: Sat Dec 17, 2011 11:55 am
Weather Station: Davis Vantage Pro2
Operating System: Windows 10 x64 - A beast.
Location: Wareham, Dorset - UK
Contact:

Re: WU-forecast.php

Postby Mapantz » Wed Nov 08, 2017 11:09 pm

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
Image

User avatar
Toxic17
Posts: 542
Joined: Mon May 19, 2014 10:45 pm
Weather Station: Davis Vantage Pro2 Plus
Operating System: Debian 9.1 Stretch
Location: Bangor, NI
Contact:

Re: WU-forecast.php

Postby Toxic17 » Wed Nov 08, 2017 11:54 pm

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
https://twitter.com/conligwx
Davis Vantage Pro2+ - CumulusMX v3.0.0 (build 3043) + Saratoga/PWS
Image

User avatar
Toxic17
Posts: 542
Joined: Mon May 19, 2014 10:45 pm
Weather Station: Davis Vantage Pro2 Plus
Operating System: Debian 9.1 Stretch
Location: Bangor, NI
Contact:

Re: WU-forecast.php

Postby Toxic17 » Wed Nov 15, 2017 5:22 pm

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
https://twitter.com/conligwx
Davis Vantage Pro2+ - CumulusMX v3.0.0 (build 3043) + Saratoga/PWS
Image

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

Re: WU-forecast.php

Postby saratogaWX » Wed Nov 15, 2017 5:44 pm

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/findweather/getForecast?query=pws:ICODOWNN2' -->
<!-- WU API New URL='http://api.wunderground.com/api/47678e7793e1cea8/forecast10day/geolookup/lang:EN/q/pws:ICODOWNN2.json' -->
<!-- loading from https://api.wunderground.com/api/47678e ... OWNN2.json. -->
<!-- curl fetching 'https://api.wunderground.com/api/47678e7793e1cea8/forecast10day/geolookup/lang:EN/q/pws:ICODOWNN2.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/findweather/hdfForecast?query=95070' -->
<!-- WU API New URL='http://api.wunderground.com/api/c991975b7f4186c0/forecast10day/geolookup/lang:EN/q/95070.json' -->
<!-- loading from https://api.wunderground.com/api/c99197 ... 95070.json. -->
<!-- curl fetching 'https://api.wunderground.com/api/c991975b7f4186c0/forecast10day/geolookup/lang:EN/q/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
Toxic17
Posts: 542
Joined: Mon May 19, 2014 10:45 pm
Weather Station: Davis Vantage Pro2 Plus
Operating System: Debian 9.1 Stretch
Location: Bangor, NI
Contact:

Re: WU-forecast.php

Postby Toxic17 » Wed Nov 15, 2017 6:19 pm

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

https://www.conligwx.org
https://twitter.com/conligwx
Davis Vantage Pro2+ - CumulusMX v3.0.0 (build 3043) + Saratoga/PWS
Image

User avatar
Toxic17
Posts: 542
Joined: Mon May 19, 2014 10:45 pm
Weather Station: Davis Vantage Pro2 Plus
Operating System: Debian 9.1 Stretch
Location: Bangor, NI
Contact:

Re: WU-forecast.php

Postby Toxic17 » Wed Nov 15, 2017 8:31 pm

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
https://twitter.com/conligwx
Davis Vantage Pro2+ - CumulusMX v3.0.0 (build 3043) + Saratoga/PWS
Image


Return to “Saratoga Templates”

Who is online

Users browsing this forum: Bing [Bot] and 3 guests