Giter Site home page Giter Site logo

Comments (15)

cflurin avatar cflurin commented on September 18, 2024

It works again without any changes. I suppose there was an issue with the server.

from netatmo.

skrollme avatar skrollme commented on September 18, 2024

I sometimes get this, too. But then, it do not work for at least 1 or 2 days. Could this be a API-Limit problem? Too many request per time?

from netatmo.

karbassi avatar karbassi commented on September 18, 2024

@skrollme it could be. The code returns No response when the server sends nothing back but with an error status.

If this happens to you again, could you catch the server response to the format of the response. I've noticed inconsistent API patterns with this API.

from netatmo.

skrollme avatar skrollme commented on September 18, 2024

I will give my best, @karbassi. After the last "soft ban" I reduced the apps which were allowed to access my netatmo-account. IFTTT, WeatherUnderground, MacToolbar-Widget, ... all gone.

from netatmo.

cflurin avatar cflurin commented on September 18, 2024

Currently I'm facing this error often again.
I'm using https://github.com/guidone/node-red-contrib-netatmo-dashboard (dependency: netatmo).

from netatmo.

skrollme avatar skrollme commented on September 18, 2024

It seems that there are some server problems at netatmo's api (see their support-account at twitter). For me its sometimes working, sometimes not...

from netatmo.

cflurin avatar cflurin commented on September 18, 2024

It's quite annoying. I'm working on the node-red-node in order to handle this error properly.

from netatmo.

skrollme avatar skrollme commented on September 18, 2024

@karbassi I can currently reproduce the problem:

pi@raspberrypi:~/nodetest $ node test.js 
events.js:160
      throw er; // Unhandled 'error' event
      ^

Error: Authenticate error: No response
    at netatmo.handleRequestError (/home/pi/nodetest/node_modules/netatmo/netatmo.js:46:15)
    at netatmo.<anonymous> (/home/pi/nodetest/node_modules/netatmo/netatmo.js:115:19)
    at self.callback (/home/pi/nodetest/node_modules/request/request.js:188:22)
    at emitOne (events.js:96:13)
    at Request.emit (events.js:188:7)
    at Request.onRequestError (/home/pi/nodetest/node_modules/request/request.js:884:8)
    at emitOne (events.js:96:13)
    at ClientRequest.emit (events.js:188:7)
    at TLSSocket.socketErrorListener (_http_client.js:309:9)
    at emitOne (events.js:96:13)

The response - right before calling this.handleRequestError - is undefined when logged via console.log(response)

The case was reproduced via an simple test-script:

var netatmo = require('netatmo');

var auth = {
	"client_id": "123456789",
	"client_secret": "12345678901234567890",
	"username": "mail@me",
	"password": "password"
};

var api = new netatmo(auth);

api.getStationsData(function(err, devices) {
  console.log(devices);
});

from netatmo.

cflurin avatar cflurin commented on September 18, 2024

@skrollme
have a look here: https://github.com/karbassi/netatmo#catching-errors-and-warnings

from netatmo.

skrollme avatar skrollme commented on September 18, 2024

@karbassi thanks, I will try it next time the problem occurs. currently the netatmo api works for me again.

from netatmo.

karbassi avatar karbassi commented on September 18, 2024

Glad it's all been straightened out. 👍 😄

from netatmo.

skrollme avatar skrollme commented on September 18, 2024

I got an answer from Netatmo Support to my questions about possible soft bans, API limits, and so on. Besides the Rate Limits page you probably already know he writes this. Just in case you are interested:

...
and yes, your IP address could get banned for 24h, if it exceeded 30 requests that tend to 4xx errors within a minute. In order to solve this issue, we advise to follow the recommendations below:

  • Spread your user requests, do not make all your request at the same time every X minutes. Spread the load per user.
  • When you do a Oauth2, you receive an expires_in value that tell you when the token expires. With this information, you will have to anticipate and refresh the token before doing any requests.
  • If an error 4xx is received please make sure not to repeat the request, rather show an error message in the App in order to correct this issue before redoing the request.

from netatmo.

paaland avatar paaland commented on September 18, 2024

Seems to me they have been having problems with one of their servers.

$nslookup api.netatmo.net
Name:    api.netatmo.net
Addresses:  195.154.172.147
          195.154.179.238

They seem to rely on DNS round-robin to handle load balancing. The problem is that when the first server is down the netatmo node package does not continue and try the next one. This actually seems to be an issue with node as it caches the DNS lookup and keeps trying the first IP forever.

wget and curl goes on and tries the next one if the first does not work. If you could build some sort of error handling that goes on to the next server in your API that would be great.

from netatmo.

cflurin avatar cflurin commented on September 18, 2024

I'm receiving two error messages:

Authenticate error: Status code503"

and

getStationsDataError error: Status code503

The interval is 5 minutes!

from netatmo.

karbassi avatar karbassi commented on September 18, 2024

@skrollme I'd welcome a PR for throttling API requests. Such as limiting the SDK to make X API requests in Y seconds.

E.g.: 10 requests in 1 minute.

@paaland Could you submit a PR with your suggested changes for me to look at?

from netatmo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.