howanghk / homebridge-ewelink

Homebridge plugin to control Sonoff relays with OEM firmware
MIT License
81 stars 46 forks source link

Homebridge crashes #25

Closed cecildaniel2003 closed 5 years ago

cecildaniel2003 commented 5 years ago

Randomly Homebridge stops with the below error. How do I fix this ?

send hb to: 0x0000000003732a9c {"id":-1,"method":"get_prop","params":["power","bright","rgb"]} send hb to: 0x00000000049e6502 {"id":-1,"method":"get_prop","params":["power","bright","rgb"]} [2019-4-26 16:22:01] [eWeLink] WebSocket messge received: {"action":"update","deviceid":"10001dec5c","apikey":"ee8e6771-c24c-4e13-9f0c-f0621a15ff1e","userAgent":"app","sequence":"1556275921617","ts":0,"params":{"switch":"off","partnerApikey":"0917e393-9612-48e8-be55-634b3b8444ea"},"tempRec":"10001dec5c"} [2019-4-26 16:22:01] [eWeLink] Updating recorded Characteristic.On for [Corner lamp] to [false]. No request will be sent to the device. [2019-4-26 16:22:01] [eWeLink] Setting power state to [off] for device [Corner lamp] [2019-4-26 16:22:01] [eWeLink] WebSocket messge received: {"action":"update","deviceid":"10001d9433","apikey":"ee8e6771-c24c-4e13-9f0c-f0621a15ff1e","userAgent":"app","sequence":"1556275921741","ts":0,"params":{"switch":"off","partnerApikey":"203c03f8-29c8-4419-b7f4-f1cef30c1294"},"tempRec":"10001d9433"} [2019-4-26 16:22:01] [eWeLink] Updating recorded Characteristic.On for [Hall fan 1] to [false]. No request will be sent to the device. [2019-4-26 16:22:01] [eWeLink] Setting power state to [off] for device [Hall fan 1] [2019-4-26 16:22:01] [eWeLink] WebSocket messge received: {"action":"update","deviceid":"100016fca0","apikey":"ee8e6771-c24c-4e13-9f0c-f0621a15ff1e","userAgent":"app","sequence":"1556275921747","ts":0,"params":{"switch":"off","partnerApikey":"b2c8e8ca-3ce3-44a3-bf52-f8b7dea44f77"},"tempRec":"100016fca0"} [2019-4-26 16:22:01] [eWeLink] Updating recorded Characteristic.On for [chandelier] to [false]. No request will be sent to the device. [2019-4-26 16:22:01] [eWeLink] Setting power state to [off] for device [chandelier] [2019-4-26 16:22:01] [eWeLink] WebSocket messge received: {"action":"update","deviceid":"10001dec5d","apikey":"ee8e6771-c24c-4e13-9f0c-f0621a15ff1e","userAgent":"app","sequence":"1556275921761","ts":0,"params":{"switch":"off","partnerApikey":"e41c2216-aab9-4cf2-a1d7-338c2e2e8278"},"tempRec":"10001dec5d"} [2019-4-26 16:22:01] [eWeLink] Updating recorded Characteristic.On for [Hall fan 2] to [false]. No request will be sent to the device. [2019-4-26 16:22:01] [eWeLink] Setting power state to [off] for device [Hall fan 2] [2019-4-26 16:22:01] [eWeLink] WebSocket was closed. Reason [1006] [2019-4-26 16:22:01] Error: not opened at WebSocket.send (/usr/lib/node_modules/homebridge-ewelink-max/node_modules/ws/lib/WebSocket.js:360:18) at WebSocketClient.send (/usr/lib/node_modules/homebridge-ewelink-max/index.js:879:23) at Timeout._onTimeout (/usr/lib/node_modules/homebridge-ewelink-max/index.js:589:26) at ontimeout (timers.js:498:11) at tryOnTimeout (timers.js:323:5) at Timer.listOnTimeout (timers.js:290:5)

[2019-4-26 16:22:01] Got SIGTERM, shutting down Homebridge... [2019-4-26 16:22:01] Error: not opened at WebSocket.send (/usr/lib/node_modules/homebridge-ewelink-max/node_modules/ws/lib/WebSocket.js:360:18) at WebSocketClient.send (/usr/lib/node_modules/homebridge-ewelink-max/index.js:879:23) at Timeout._onTimeout (/usr/lib/node_modules/homebridge-ewelink-max/index.js:589:26) at ontimeout (timers.js:498:11) at tryOnTimeout (timers.js:323:5) at Timer.listOnTimeout (timers.js:290:5) at listOnTimeoutNT (timers.js:369:26) at _combinedTickCallback (internal/process/next_tick.js:136:11) at process._tickCallback (internal/process/next_tick.js:181:9)

send hb to: 0x0000000003dd600e

howanghk commented 5 years ago

Hi @cecildaniel2003, from the log it seems you stopped homebridge normally, and this is not a crash at all.

[2019-4-26 16:22:01] Got SIGTERM, shutting down Homebridge...
cecildaniel2003 commented 5 years ago

Hi @howanghk, unfortunately no i did not kill home bridge it just shut's down by itself. I have to re-start homebridge after this to make it all work again.

howanghk commented 5 years ago

Hi @cecildaniel2003, your hombridge got a termination signal and it shutdown normally. It might not be you but there is something (an external process?) that issued the signal to tell homebridge to stop. The not opened error was there because the socket was closed when the homebridge-ewelink-max plugin try to send data. This is most likely caused by network error, either your internet connection was not stable at that time, or there was something wrong with the ewelink server. This is not a critical issue as the plugin will auto reconnect to the websocket and eventually it will work. Therefore this error can be safely ignored.

cecildaniel2003 commented 5 years ago

@howanghk oh okay. Thanks a ton :)