IMPORTANT! The server may go down soon - possibly permanently. Please read the latest post in Announcements and News

FTP is broken. I advise all users using my server for their web site to make alternative arrangements.

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: 692
Joined: Mon May 19, 2014 10:45 pm
Weather Station: Davis VPro2 Plus
Operating System: Debian 9.5 Stretch
Location: Bangor, NI
Contact:

Re: WU-forecast.php

Postby Toxic17 » Mon Nov 27, 2017 10:42 am

Mapantz wrote:
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.


fcttext_metric is "" again from WU in the json file.

use the 3.04beta that Ken supplied here:

viewtopic.php?f=25&t=16597#p127320
Regards Simon

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

User avatar
Toxic17
Posts: 692
Joined: Mon May 19, 2014 10:45 pm
Weather Station: Davis VPro2 Plus
Operating System: Debian 9.5 Stretch
Location: Bangor, NI
Contact:

Re: WU-forecast.php

Postby Toxic17 » Wed Jan 03, 2018 11:18 pm

Just started today getting errors again.

Warning: Division by zero in /share/~~~~~~/WU-forecast.php on line 629

WU-forecast-json-0-en.txt file has this in its contents so guess WU is having issues again?

Code: Select all

HTTP/1.1 503 Service Unavailable
Content-Length: 0
Expires: Wed, 03 Jan 2018 23:15:21 GMT
Cache-Control: max-age=0, no-cache
Pragma: no-cache
Date: Wed, 03 Jan 2018 23:15:21 GMT
Connection: keep-alive


api site showing fault with web page at present.

https://www.wunderground.com/weather/api
Regards Simon

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

User avatar
Mapantz
Posts: 493
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 » Thu Jan 04, 2018 12:09 am

Whole of WU is down from my end, has been for a few hours.
Image
Image

User avatar
mcrossley
Posts: 5194
Joined: Thu Jan 07, 2010 9:44 pm
Weather Station: Davis VP2
Operating System: Stretch Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: WU-forecast.php

Postby mcrossley » Thu Jan 04, 2018 9:08 am

Whole of WU is down from my end, has been for a few hours.

AWS implementing the Intel fix?

User avatar
jdc
Posts: 135
Joined: Tue Jun 19, 2012 8:51 pm
Weather Station: Davis VP2 : Instromet
Operating System: Win 10 : Win XP
Location: Berwick-upon-Tweed, England.
Contact:

Re: WU-forecast.php

Postby jdc » Thu Jan 04, 2018 11:14 am

I haven't noticed any problems with WU....

AWS implementing the Intel fix?


Are you busy with that? :roll:

I haven't noticed any problems....

User avatar
Toxic17
Posts: 692
Joined: Mon May 19, 2014 10:45 pm
Weather Station: Davis VPro2 Plus
Operating System: Debian 9.5 Stretch
Location: Bangor, NI
Contact:

Re: WU-forecast.php

Postby Toxic17 » Thu Jan 04, 2018 11:33 am

mcrossley wrote:
Whole of WU is down from my end, has been for a few hours.

AWS implementing the Intel fix?


not just Intel by the looks of it, and patches look like they will slow everything down :shock:

https://www.reddit.com/r/pcmasterrace/c ... l_cpu_bug/

btw looks like the forecasting it backup again...

interesting read on WU's response though.......

https://www.wxforum.net/index.php?topic ... #msg340115
Regards Simon

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

User avatar
Toxic17
Posts: 692
Joined: Mon May 19, 2014 10:45 pm
Weather Station: Davis VPro2 Plus
Operating System: Debian 9.5 Stretch
Location: Bangor, NI
Contact:

Re: WU-forecast.php

Postby Toxic17 » Fri Jan 19, 2018 6:42 pm

Ken, I was wondering if you could help me figure out any way of scripting this issue.

as we know WU Forecasts have been flakey for a while. I have some script to delete (unlink) the cache file if it is 0 bytes in size.

when forecasts from WU come down the cache file is usually over 20kb in size, so I was wondering how I script the file to be deleted if it is less than 20kb.

here is the start of my wu-forcast.php.

Code: Select all

<?php
$filename = './cache/WU-forecast-json-0-en.txt';

if (file_exists($filename)) {

$zerosize = filesize('./cache/WU-forecast-json-0-en.txt');

if ($zerosize == 0) {
unlink('./cache/WU-forecast-json-0-en.txt');
} }
 
// WU-forecast.php script by Ken True - webmaster@saratoga-weather.org


any help would be most appreicated.

here is the two cache file. one complete the other incomplete.
You do not have the required permissions to view the files attached to this post.
Regards Simon

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

User avatar
saratogaWX
Posts: 895
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 » Fri Jan 19, 2018 7:39 pm

Since the API returns something, just not all the things, maybe the shorter version could be detected by

Code: Select all

if ($zerosize < 20000) {
which would spot the ones with reduced data.

User avatar
Toxic17
Posts: 692
Joined: Mon May 19, 2014 10:45 pm
Weather Station: Davis VPro2 Plus
Operating System: Debian 9.5 Stretch
Location: Bangor, NI
Contact:

Re: WU-forecast.php

Postby Toxic17 » Fri Jan 19, 2018 9:04 pm

saratogaWX wrote:Since the API returns something, just not all the things, maybe the shorter version could be detected by

Code: Select all

if ($zerosize < 20000) {
which would spot the ones with reduced data.


Just run a test on that..... Yep that seems to work.

Thanks Ken. :clap:
Regards Simon

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

User avatar
Toxic17
Posts: 692
Joined: Mon May 19, 2014 10:45 pm
Weather Station: Davis VPro2 Plus
Operating System: Debian 9.5 Stretch
Location: Bangor, NI
Contact:

Re: WU-forecast.php

Postby Toxic17 » Thu Mar 01, 2018 7:59 am

Ken

is there anyway MPH can be used with°C ?
Regards Simon

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

User avatar
Mapantz
Posts: 493
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 » Thu Mar 01, 2018 9:57 am

Toxic17 wrote:Ken

is there anyway MPH can be used with°C ?


That's a good shout. It would be nice if a workaround is possible. I asked WU a long time ago about giving this option and they point-blank refused. Although I can do the conversion in my head quite quickly, I find it uncomfortable to use. :lol:
Image
Image

User avatar
saratogaWX
Posts: 895
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 » Thu Mar 01, 2018 6:53 pm

Since the data on wind speed comes in the plain text of the period forecast, there's not a good way for me to parse that out and convert it from km/h to mph given there are multiple languages to support. I have to just rely on WU to provide the translations and data. There's nothing in the JSON that would let me do a wind speed units change either. Sorry...

User avatar
Mapantz
Posts: 493
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 » Sat Mar 17, 2018 3:10 pm

Is anyone else back to having problems with this again? for the past week/10 days, the forecast is failing around 6 or 7 times a day. Are WU ever going to fix this?
Image
Image

User avatar
saratogaWX
Posts: 895
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 » Sat Mar 17, 2018 3:23 pm

The WU developers Trello status board still shows my two entries about the API (missing forecasts, some non-English requests return English forecasts) in 'Backlog', so it's unlikely they are working on it yet. Sigh. :groan:

User avatar
Toxic17
Posts: 692
Joined: Mon May 19, 2014 10:45 pm
Weather Station: Davis VPro2 Plus
Operating System: Debian 9.5 Stretch
Location: Bangor, NI
Contact:

Re: WU-forecast.php

Postby Toxic17 » Sat Mar 17, 2018 7:32 pm

saratogaWX wrote:The WU developers Trello status board still shows my two entries about the API (missing forecasts, some non-English requests return English forecasts) in 'Backlog', so it's unlikely they are working on it yet. Sigh. :groan:


Time to point Ben at the Problem again I guess. Thought I havent noticed as many failures since implementing the deletion of the WU-forecast-json-0-en.txt if size is lower than about 22kb. I know this is only a work around, but it seems to be holding up well. (famous last words :lol: )
Regards Simon

https://www.conligwx.org
https://www.conligwx.org/pws/
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: No registered users and 4 guests