Metar Data not Working on homepage or metar data pages

hello again…

just noticed on many sites including my own that our METAR data is not downloading or updating…also when in weather display/control panels/ftp and connections tab/meatr download tab…after hitting the test button no new data comes through. the txt file inside the weatherdisplay/metar folder does not update and mine has not updated since around september 5th 2016 and the northpirt NY site’s hasnt update since around august 6th 2016.

my guess is that where we and WD are getting the data from has changed/changed URL or maybe even not even supplying us the data anymore due to changes.

if anyone has any help on this would like to hear it.

my metar data page is here…http://www.gateway2capecod.com/wxmetar22.php
northport NY meatr page here…http://www.northportnyweather.com/wxmetar.php
northport NY metar.gif most recent image from 2 months ago here…http://www.northportnyweather.com/metar.gif

Thanks for any help…Chris

By looking here…http://www.nws.noaa.gov/tg/siteloc.shtml
The url did change.

http://discourse.weather-watch.com/p/492200

hello guys and thanks for the help…

I updated weather display to the newest version and metar data is now being retrieved, although it took awhile before it kicked in even when hitting the TEST button on the metar download page in control panels.

as for our wxmetar pages…we have been using a script by “woody” and I believe he is no longer supporting the script and most like wont be editing his script to reflect the changes in URL’S. Maybe I will be able to figure out what to change in his script for it to continue working or maybe it will be too much trouble to do. if I cant figure it out I can always use Ken’s Newest NEARBY MEtar page included in his saratoga templates.

all these organizations in the past few months changing URL’s and other thing’s around on us and making our files go haywire is becoming a pain in the butt having to fix things again and again. wish they would just leave the url’s the same forever and save us some time from having to redo.

Thanks again and have a good Day…Chris

Should work OK if you change the URL’s. If not attach the script and someone will surely help you.

(Moving this to the appropriate place.)

Attach the script with the problem (“Woody’s”) and I’ll take a look…

Ken

hello again…

I will upload the WOody’s script in my next reply and thanks for taking the time to try and fix it…

for right now I have another few questions about the new METAR Data and where it is downloaded from and if its exactly like before. The problem is on the northport NY site we updated to newest WD Version and build and got the Metar downloading data again and also creating a metar.gif. The Icon on the DASHBOARD appears to be updating as it should but where the text wording goes underneath it where it may say overcast/clear/mostly sunny/partly cloudy etc etc…is not display the text there and there are just 3 dashes where the text should be that look like this —

does the new way of getting the metar data eliminate the text description of current conditions?

See image below with missing description text.

Thanks…Chris


hello again…

here are the 2 files For Woody’s script page seen here…

http://www.gateway2capecod.com/wxmetar22.php

one file is named getwx.php and the other is the actual page file named wxmetar22.php

I renamed both with the txt extension so I could upload them to here below.

Thanks…Chris


wxmetar22.php.txt (32.4 KB)

getwx.php.txt (20.7 KB)

In getwx.php, just try changing

	$fileName = "http://weather.noaa.gov/pub/data/observations/metar/stations/$station.TXT";

to

	$fileName = "http://tgftp.nws.noaa.gov/data/observations/metar/stations/$station.TXT";

to point to the new source for raw METAR data.
That should get the script running again.

However, the script uses a lot of ereg() calls that should be changed to preg_match() calls. The first argument needs to be delimited by adding a character like ! (exclamation point) after the opening quote, and just before the closing quote. So something like

	if (ereg('^([0-9G]{5,10}|VRB[0-9]{2,3})(KT|MPS|KMH)$',$part,$pieces)) {

becomes

	if (preg_match('!^([0-9G]{5,10}|VRB[0-9]{2,3})(KT|MPS|KMH)$!',$part,$pieces)) {

Also the calls to split() should be replaced with explode() as ‘split’ has also been deprecated along with ‘ereg’ – it will save you PHP errors when you upgrade PHP.

BTW… the code for process_metar() function looks very familiar… I use an updated version (called mtr_process() ) in my get-metar-conditions-inc.php script included with the templates :slight_smile:

Best regards,
Ken

You have to set WD to use the metar conditions for your conditions icon … see Saratoga-Weather.org - Website Templates - AJAX/PHP - Weather-Display Setup for details.

Edited: Ken I updated this

$fileName = "http://http://tgftp.nws.noaa.gov/data/observations/metar/stations/$station.TXT";

to this In your post.

$fileName = "http://tgftp.nws.noaa.gov/data/observations/metar/stations/$station.TXT";

Thanks… I guess the copy from the Firefox URL area just included the extra http:// and I was quick to post (without proofing) :oops:

hello Ken…

will give it a try and see how it goes.

also will recheck icon images settings from metar download to make text appear.

Thank you…chris

hello Ken…

tried editing the URL for woody’s script as stated above but still a no go. Dont worry about it though I have upgraded my own and Northport NY Site’s Metar data page to use your NEARBY Metar reports script/page and that is working nicely.

Also figured out why on northport NY site he was getting the 3 dashes under his current condition ICON and NO Text on top left section of his dashboard…The problem was his testtags.php stopped updating for whatever reason after we upgraded his weather display from build 81 to the newest version and build. reset that and now the icon and text wording from Metar is appearing for his site.

Thanks again…Chris