Author Topic: broken EC radar images  (Read 4584 times)

0 Members and 1 Guest are viewing this topic.

Offline weathergirl

  • Forecaster
  • *****
  • Posts: 677
    • Beamsville Weather Station
broken EC radar images
« on: January 18, 2010, 09:57:36 AM »
My EC radar images are broken:

http://www.beamsvillewx.ca/wxradar2.php

Might this be a result of my webhost upgrading his server?
« Last Edit: January 23, 2010, 06:39:58 PM by weathergirl »
Ann-Marie
Beamsville, Ontario, Canada

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9282
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: broken EC radar images
« Reply #1 on: January 18, 2010, 10:59:24 AM »
Could be...

Make sure your website has a /radar/ directory under the document root, and that the directory permissions are 777
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 weathergirl

  • Forecaster
  • *****
  • Posts: 677
    • Beamsville Weather Station
Re: broken EC radar images
« Reply #2 on: January 18, 2010, 12:49:47 PM »
Hi Ken: I changed the permissions, the images are still broken. I don't understand because I have had the EC radar setup for awhile now and they have always worked.
Ann-Marie
Beamsville, Ontario, Canada

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9282
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: broken EC radar images
« Reply #3 on: January 18, 2010, 01:05:30 PM »
Hmmm.. doing a http://www.beamsvillewx.ca/maps/ec-radar.php?cache=no

results with comments
Quote
<!-- ec-radar.php - V1.07 -30-Apr-2009 -->
<!-- cacheDir='/home/annmarie/public_html/maps/radar/' -->
<!-- imageDir='/maps/radar/' -->
<!-- siteID='NAT' -->
<!-- changed '/home/annmarie/public_html/maps/radar/ec-radar-en-NAT.txt'
         to: '/home/annmarie/public_html/maps/radar/ec-radar-en-NAT.txt' -->
<!-- loading ec-radar-en-NAT.txt from
  'http://weatheroffice.gc.ca/radar/index_e.html?id=NAT' -->
<!-- loading finished. New page cache saved to ec-radar-en-NAT.txt -->
<!-- TZ='UTC' TZHrs='0' TZOffsetSecs='0' TZName='Coordinated Universal Time' -->
<!-- now=Mon, 18 Jan 2010 17:58:56 (1263837536)
     rdr=Mon, 18 Jan 2010 17:40:00 (1263836400)  age=1136 secs -->
<!-- lcl=Mon, 18 Jan 2010 17:58:51 (1263837531) age=-1131 secs for radar-NAT-0.png -->
<!-- local cache files are not current .. reloading. -->
<!-- Loading http://weatheroffice.gc.ca/radar/image.php?base=/data/radar/temp_image/COMPOSITE_NAT/COMPOSITE_NAT_PRECIP_SNOW_2010_01_18_17_40.GIF&overlays[]=/radar/images/layers/rivers/nat_rivers.gif&overlays[]=/radar/images/layers/roads/NAT_roads.gif&overlays[]=/radar/images/layers/road_labels/nat_labs.gif&overlays[]=/radar/images/layers/additional_cities/nat_towns.gif&overlays[]=/radar/images/layers/default_cities/nat_towns.gif
 to radar-NAT-0.png
 dir=/home/annmarie/public_html/maps/radar/ -->
<!-- unable to reload radar-NAT-0.png (0.000 secs.) -->
<!-- Loading http://weatheroffice.gc.ca/radar/image.php?base=/data/radar/temp_image/COMPOSITE_NAT/COMPOSITE_NAT_PRECIP_SNOW_2010_01_18_17_40.GIF&overlays[]=/radar/images/layers/rivers/nat_rivers.gif&overlays[]=/radar/images/layers/roads/NAT_roads.gif&overlays[]=/radar/images/layers/road_labels/nat_labs.gif&overlays[]=/radar/images/layers/additional_cities/nat_towns.gif&overlays[]=/radar/images/layers/default_cities/nat_towns.gif
 to radar-NAT-1.png
 dir=/home/annmarie/public_html/maps/radar/ -->
<!-- unable to reload radar-NAT-1.png (0.000 secs.) -->
<!-- Loading http://weatheroffice.gc.ca/radar/image.php?base=/data/radar/temp_image/COMPOSITE_NAT/COMPOSITE_NAT_PRECIP_SNOW_2010_01_18_17_30.GIF&overlays[]=/radar/images/layers/rivers/nat_rivers.gif&overlays[]=/radar/images/layers/roads/NAT_roads.gif&overlays[]=/radar/images/layers/road_labels/nat_labs.gif&overlays[]=/radar/images/layers/additional_cities/nat_towns.gif&overlays[]=/radar/images/layers/default_cities/nat_towns.gif
 to radar-NAT-2.png
 dir=/home/annmarie/public_html/maps/radar/ -->

<!-- unable to reload radar-NAT-2.png (0.000 secs.) -->
<!-- Loading http://weatheroffice.gc.ca/radar/image.php?base=/data/radar/temp_image/COMPOSITE_NAT/COMPOSITE_NAT_PRECIP_SNOW_2010_01_18_17_20.GIF&overlays[]=/radar/images/layers/rivers/nat_rivers.gif&overlays[]=/radar/images/layers/roads/NAT_roads.gif&overlays[]=/radar/images/layers/road_labels/nat_labs.gif&overlays[]=/radar/images/layers/additional_cities/nat_towns.gif&overlays[]=/radar/images/layers/default_cities/nat_towns.gif
 to radar-NAT-3.png
 dir=/home/annmarie/public_html/maps/radar/ -->
<!-- unable to reload radar-NAT-3.png (0.000 secs.) -->
<!-- Loading http://weatheroffice.gc.ca/radar/image.php?base=/data/radar/temp_image/COMPOSITE_NAT/COMPOSITE_NAT_PRECIP_SNOW_2010_01_18_17_10.GIF&overlays[]=/radar/images/layers/rivers/nat_rivers.gif&overlays[]=/radar/images/layers/roads/NAT_roads.gif&overlays[]=/radar/images/layers/road_labels/nat_labs.gif&overlays[]=/radar/images/layers/additional_cities/nat_towns.gif&overlays[]=/radar/images/layers/default_cities/nat_towns.gif
 to radar-NAT-4.png
 dir=/home/annmarie/public_html/maps/radar/ -->
<!-- unable to reload radar-NAT-4.png (0.000 secs.) -->
<!-- Loading http://weatheroffice.gc.ca/radar/image.php?base=/data/radar/temp_image/COMPOSITE_NAT/COMPOSITE_NAT_PRECIP_SNOW_2010_01_18_17_00.GIF&overlays[]=/radar/images/layers/rivers/nat_rivers.gif&overlays[]=/radar/images/layers/roads/NAT_roads.gif&overlays[]=/radar/images/layers/road_labels/nat_labs.gif&overlays[]=/radar/images/layers/additional_cities/nat_towns.gif&overlays[]=/radar/images/layers/default_cities/nat_towns.gif
 to radar-NAT-5.png
 dir=/home/annmarie/public_html/maps/radar/ -->
<!-- unable to reload radar-NAT-5.png (0.000 secs.) -->
<!-- Loading http://weatheroffice.gc.ca/radar/image.php?base=/data/radar/temp_image/COMPOSITE_NAT/COMPOSITE_NAT_PRECIP_SNOW_2010_01_18_16_50.GIF&overlays[]=/radar/images/layers/rivers/nat_rivers.gif&overlays[]=/radar/images/layers/roads/NAT_roads.gif&overlays[]=/radar/images/layers/road_labels/nat_labs.gif&overlays[]=/radar/images/layers/additional_cities/nat_towns.gif&overlays[]=/radar/images/layers/default_cities/nat_towns.gif
 to radar-NAT-6.png
 dir=/home/annmarie/public_html/maps/radar/ -->
<!-- unable to reload radar-NAT-6.png (0.000 secs.) -->
<!-- Loading http://weatheroffice.gc.ca/radar/image.php?base=/data/radar/temp_image/COMPOSITE_NAT/COMPOSITE_NAT_PRECIP_SNOW_2010_01_18_16_40.GIF&overlays[]=/radar/images/layers/rivers/nat_rivers.gif&overlays[]=/radar/images/layers/roads/NAT_roads.gif&overlays[]=/radar/images/layers/road_labels/nat_labs.gif&overlays[]=/radar/images/layers/additional_cities/nat_towns.gif&overlays[]=/radar/images/layers/default_cities/nat_towns.gif
 to radar-NAT-7.png
 dir=/home/annmarie/public_html/maps/radar/ -->
<!-- unable to reload radar-NAT-7.png (0.000 secs.) -->
<!-- small image w=290 h=150 saved to radar-NAT-0-sm.png in 0.016 secs. -->
<!-- image files cached in 0.000 secs. -->
I suggest you change

$radarDir = './maps/radar/';

to be

$radarDir = '/maps/radar/';

also check your php.ini on your new site and make sure that

allow_url_fopen = on

is in there.
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 weathergirl

  • Forecaster
  • *****
  • Posts: 677
    • Beamsville Weather Station
Re: broken EC radar images
« Reply #4 on: January 18, 2010, 04:02:42 PM »
Thanks for your help, Ken. The php.ini is fine, and I'll make that change to the ec-radar.php script and let you know what happens.
Ann-Marie
Beamsville, Ontario, Canada

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9282
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: broken EC radar images
« Reply #5 on: January 18, 2010, 05:55:20 PM »
You may also need to delete the cache files in /maps/radar/ .. the permissions on the files may be preventing them being written by the PHP script (based on the old permissions on the /maps/radar/ directory).
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 weathergirl

  • Forecaster
  • *****
  • Posts: 677
    • Beamsville Weather Station
Re: broken EC radar images
« Reply #6 on: January 23, 2010, 12:41:08 PM »
I made the changes and I'm still getting broken images.  I have removed the page from my menu until I can rectify the problem.

« Last Edit: January 23, 2010, 08:58:10 PM by weathergirl »
Ann-Marie
Beamsville, Ontario, Canada

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9282
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: broken EC radar images
« Reply #7 on: January 24, 2010, 08:59:28 PM »
Hmmm... unfortunately, the  current code doesn't highlight the reason why the images are not being cached.  The code
Code: [Select]
function download_file($file_source,$file_dir, $file_target) {
// do a binary download and save to disk file locally
  $rh = fopen($file_source, 'rb');
  $wh = fopen($file_dir . $file_target, 'wb');
  if ($rh===false || $wh===false) {
   // error reading or opening file
    return false;
  }
  while (!feof($rh)) {
    if (fwrite($wh, fread($rh, 8192)) === FALSE) {
          // 'Download error: Cannot write to file ('.$file_target.')';
          return false;
    }
  }
  fclose($rh);
  fclose($wh);
  // No error
  return true;
}
is used to download the images, and a failure in either the first fopen() for the image file by URL, or the second fopen() for the local cache file can cause the message you are getting
Quote
<!-- unable to reload $radarCacheFile ($time_fetch secs.) -->

I suggest you change the function to read
Code: [Select]
function download_file($file_source,$file_dir, $file_target) {
// do a binary download and save to disk file locally
  error_reporting(E_ALL & ! E_NOTICE);
  $rh = fopen($file_source, 'rb');
  $wh = fopen($file_dir . $file_target, 'wb');
  if ($rh===false || $wh===false) {
   // error reading or opening file
    return false;
  }
  while (!feof($rh)) {
    if (fwrite($wh, fread($rh, 8192)) === FALSE) {
          // 'Download error: Cannot write to file ('.$file_target.')';
          return false;
    }
  }
  fclose($rh);
  fclose($wh);
  // No error
  return true;
}
and see what errors pop up.

Best regards,
Ken
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 weathergirl

  • Forecaster
  • *****
  • Posts: 677
    • Beamsville Weather Station
Re: broken EC radar images
« Reply #8 on: January 24, 2010, 09:05:38 PM »
Ken: Would it have anything to do with the fact that cURL is failing on my site? I just found out in another forum because some images produced by another software were not displaying data either, and I was told that was the reason.
Ann-Marie
Beamsville, Ontario, Canada

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9282
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: broken EC radar images
« Reply #9 on: January 24, 2010, 09:10:17 PM »
It could be symptomatic of a problem with HTTP access from your webserver to the internet .. however, the ec-radar (and ec-forecast) scripts don't use cURL.  Both scripts use the fconnect() function which seems to work ok for the the text of HTML pages from Environment Canada.  The ec-radar script uses the fopen() with an URL to binary read the radar image and binary write the image to a cache file.  Adding the error_reporting() in the function should show which of the two functions (read the EC graphic file, and/or write the cache file) is failing .. my bet is on the open the EC-graphic file from the webserver.  The change to error_reporting should show the underlying cause :)
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 weathergirl

  • Forecaster
  • *****
  • Posts: 677
    • Beamsville Weather Station
Re: broken EC radar images
« Reply #10 on: January 24, 2010, 09:20:09 PM »
OK, I changed the code.
Ann-Marie
Beamsville, Ontario, Canada

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9282
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: broken EC radar images
« Reply #11 on: January 24, 2010, 09:26:22 PM »
Oops... had the wrong syntax for the error_reporting()

It should read
Code: [Select]
error_reporting(E_ALL ^ E_NOTICE);
Sorry...
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 weathergirl

  • Forecaster
  • *****
  • Posts: 677
    • Beamsville Weather Station
Re: broken EC radar images
« Reply #12 on: January 24, 2010, 09:33:52 PM »
Ok, Ken, just changed the code.  Lots of errors:

http://www.beamsvillewx.ca/maps/ec-radar.php
« Last Edit: January 24, 2010, 09:50:51 PM by weathergirl »
Ann-Marie
Beamsville, Ontario, Canada

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9282
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: broken EC radar images
« Reply #13 on: January 24, 2010, 09:37:43 PM »
And... we have a cause:

Quote
Warning: fopen() [function.fopen]: URL file-access is disabled in the server configuration in /home/annmarie/public_html/maps/ec-radar.php  on line 509

So the allow_url_fopen = on is NOT being honored in your php.ini

You might try putting a php.ini in the /maps/ directory too with

allow_url_fopen = on

in it.
If that still doesn't work, time to contact your hoster and ask 'What's up with that?'
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 weathergirl

  • Forecaster
  • *****
  • Posts: 677
    • Beamsville Weather Station
Re: broken EC radar images
« Reply #14 on: January 24, 2010, 09:56:59 PM »
Nothing after adding the php.ini to the directory, so my webhost has been contacted. He is looking into it as I write this.
Thanks for your help, Ken :-) I thought it might be the server, the webhost has been performing upgrades lately, and his weather forum is looking great ;)
Ann-Marie
Beamsville, Ontario, Canada

Offline weathergirl

  • Forecaster
  • *****
  • Posts: 677
    • Beamsville Weather Station
Re: broken EC radar images
« Reply #15 on: January 24, 2010, 10:02:52 PM »
« Last Edit: January 24, 2010, 10:12:42 PM by weathergirl »
Ann-Marie
Beamsville, Ontario, Canada

Offline mackbig

  • Forecaster
  • *****
  • Posts: 4128
    • Mackie's Main Street, Unionville, ON Canada Weather
Re: broken EC radar images
« Reply #16 on: January 25, 2010, 06:35:03 AM »
Good thing you got EC working again, cause KBUF was down pretty much all weekend. 3-23 hours at a time.

Andrew

Andrew - Davis VP2+ 6163, serial weatherlink, wireless anemometer, running Weather Display.  Boltek PCI Stormtracker, Astrogenic Nexstorm, Strikestar - UNI, CWOP CW8618, GrLevel3, (Station 2 OS WMR968, VWS 13.01p09), Windows 7-64

Offline weathergirl

  • Forecaster
  • *****
  • Posts: 677
    • Beamsville Weather Station
Re: broken EC radar images
« Reply #17 on: January 25, 2010, 06:42:19 AM »
I know, Andrew. It was tense for awhile there ;) knowing this big rain event was coming and having no way of displaying it :-(
Ann-Marie
Beamsville, Ontario, Canada

Offline mackbig

  • Forecaster
  • *****
  • Posts: 4128
    • Mackie's Main Street, Unionville, ON Canada Weather
Re: broken EC radar images
« Reply #18 on: January 25, 2010, 06:49:30 AM »
I know, I thought it was my weekly (or so) issue where GR3 inexplicably stops polling for data... but after a manual restart Saturday morning I headed out skiing, and kept getting my email warnings that the file was not loaded.  got home to see that accorrding to nws, kbuf failed at 12:04utc... not up all day.  Then sunday it would come up for a few minutes/hours at a time.  It was even down when I left for work this morning, but I saw that it started cranking again at 5:55am

Andrew
« Last Edit: January 25, 2010, 06:55:07 AM by mackbig »

Andrew - Davis VP2+ 6163, serial weatherlink, wireless anemometer, running Weather Display.  Boltek PCI Stormtracker, Astrogenic Nexstorm, Strikestar - UNI, CWOP CW8618, GrLevel3, (Station 2 OS WMR968, VWS 13.01p09), Windows 7-64

Offline CNYWeather

  • Forecaster
  • *****
  • Posts: 2297
    • CNYWeather
Re: broken EC radar images
« Reply #19 on: January 25, 2010, 07:59:01 AM »
Is the Montague radar too far away for you guys when BUF is down?
Tony




Offline mackbig

  • Forecaster
  • *****
  • Posts: 4128
    • Mackie's Main Street, Unionville, ON Canada Weather
Re: broken EC radar images
« Reply #20 on: January 25, 2010, 08:11:26 AM »
Looks like it, not in front of GR3 right now, but it looks like the sweep from Montague only makes it to just past Trenton, which is about half way across Lake Ontario.  Even if it touched my location at its outer reaches, since 98% of our weather is west to east, would not really work.  Definitely would not hit Ann-Marie where she is.  She actually uses overlays from Detroit (and Cleveland I think) on hers as well to get a bigger west to east track.  We have our EC radar as a backup for the sites.

KBUF has a pretty good uptime from what I have seen.  From all my outages, I have only noticed KBUF to be the cause on one of them.

Andrew

Is the Montague radar too far away for you guys when BUF is down?

Andrew - Davis VP2+ 6163, serial weatherlink, wireless anemometer, running Weather Display.  Boltek PCI Stormtracker, Astrogenic Nexstorm, Strikestar - UNI, CWOP CW8618, GrLevel3, (Station 2 OS WMR968, VWS 13.01p09), Windows 7-64

Offline weathergirl

  • Forecaster
  • *****
  • Posts: 677
    • Beamsville Weather Station
Re: broken EC radar images
« Reply #21 on: January 25, 2010, 09:18:36 AM »
I also find that the King City radar displays what the KBUF radar, and my other overlays, can miss, such as precipitation further north of my location. That`s why I like to offer my visitors a choice of which radar to view :-)
Ann-Marie
Beamsville, Ontario, Canada

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9282
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: broken EC radar images
« Reply #22 on: January 25, 2010, 12:20:54 PM »
Looks like it's working now, Ann-Marie .. hoster must have fixed the issue :)
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 weathergirl

  • Forecaster
  • *****
  • Posts: 677
    • Beamsville Weather Station
Re: broken EC radar images
« Reply #23 on: January 25, 2010, 12:45:25 PM »
Yes, the radar works great now, Ken :)  I must say, my webhost is great. When or if there is a problem (fortunately rarely), he gets around to fixing it right away =D&gt;
Ann-Marie
Beamsville, Ontario, Canada

Offline mackbig

  • Forecaster
  • *****
  • Posts: 4128
    • Mackie's Main Street, Unionville, ON Canada Weather
Re: broken EC radar images
« Reply #24 on: January 26, 2010, 07:07:44 AM »
another 14 hour outage at kbuf just ended  [-o&lt;  sounds like someone needs a new cable modem  :lol:

"THE KBUF WSR88D IS EXPERIENCING PERIODIC COMMS FAILURE BETWEEN THE OFFICE AND TH
E RADAR SITE. COMMUNICATIONS AND NWS TECHNICIANS ARE WORKING ON THE PROBLEM...BU
T NO ESTIMATED RETURN TO SERVICE IS KNOWN AT THIS TIME. THE SPORADIC NATURE OF T
HE OUTAGE IS MAKING THE ASSESSMENT VERY DIFFICULT. SURROUNDING RADARS INCLUDE KC
LE...KPBZ...KCCX...KBGM...AND KTYX AS WELL AS ENVIRONEMENT CANADA KING CITY RADA
R. ***END OF MESSAGE*** HITCHCOCK"

Sounds like they use EC as an alternate too....

Andrew


I also find that the King City radar displays what the KBUF radar, and my other overlays, can miss, such as precipitation further north of my location. That`s why I like to offer my visitors a choice of which radar to view :-)

Andrew - Davis VP2+ 6163, serial weatherlink, wireless anemometer, running Weather Display.  Boltek PCI Stormtracker, Astrogenic Nexstorm, Strikestar - UNI, CWOP CW8618, GrLevel3, (Station 2 OS WMR968, VWS 13.01p09), Windows 7-64