Giter Site home page Giter Site logo

Unhandled 'error' about netatmo HOT 6 CLOSED

karbassi avatar karbassi commented on September 18, 2024
Unhandled 'error'

from netatmo.

Comments (6)

karbassi avatar karbassi commented on September 18, 2024

@cflurin I can't seem to replicate this, but based on this comment, it may be that your have an invalid code, expired code, or missing args.

The Netatmo documentation states that the invalid_grant error is shown "In case of error (invalid code, expired code, missing args)"

Update the test.js auth variable and run npm test in this project root. What do you get? Can you paste me logs?

from netatmo.

cflurin avatar cflurin commented on September 18, 2024

@karbassi:
Thanks for your reply.
Actually I'm using node-red-contrib-netatmo-dashboard that uses your netatmo.js, generally it works but sometimes it crashes.

Do you mean the Catching Errors and Warnings code? if yes, I reproduced the issue setting a wrong password, here is the logs:

Netatmo threw an error: Error: Authenticate error: invalid_grant

from netatmo.

cflurin avatar cflurin commented on September 18, 2024

... I used your original test.js (to reproduce the error I've set a wrong password):

pi@rpi4:~/netatmo-test/node_modules/netatmo $ node test
(node:8459) Warning: Possible EventEmitter memory leak detected. 11 authenticated listeners added. Use emitter.setMaxListeners() to increase limit
events.js:160
      throw er; // Unhandled 'error' event
      ^

Error: Authenticate error: invalid_grant
    at netatmo.handleRequestError (/home/pi/netatmo-test/node_modules/netatmo/netatmo.js:46:15)
    at .<anonymous> (/home/pi/netatmo-test/node_modules/netatmo/netatmo.js:115:19)
    at Request.self.callback (/home/pi/netatmo-test/node_modules/request/request.js:186:22)
    at emitTwo (events.js:106:13)
    at Request.emit (events.js:191:7)
    at Request.<anonymous> (/home/pi/netatmo-test/node_modules/request/request.js:1081:10)
    at emitOne (events.js:96:13)
    at Request.emit (events.js:188:7)
    at IncomingMessage.<anonymous> (/home/pi/netatmo-test/node_modules/request/request.js:1001:12)
    at IncomingMessage.g (events.js:286:16)

from netatmo.

karbassi avatar karbassi commented on September 18, 2024

What happens when you use the right password?

from netatmo.

cflurin avatar cflurin commented on September 18, 2024

It works perfectly, but as I said above with node-red-contrib-netatmo-dashboard I request the data every 10 minutes, this works for a long time (days) until node-red crashes with:

Error: Authenticate error: invalid_grant

from netatmo.

cflurin avatar cflurin commented on September 18, 2024

... I've added this code:

      api.on("error", function(error) {
        node.error('Netatmo threw an error: ' + error);
      });

to node-red-contrib-netatmo-dashboard on my test system. It seems to work.

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.