EC FORECAST

Post Reply
iquebecs58
Observer
Observer
Posts: 11
Joined: Mon Oct 02, 2017 10:14 am
Location: St-Alphonse
Station model: Davis Pro 2
Software: Weather Display
Contact:

EC FORECAST

Post by iquebecs58 » Sun Nov 26, 2017 3:21 pm

Hi,
since the last week, the EC forecast not working anymore...

Thanks.

Steven
Météorologue amateur/ amateur meteorologist: Steven Villeneuve
St-Alphonse-de-Caplan, Gaspésie
Station WU: IQUEBECS58
CoCoRaHS : CAN-QC-5
CWOP : E1397
Facebook/Twitter : Météo St-Alphonse
Site: www.meteostalphonse.com
Site foudre/Lightning site :www.meteostalphonse.com/nexstorm/StormS ... tation.htm
Courriel/Email: info@meteostalphonse.com

BlueBear
Forecaster
Forecaster
Posts: 101
Joined: Sun Aug 20, 2017 1:04 pm
Location: Sanford, Manitoba, Canada
Station model: Davis VP2
Software: WeeWx
Contact:

Re: EC FORECAST

Post by BlueBear » Sun Nov 26, 2017 6:07 pm

I had the same problem, go into the settings file for the ecForecast block and change from http://etc to https://etc
Should then work!
Bill

iquebecs58
Observer
Observer
Posts: 11
Joined: Mon Oct 02, 2017 10:14 am
Location: St-Alphonse
Station model: Davis Pro 2
Software: Weather Display
Contact:

Re: EC FORECAST

Post by iquebecs58 » Sun Nov 26, 2017 7:48 pm

I've try that Bill and still the same result :(
Météorologue amateur/ amateur meteorologist: Steven Villeneuve
St-Alphonse-de-Caplan, Gaspésie
Station WU: IQUEBECS58
CoCoRaHS : CAN-QC-5
CWOP : E1397
Facebook/Twitter : Météo St-Alphonse
Site: www.meteostalphonse.com
Site foudre/Lightning site :www.meteostalphonse.com/nexstorm/StormS ... tation.htm
Courriel/Email: info@meteostalphonse.com

BlueBear
Forecaster
Forecaster
Posts: 101
Joined: Sun Aug 20, 2017 1:04 pm
Location: Sanford, Manitoba, Canada
Station model: Davis VP2
Software: WeeWx
Contact:

Re: EC FORECAST

Post by BlueBear » Sun Nov 26, 2017 7:56 pm

Did you clear the cache?
If not give it a hour or so and see if it changes!

iquebecs58
Observer
Observer
Posts: 11
Joined: Mon Oct 02, 2017 10:14 am
Location: St-Alphonse
Station model: Davis Pro 2
Software: Weather Display
Contact:

Re: EC FORECAST

Post by iquebecs58 » Mon Nov 27, 2017 11:31 am

Hmmmmm, Empty the cache, updated to the 2.1 and still not working
Météorologue amateur/ amateur meteorologist: Steven Villeneuve
St-Alphonse-de-Caplan, Gaspésie
Station WU: IQUEBECS58
CoCoRaHS : CAN-QC-5
CWOP : E1397
Facebook/Twitter : Météo St-Alphonse
Site: www.meteostalphonse.com
Site foudre/Lightning site :www.meteostalphonse.com/nexstorm/StormS ... tation.htm
Courriel/Email: info@meteostalphonse.com

User avatar
Jachym
Site Admin
Site Admin
Posts: 1686
Joined: Fri Aug 18, 2017 10:12 pm
Location: Brno, Czech Republic
Station model: WH1080
Software: Meteobridge
Contact:

Re: EC FORECAST

Post by Jachym » Mon Nov 27, 2017 12:12 pm

Again.... I think EC is sort of playing a game with developers. They obviously dont want anyone using their data so they change the format every few months. I posted about this in August when they changed it again. 3 months forward and here we go again...

User avatar
PaulMy
Observer
Observer
Posts: 30
Joined: Mon Aug 21, 2017 12:48 pm
Location: Komoka, Ontario Canada
Station model: Davis VP2 Wireless 6152
Software: Cumulus
Contact:

Re: EC FORECAST

Post by PaulMy » Mon Nov 27, 2017 5:40 pm

I have updated to v2.3 and changed the url to
https://meteo.gc.ca/city/pages/on-137_metric_f.html and https://weather.gc.ca/city/pages/on-137_metric_e.html

also cleared the Cache.

Unfortunately the block does not work http://www.komokaweather.com/j-template/indexMobile.php

Paul

BlueBear
Forecaster
Forecaster
Posts: 101
Joined: Sun Aug 20, 2017 1:04 pm
Location: Sanford, Manitoba, Canada
Station model: Davis VP2
Software: WeeWx
Contact:

Re: EC FORECAST

Post by BlueBear » Mon Nov 27, 2017 6:28 pm

Strange I updated this morning and it's working here

http://www.sanfordweather.com/meteo/indexDesktop.php

Bill

User avatar
Jachym
Site Admin
Site Admin
Posts: 1686
Joined: Fri Aug 18, 2017 10:12 pm
Location: Brno, Czech Republic
Station model: WH1080
Software: Meteobridge
Contact:

Re: EC FORECAST

Post by Jachym » Mon Nov 27, 2017 8:27 pm

PaulMy wrote: Mon Nov 27, 2017 5:40 pm I have updated to v2.3 and changed the url to
https://meteo.gc.ca/city/pages/on-137_metric_f.html and https://weather.gc.ca/city/pages/on-137_metric_e.html

also cleared the Cache.

Unfortunately the block does not work http://www.komokaweather.com/j-template/indexMobile.php

Paul
Hi Paul,
go to the block folder via FTP, delete the content of the Cache folder. Reload your page and then look inside the file created in the cache folder, and post here the content of this file

User avatar
PaulMy
Observer
Observer
Posts: 30
Joined: Mon Aug 21, 2017 12:48 pm
Location: Komoka, Ontario Canada
Station model: Davis VP2 Wireless 6152
Software: Cumulus
Contact:

Re: EC FORECAST

Post by PaulMy » Mon Nov 27, 2017 8:45 pm

Hi Jachym, sorry, been away for a couple of hours...
I have deleted cache, load page, new cache created but it was empty.
Permissions where at 705, so changed all to 777, removed cache, reload and cache was saved but still empty. Have redone a couple of times with the same result.

Paul

User avatar
Jachym
Site Admin
Site Admin
Posts: 1686
Joined: Fri Aug 18, 2017 10:12 pm
Location: Brno, Czech Republic
Station model: WH1080
Software: Meteobridge
Contact:

Re: EC FORECAST

Post by Jachym » Tue Nov 28, 2017 12:05 am

Hmm.... did you ever have problems with loading data from EC or loading data from HTTPS sites? One of the changes now was that they migrated to https. I remember some Canadian users had problems loading data from EC (yes absurd I know). But I cant remember if it was you in particular

User avatar
PaulMy
Observer
Observer
Posts: 30
Joined: Mon Aug 21, 2017 12:48 pm
Location: Komoka, Ontario Canada
Station model: Davis VP2 Wireless 6152
Software: Cumulus
Contact:

Re: EC FORECAST

Post by PaulMy » Tue Nov 28, 2017 12:57 am

Hi Jaquim,
Going back to February 2016 v1.0, there was some problem with EC Forecast for me and other Canadian users, which you resolved. Don't recall exactly, but doubt it was https at that time. I have not had any issue since that time. Not aware of any other https issues, https://weather.gc.ca/city/pages/on-137_metric_e.html loads fine for me me.

Paul

User avatar
Jachym
Site Admin
Site Admin
Posts: 1686
Joined: Fri Aug 18, 2017 10:12 pm
Location: Brno, Czech Republic
Station model: WH1080
Software: Meteobridge
Contact:

Re: EC FORECAST

Post by Jachym » Tue Nov 28, 2017 10:11 am

Hmmm

the function used by this script tries both methods (file_get_contents and cURL). It tries one and if it fails, it tries the other one.

Before trying to find any issues with the script we need to determine whether it is loading something from EC or not at all, in which case Im afraid there wont be much we can do.

Create a script "test.php" and upload it to your template root folder (next to indexDesktop.php). Then try running it in a browser and see if you get any output.

The script should have the following code:

Code: Select all

require("scripts/functions.php");
$data = loadContent("https://weather.gc.ca/city/pages/on-137_metric_e.html");
echo "Loaded data:<br>".$data;

BlueBear
Forecaster
Forecaster
Posts: 101
Joined: Sun Aug 20, 2017 1:04 pm
Location: Sanford, Manitoba, Canada
Station model: Davis VP2
Software: WeeWx
Contact:

Re: EC FORECAST

Post by BlueBear » Tue Nov 28, 2017 2:23 pm

I wonder if it isn't a hosting issue?

The ec forecast block runs fine here and I noticed that the currentCA block isn't working on Paul page either but it does here?????

http://www.sanfordweather.com/meteo/indexDesktop.php

Jachym, I tried to run the test script you show above but could not get it to work, suspect it's just a code snippet and I'm too dumb this morning to figure out what's missing!

User avatar
Jachym
Site Admin
Site Admin
Posts: 1686
Joined: Fri Aug 18, 2017 10:12 pm
Location: Brno, Czech Republic
Station model: WH1080
Software: Meteobridge
Contact:

Re: EC FORECAST

Post by Jachym » Tue Nov 28, 2017 2:51 pm

Sorry, I forgot, the above code is a PHP code so it needs to be insed a php tag like this

<?php

....code....

?>

BlueBear
Forecaster
Forecaster
Posts: 101
Joined: Sun Aug 20, 2017 1:04 pm
Location: Sanford, Manitoba, Canada
Station model: Davis VP2
Software: WeeWx
Contact:

Re: EC FORECAST

Post by BlueBear » Tue Nov 28, 2017 3:30 pm

Interesting this is the result I get

Error, contact the developer.

Here is the contents of my test.php file

<?php

require("scripts/functions.php");
$data = loadContent("https://weather.gc.ca/city/pages/on-137_metric_e.html");
echo "Loaded data:<br>".$data;

?>

User avatar
Jachym
Site Admin
Site Admin
Posts: 1686
Joined: Fri Aug 18, 2017 10:12 pm
Location: Brno, Czech Republic
Station model: WH1080
Software: Meteobridge
Contact:

Re: EC FORECAST

Post by Jachym » Tue Nov 28, 2017 3:47 pm

ok I see, yes, that´s because it is not loading the footer.

Then use this instead

Code: Select all

<?php

$data = loadContent("https://weather.gc.ca/city/pages/on-137_metric_e.html",10);
echo "Loaded data:<br>".$data;

function loadContent($url,$timeout){
		$ch = curl_init();
		curl_setopt($ch, CURLOPT_HEADER, 0);
		curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
		curl_setopt($ch, CURLOPT_URL, $url);
		curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
		curl_setopt($ch, CURLOPT_USERAGENT,"Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36");
		$data = curl_exec($ch);
		curl_close($ch);

		if($data==""){
			$data = file_get_contents($url);
		}

		return $data;
	}
?>


BlueBear
Forecaster
Forecaster
Posts: 101
Joined: Sun Aug 20, 2017 1:04 pm
Location: Sanford, Manitoba, Canada
Station model: Davis VP2
Software: WeeWx
Contact:

Re: EC FORECAST

Post by BlueBear » Tue Nov 28, 2017 4:03 pm

That works see: http://www.sanfordweather.com/meteo/test.php

now to see if Paul gets the same resultt

User avatar
PaulMy
Observer
Observer
Posts: 30
Joined: Mon Aug 21, 2017 12:48 pm
Location: Komoka, Ontario Canada
Station model: Davis VP2 Wireless 6152
Software: Cumulus
Contact:

Re: EC FORECAST

Post by PaulMy » Tue Nov 28, 2017 4:17 pm

I got this result:
Warning: file_get_contents(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed in /home/content/96/5379896/html/j-template/test.php on line 17

Warning: file_get_contents(): Failed to enable crypto in /home/content/96/5379896/html/j-template/test.php on line 17

Warning: file_get_contents(https://weather.gc.ca/city/pages/on-137_metric_e.html): failed to open stream: operation failed in /home/content/96/5379896/html/j-template/test.php on line 17
Loaded data:
Paul

User avatar
Jachym
Site Admin
Site Admin
Posts: 1686
Joined: Fri Aug 18, 2017 10:12 pm
Location: Brno, Czech Republic
Station model: WH1080
Software: Meteobridge
Contact:

Re: EC FORECAST

Post by Jachym » Tue Nov 28, 2017 4:45 pm

OK, so this looks like communication problem, Im afraid I will not be able to help you with this Paul

iquebecs58
Observer
Observer
Posts: 11
Joined: Mon Oct 02, 2017 10:14 am
Location: St-Alphonse
Station model: Davis Pro 2
Software: Weather Display
Contact:

Re: EC FORECAST

Post by iquebecs58 » Wed Nov 29, 2017 10:50 am

Jachym wrote: Mon Nov 27, 2017 12:12 pm Again.... I think EC is sort of playing a game with developers. They obviously dont want anyone using their data so they change the format every few months. I posted about this in August when they changed it again. 3 months forward and here we go again...
Just not the EC website that they are changing the format. They do so with others Government's Canada website.

I guess they are scared that the weather site could be hacked... :lol:

Post Reply