sinricpro / nodejs-sdk

Nodejs library for https://sinric.pro
11 stars 7 forks source link

Connection seems to be lost after some time #11

Closed SteffenKn closed 3 years ago

SteffenKn commented 3 years ago

I have a few devices that I control via Alexa. The programs all run 24/7. After some time (a few hours to days) the connection seems to get lost. Then the devices no longer respond to voice commands and Alexa just says "device xy is not responding". Here is an example of my implementation: https://github.com/SteffenKn/WS2801-alexa/blob/develop/src/alexa-device-handler.ts

kakopappa commented 3 years ago

@imdhanush seems we need a WebSocket disconnection callback similar to https://github.com/sinricpro/esp8266-esp32-sdk/blob/master/examples/Switch/Switch/Switch.ino#L112 to detect disconnections from the server

thegoliathgeek commented 3 years ago

Please refer to this example. Update the sdk to the latest version.

SteffenKn commented 3 years ago

I have tested this for a few days and it seems to work. Thanks for the quick fix.