josecastroleon / pimatic-weather

Pimatic Plugin to retrieve Weather forecast
1 stars 3 forks source link

Errors on startup #11

Open Flop2006 opened 9 years ago

Flop2006 commented 9 years ago

Hi,

When I (re)start pimatic, I get the following errors:

16:04:52.822 [pimatic-weather] error: ETIMEDOUT
16:04:52.882 [pimatic-weather] error: err is not defined
16:04:53.312 [pimatic] error: Could not get attribute value of Wetter Hausen.status: ETIMEDOUT
16:04:53.322 [pimatic] error: Could not get attribute value of Wetter Hausen.windspeed: ETIMEDOUT
16:04:53.332 [pimatic] error: Could not get attribute value of Wetter Hausen.temperature: ETIMEDOUT
16:04:53.344 [pimatic] error: Could not get attribute value of Wetter Hausen.humidity: ETIMEDOUT
16:04:53.362 [pimatic] warn: Could not update variable weather.status: ETIMEDOUT
16:04:53.372 [pimatic] warn: Could not update variable weather.windspeed: ETIMEDOUT
16:04:53.382 [pimatic] warn: Could not update variable weather.temperature: ETIMEDOUT
16:04:53.392 [pimatic] warn: Could not update variable weather.humidity: ETIMEDOUT
16:04:53.402 [pimatic] error: Could not get attribute value of Wettervorhersage Hausen.forecast: err is not defined
16:04:53.412 [pimatic] error: Could not get attribute value of Wettervorhersage Hausen.low: err is not defined
16:04:53.422 [pimatic] error: Could not get attribute value of Wettervorhersage Hausen.high: err is not defined
16:04:53.432 [pimatic] error: Could not get attribute value of Wettervorhersage Hausen.precipitation: err is not defined
16:04:53.446 [pimatic] warn: Could not update variable forecast.forecast: err is not defined
16:04:53.456 [pimatic] warn: Could not update variable forecast.low: err is not defined
16:04:53.466 [pimatic] warn: Could not update variable forecast.high: err is not defined
16:04:53.476 [pimatic] warn: Could not update variable forecast.precipitation: err is not defined

After a while the weather info is updated perfectly fine.

I configured it as follows:

    {
      "id": "weather",
      "class": "WeatherDevice",
      "name": "Wetter Hausen",
      "location": "Fussingen, Deutschland",
      "degreeType": "C",
      "timeout": 300000
    },
    {
      "id": "forecast",
      "class": "WeatherForecastDevice",
      "name": "Wettervorhersage Hausen",
      "location": "Fussingen, Deutschland",
      "degreeType": "C",
      "timeout": 300000,
      "day": 1
    }

Is there anything I can do about this?

Kind regards, Flop

DDNRN commented 9 years ago

Same here since some days. Now even pimatic dosn't start up while plugin is activated, had to delete weather-plugin from config to get pimatic running again.

thymian commented 9 years ago

I got the same issue. Any solution?

josecastroleon commented 9 years ago

I am having a look

josecastroleon commented 9 years ago

I've just pushed a fix for the errors while starting up on master and npm, Could you give it a try? From time to time it throws ETIMEOUT while requesting the weather/forecast this is due to the underlying library that times out on the HTTP GET request (10000 ms).

josecastroleon commented 9 years ago

I've also increased the timeout on the request, now it should be much more difficult to have ETIMEMOUT errors on version (0.8.11)

Flop2006 commented 9 years ago

With the new version sometimes I get this error:

14:52:05.174 [pimatic-weather] error: Request failed (408)
14:52:05.445 [pimatic-weather] error: Request failed (408)
josecastroleon commented 9 years ago

The error 408 (Request Timeout Error) means the request sent to the website server took longer than the website's server was prepared to wait. In other words, your connection with the web site "timed out". Which is the timeout you configured on your devices?

Flop2006 commented 9 years ago

The timeout for the weather and forecast device in the pimatic config is 300000. The default timeout in the device-config-scheme is 60000 and the defTimeout in weather.js is 10000.

josecastroleon commented 9 years ago

The timeout configured in your config.json is set up as the one going to weather.js

Flop2006 commented 9 years ago

Set the timeout to 600000 but still error at start of the raspberry. But with the new version only on startup of the raspberry! This is the debug log:

11.02.2015 16:13:20 debug [pimatic-weather]: Error: Request failed (408) at maybeWrapAsError (/home/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/main/util.js:118:12) at PromiseResolver$_callback (/home/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/main/promise_resolver.js:54:50) at Request._callback (/home/pimatic-app/node_modules/weather-js/lib/weather.js:46:41) at Request.self.callback (/home/pimatic-app/node_modules/weather-js/node_modules/request/request.js:344:22) at Request.EventEmitter.emit (events.js:98:17) at Request.<anonymous> (/home/pimatic-app/node_modules/weather-js/node_modules/request/request.js:1239:14) at Request.EventEmitter.emit (events.js:117:20) at IncomingMessage.<anonymous> (/home/pimatic-app/node_modules/weather-js/node_modules/request/request.js:1187:12) at IncomingMessage.EventEmitter.emit (events.js:117:20) at _stream_readable.js:920:16 at process._tickCallback (node.js:415:13)
16:13:20 debug [pimatic-weather]: Error: Request failed (408) at maybeWrapAsError (/home/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/main/util.js:118:12) at PromiseResolver$_callback (/home/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/main/promise_resolver.js:54:50) at Request._callback (/home/pimatic-app/node_modules/weather-js/lib/weather.js:46:41) at Request.self.callback (/home/pimatic-app/node_modules/weather-js/node_modules/request/request.js:344:22) at Request.EventEmitter.emit (events.js:98:17) at Request.<anonymous> (/home/pimatic-app/node_modules/weather-js/node_modules/request/request.js:1239:14) at Request.EventEmitter.emit (events.js:117:20) at IncomingMessage.<anonymous> (/home/pimatic-app/node_modules/weather-js/node_modules/request/request.js:1187:12) at IncomingMessage.EventEmitter.emit (events.js:117:20) at _stream_readable.js:920:16 at process._tickCallback (node.js:415:13)
Flop2006 commented 9 years ago

Today i got this error:

12.02.2015 10:55:29 debug [pimatic-weather]: Error: getaddrinfo ENOTFOUND at errnoException (dns.js:37:11) at Object.onanswer [as oncomplete] (dns.js:124:16)
10:55:29 error [pimatic-weather]: getaddrinfo ENOTFOUND
josecastroleon commented 9 years ago

408 errors are on server side (msn.com) ENOTFOUND errors are on dns side unable to resolve msn.com address. I don't think i can do something to workaround this...