caseyjhol / node-red-contrib-tplink

A collection of Node-RED nodes for TP-Link Smart Home devices
https://www.npmjs.com/package/node-red-contrib-tplink-iot
MIT License
16 stars 15 forks source link

Random plug shutoffs #39

Closed mobamoba closed 3 years ago

mobamoba commented 3 years ago

Describe the bug After a whole bunch of timeout and ECONNREFUSED errors, everything shuts off for a fraction of a second then restarts itself.

To Reproduce Steps to reproduce the behavior: I have no idea - it happens randomly.

Expected behavior If there's a timeout issue or something, the plugs should continue as they are and shouldn't shut off then turn back on upon resolving the TCP issue.

Desktop (please complete the following information):

Additional context Here's what's in my syslog prior to the fractional shutoff/immediate restart. My settings.js timeout is 15000ms but really this is more an issue of resilience in the face of a TCP error; also, I left all polling and connection intervals at default and if you look at the timestamps, it looks like the plugs are being spammed nonstop which, if that's the case, may be the related to the bug. As you can see, the plugs - and btw I have like 8 or 9 plugs and it's only happening on these 3 or 4 - timeout from x:x:33 then 15 seconds later at x:x:48 then 3 seconds later a whole bunch of ECONNREFUSED and EHOSTUNREACH at the end of which it corrects itselfs, shuts off the plugs (in this case my lights which is how I knew it was happening) then turns them back on then goes about working just fine for a while.

Sep 18 15:49:33 galliumos Node-RED[31629]: TCP 192.168.1.21:9999 Error: TCP Timeout after 15000ms Sep 18 15:49:33 galliumos Node-RED[31629]: 192.168.1.21:9999 {"system":{"get_sysinfo":{}}} Sep 18 15:49:33 galliumos Node-RED[31629]: at Timeout._onTimeout (/home/matt/.node-red/node_modules/tplink-smarthome-api/lib/network/tcp-socket.js:59:36) Sep 18 15:49:33 galliumos Node-RED[31629]: at listOnTimeout (internal/timers.js:549:17) Sep 18 15:49:33 galliumos Node-RED[31629]: at processTimers (internal/timers.js:492:7) Sep 18 15:49:33 galliumos Node-RED[31629]: [MP4 Modem] device.send() Error: TCP Timeout after 15000ms Sep 18 15:49:33 galliumos Node-RED[31629]: 192.168.1.21:9999 {"system":{"get_sysinfo":{}}} Sep 18 15:49:33 galliumos Node-RED[31629]: at Timeout._onTimeout (/home/matt/.node-red/node_modules/tplink-smarthome-api/lib/network/tcp-socket.js:59:36) Sep 18 15:49:33 galliumos Node-RED[31629]: at listOnTimeout (internal/timers.js:549:17) Sep 18 15:49:33 galliumos Node-RED[31629]: at processTimers (internal/timers.js:492:7) Sep 18 15:49:33 galliumos Node-RED[31629]: 18 Sep 15:49:33 - [error] Error: TCP Timeout after 15000ms Sep 18 15:49:33 galliumos Node-RED[31629]: 192.168.1.21:9999 {"system":{"get_sysinfo":{}}} Sep 18 15:49:33 galliumos Node-RED[31629]: TCP 192.168.1.13:9999 Error: TCP Timeout after 15000ms Sep 18 15:49:33 galliumos Node-RED[31629]: 192.168.1.13:9999 {"system":{"get_sysinfo":{}}} Sep 18 15:49:33 galliumos Node-RED[31629]: at Timeout._onTimeout (/home/matt/.node-red/node_modules/tplink-smarthome-api/lib/network/tcp-socket.js:59:36) Sep 18 15:49:33 galliumos Node-RED[31629]: at listOnTimeout (internal/timers.js:549:17) Sep 18 15:49:33 galliumos Node-RED[31629]: at processTimers (internal/timers.js:492:7) Sep 18 15:49:33 galliumos Node-RED[31629]: [MP Trunk] device.send() Error: TCP Timeout after 15000ms Sep 18 15:49:33 galliumos Node-RED[31629]: 192.168.1.13:9999 {"system":{"get_sysinfo":{}}} Sep 18 15:49:33 galliumos Node-RED[31629]: at Timeout._onTimeout (/home/matt/.node-red/node_modules/tplink-smarthome-api/lib/network/tcp-socket.js:59:36) Sep 18 15:49:33 galliumos Node-RED[31629]: at listOnTimeout (internal/timers.js:549:17) Sep 18 15:49:33 galliumos Node-RED[31629]: at processTimers (internal/timers.js:492:7) Sep 18 15:49:33 galliumos Node-RED[31629]: 18 Sep 15:49:33 - [error] Error: TCP Timeout after 15000ms Sep 18 15:49:33 galliumos Node-RED[31629]: 192.168.1.13:9999 {"system":{"get_sysinfo":{}}} Sep 18 15:49:33 galliumos Node-RED[31629]: TCP 192.168.1.19:9999 Error: TCP Timeout after 15000ms Sep 18 15:49:33 galliumos Node-RED[31629]: 192.168.1.19:9999 {"system":{"get_sysinfo":{}}} Sep 18 15:49:33 galliumos Node-RED[31629]: at Timeout._onTimeout (/home/matt/.node-red/node_modules/tplink-smarthome-api/lib/network/tcp-socket.js:59:36) Sep 18 15:49:33 galliumos Node-RED[31629]: at listOnTimeout (internal/timers.js:549:17) Sep 18 15:49:33 galliumos Node-RED[31629]: at processTimers (internal/timers.js:492:7) Sep 18 15:49:33 galliumos Node-RED[31629]: [MP2 Couch] device.send() Error: TCP Timeout after 15000ms Sep 18 15:49:33 galliumos Node-RED[31629]: 192.168.1.19:9999 {"system":{"get_sysinfo":{}}} Sep 18 15:49:33 galliumos Node-RED[31629]: at Timeout._onTimeout (/home/matt/.node-red/node_modules/tplink-smarthome-api/lib/network/tcp-socket.js:59:36) Sep 18 15:49:33 galliumos Node-RED[31629]: at listOnTimeout (internal/timers.js:549:17) Sep 18 15:49:33 galliumos Node-RED[31629]: at processTimers (internal/timers.js:492:7) Sep 18 15:49:33 galliumos Node-RED[31629]: 18 Sep 15:49:33 - [error] Error: TCP Timeout after 15000ms Sep 18 15:49:33 galliumos Node-RED[31629]: 192.168.1.19:9999 {"system":{"get_sysinfo":{}}} Sep 18 15:49:48 galliumos Node-RED[31629]: TCP 192.168.1.21:9999 Error: TCP Timeout after 15000ms Sep 18 15:49:48 galliumos Node-RED[31629]: 192.168.1.21:9999 {"system":{"get_sysinfo":{}}} Sep 18 15:49:48 galliumos Node-RED[31629]: at Timeout._onTimeout (/home/matt/.node-red/node_modules/tplink-smarthome-api/lib/network/tcp-socket.js:59:36) Sep 18 15:49:48 galliumos Node-RED[31629]: at listOnTimeout (internal/timers.js:549:17) Sep 18 15:49:48 galliumos Node-RED[31629]: at processTimers (internal/timers.js:492:7) Sep 18 15:49:48 galliumos Node-RED[31629]: [MP4 Modem] device.send() Error: TCP Timeout after 15000ms Sep 18 15:49:48 galliumos Node-RED[31629]: 192.168.1.21:9999 {"system":{"get_sysinfo":{}}} Sep 18 15:49:48 galliumos Node-RED[31629]: at Timeout._onTimeout (/home/matt/.node-red/node_modules/tplink-smarthome-api/lib/network/tcp-socket.js:59:36) Sep 18 15:49:48 galliumos Node-RED[31629]: at listOnTimeout (internal/timers.js:549:17) Sep 18 15:49:48 galliumos Node-RED[31629]: at processTimers (internal/timers.js:492:7) Sep 18 15:49:48 galliumos Node-RED[31629]: 18 Sep 15:49:48 - [error] Error: TCP Timeout after 15000ms Sep 18 15:49:48 galliumos Node-RED[31629]: 192.168.1.21:9999 {"system":{"get_sysinfo":{}}} Sep 18 15:49:48 galliumos Node-RED[31629]: TCP 192.168.1.13:9999 Error: TCP Timeout after 15000ms Sep 18 15:49:48 galliumos Node-RED[31629]: 192.168.1.13:9999 {"system":{"get_sysinfo":{}}} Sep 18 15:49:48 galliumos Node-RED[31629]: at Timeout._onTimeout (/home/matt/.node-red/node_modules/tplink-smarthome-api/lib/network/tcp-socket.js:59:36) Sep 18 15:49:48 galliumos Node-RED[31629]: at listOnTimeout (internal/timers.js:549:17) Sep 18 15:49:48 galliumos Node-RED[31629]: at processTimers (internal/timers.js:492:7) Sep 18 15:49:48 galliumos Node-RED[31629]: [MP Trunk] device.send() Error: TCP Timeout after 15000ms Sep 18 15:49:48 galliumos Node-RED[31629]: 192.168.1.13:9999 {"system":{"get_sysinfo":{}}} Sep 18 15:49:48 galliumos Node-RED[31629]: at Timeout._onTimeout (/home/matt/.node-red/node_modules/tplink-smarthome-api/lib/network/tcp-socket.js:59:36) Sep 18 15:49:48 galliumos Node-RED[31629]: at listOnTimeout (internal/timers.js:549:17) Sep 18 15:49:48 galliumos Node-RED[31629]: at processTimers (internal/timers.js:492:7) Sep 18 15:49:48 galliumos Node-RED[31629]: 18 Sep 15:49:48 - [error] Error: TCP Timeout after 15000ms Sep 18 15:49:48 galliumos Node-RED[31629]: 192.168.1.13:9999 {"system":{"get_sysinfo":{}}} Sep 18 15:49:48 galliumos Node-RED[31629]: TCP 192.168.1.19:9999 Error: TCP Timeout after 15000ms Sep 18 15:49:48 galliumos Node-RED[31629]: 192.168.1.19:9999 {"system":{"get_sysinfo":{}}} Sep 18 15:49:48 galliumos Node-RED[31629]: at Timeout._onTimeout (/home/matt/.node-red/node_modules/tplink-smarthome-api/lib/network/tcp-socket.js:59:36) Sep 18 15:49:48 galliumos Node-RED[31629]: at listOnTimeout (internal/timers.js:549:17) Sep 18 15:49:48 galliumos Node-RED[31629]: at processTimers (internal/timers.js:492:7) Sep 18 15:49:48 galliumos Node-RED[31629]: [MP2 Couch] device.send() Error: TCP Timeout after 15000ms Sep 18 15:49:48 galliumos Node-RED[31629]: 192.168.1.19:9999 {"system":{"get_sysinfo":{}}} Sep 18 15:49:48 galliumos Node-RED[31629]: at Timeout._onTimeout (/home/matt/.node-red/node_modules/tplink-smarthome-api/lib/network/tcp-socket.js:59:36) Sep 18 15:49:48 galliumos Node-RED[31629]: at listOnTimeout (internal/timers.js:549:17) Sep 18 15:49:48 galliumos Node-RED[31629]: at processTimers (internal/timers.js:492:7) Sep 18 15:49:48 galliumos Node-RED[31629]: 18 Sep 15:49:48 - [error] Error: TCP Timeout after 15000ms Sep 18 15:49:48 galliumos Node-RED[31629]: 192.168.1.19:9999 {"system":{"get_sysinfo":{}}} Sep 18 15:49:51 galliumos Node-RED[31629]: TCP 192.168.1.19:9999 Error: connect EHOSTUNREACH 192.168.1.19:9999 Sep 18 15:49:51 galliumos Node-RED[31629]: at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1141:16) { Sep 18 15:49:51 galliumos Node-RED[31629]: errno: 'EHOSTUNREACH', Sep 18 15:49:51 galliumos Node-RED[31629]: code: 'EHOSTUNREACH', Sep 18 15:49:51 galliumos Node-RED[31629]: syscall: 'connect', Sep 18 15:49:51 galliumos Node-RED[31629]: address: '192.168.1.19', Sep 18 15:49:51 galliumos Node-RED[31629]: port: 9999 Sep 18 15:49:51 galliumos Node-RED[31629]: } Sep 18 15:49:51 galliumos Node-RED[31629]: [MP2 Couch] device.send() Error: connect EHOSTUNREACH 192.168.1.19:9999 Sep 18 15:49:51 galliumos Node-RED[31629]: at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1141:16) { Sep 18 15:49:51 galliumos Node-RED[31629]: errno: 'EHOSTUNREACH', Sep 18 15:49:51 galliumos Node-RED[31629]: code: 'EHOSTUNREACH', Sep 18 15:49:51 galliumos Node-RED[31629]: syscall: 'connect', Sep 18 15:49:51 galliumos Node-RED[31629]: address: '192.168.1.19', Sep 18 15:49:51 galliumos Node-RED[31629]: port: 9999 Sep 18 15:49:51 galliumos Node-RED[31629]: } Sep 18 15:49:51 galliumos Node-RED[31629]: TCP 192.168.1.13:9999 Error: connect EHOSTUNREACH 192.168.1.13:9999 Sep 18 15:49:51 galliumos Node-RED[31629]: at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1141:16) { Sep 18 15:49:51 galliumos Node-RED[31629]: errno: 'EHOSTUNREACH', Sep 18 15:49:51 galliumos Node-RED[31629]: code: 'EHOSTUNREACH', Sep 18 15:49:51 galliumos Node-RED[31629]: syscall: 'connect', Sep 18 15:49:51 galliumos Node-RED[31629]: address: '192.168.1.13', Sep 18 15:49:51 galliumos Node-RED[31629]: port: 9999 Sep 18 15:49:51 galliumos Node-RED[31629]: } Sep 18 15:49:51 galliumos Node-RED[31629]: [MP Trunk] device.send() Error: connect EHOSTUNREACH 192.168.1.13:9999 Sep 18 15:49:51 galliumos Node-RED[31629]: at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1141:16) { Sep 18 15:49:51 galliumos Node-RED[31629]: errno: 'EHOSTUNREACH', Sep 18 15:49:51 galliumos Node-RED[31629]: code: 'EHOSTUNREACH', Sep 18 15:49:51 galliumos Node-RED[31629]: syscall: 'connect', Sep 18 15:49:51 galliumos Node-RED[31629]: address: '192.168.1.13', Sep 18 15:49:51 galliumos Node-RED[31629]: port: 9999 Sep 18 15:49:51 galliumos Node-RED[31629]: } Sep 18 15:49:51 galliumos Node-RED[31629]: TCP 192.168.1.21:9999 Error: connect EHOSTUNREACH 192.168.1.21:9999 Sep 18 15:49:51 galliumos Node-RED[31629]: at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1141:16) { Sep 18 15:49:51 galliumos Node-RED[31629]: errno: 'EHOSTUNREACH', Sep 18 15:49:51 galliumos Node-RED[31629]: code: 'EHOSTUNREACH', Sep 18 15:49:51 galliumos Node-RED[31629]: syscall: 'connect', Sep 18 15:49:51 galliumos Node-RED[31629]: address: '192.168.1.21', Sep 18 15:49:51 galliumos Node-RED[31629]: port: 9999 Sep 18 15:49:51 galliumos Node-RED[31629]: } Sep 18 15:49:51 galliumos Node-RED[31629]: [MP4 Modem] device.send() Error: connect EHOSTUNREACH 192.168.1.21:9999 Sep 18 15:49:51 galliumos Node-RED[31629]: at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1141:16) { Sep 18 15:49:51 galliumos Node-RED[31629]: errno: 'EHOSTUNREACH', Sep 18 15:49:51 galliumos Node-RED[31629]: code: 'EHOSTUNREACH', Sep 18 15:49:51 galliumos Node-RED[31629]: syscall: 'connect', Sep 18 15:49:51 galliumos Node-RED[31629]: address: '192.168.1.21', Sep 18 15:49:51 galliumos Node-RED[31629]: port: 9999 Sep 18 15:49:51 galliumos Node-RED[31629]: } Sep 18 15:49:51 galliumos Node-RED[31629]: TCP 192.168.1.13:9999 Error: connect ECONNREFUSED 192.168.1.13:9999 Sep 18 15:49:51 galliumos Node-RED[31629]: at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1141:16) { Sep 18 15:49:51 galliumos Node-RED[31629]: errno: 'ECONNREFUSED', Sep 18 15:49:51 galliumos Node-RED[31629]: code: 'ECONNREFUSED', Sep 18 15:49:51 galliumos Node-RED[31629]: syscall: 'connect', Sep 18 15:49:51 galliumos Node-RED[31629]: address: '192.168.1.13', Sep 18 15:49:51 galliumos Node-RED[31629]: port: 9999 Sep 18 15:49:51 galliumos Node-RED[31629]: } Sep 18 15:49:51 galliumos Node-RED[31629]: [MP Trunk] device.send() Error: connect ECONNREFUSED 192.168.1.13:9999 Sep 18 15:49:51 galliumos Node-RED[31629]: at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1141:16) { Sep 18 15:49:51 galliumos Node-RED[31629]: errno: 'ECONNREFUSED', Sep 18 15:49:51 galliumos Node-RED[31629]: code: 'ECONNREFUSED', Sep 18 15:49:51 galliumos Node-RED[31629]: syscall: 'connect', Sep 18 15:49:51 galliumos Node-RED[31629]: address: '192.168.1.13', Sep 18 15:49:51 galliumos Node-RED[31629]: port: 9999 Sep 18 15:49:51 galliumos Node-RED[31629]: } Sep 18 15:49:51 galliumos Node-RED[31629]: 18 Sep 15:49:51 - [error] Error: connect ECONNREFUSED 192.168.1.13:9999 Sep 18 15:49:51 galliumos Node-RED[31629]: TCP 192.168.1.13:9999 Error: connect ECONNREFUSED 192.168.1.13:9999 Sep 18 15:49:51 galliumos Node-RED[31629]: at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1141:16) { Sep 18 15:49:51 galliumos Node-RED[31629]: errno: 'ECONNREFUSED', Sep 18 15:49:51 galliumos Node-RED[31629]: code: 'ECONNREFUSED', Sep 18 15:49:51 galliumos Node-RED[31629]: syscall: 'connect', Sep 18 15:49:51 galliumos Node-RED[31629]: address: '192.168.1.13', Sep 18 15:49:51 galliumos Node-RED[31629]: port: 9999 Sep 18 15:49:51 galliumos Node-RED[31629]: } Sep 18 15:49:51 galliumos Node-RED[31629]: [MP Trunk] device.send() Error: connect ECONNREFUSED 192.168.1.13:9999 Sep 18 15:49:51 galliumos Node-RED[31629]: at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1141:16) { Sep 18 15:49:51 galliumos Node-RED[31629]: errno: 'ECONNREFUSED', Sep 18 15:49:51 galliumos Node-RED[31629]: code: 'ECONNREFUSED', Sep 18 15:49:51 galliumos Node-RED[31629]: syscall: 'connect', Sep 18 15:49:51 galliumos Node-RED[31629]: address: '192.168.1.13', Sep 18 15:49:51 galliumos Node-RED[31629]: port: 9999 Sep 18 15:49:51 galliumos Node-RED[31629]: } Sep 18 15:49:51 galliumos Node-RED[31629]: TCP 192.168.1.13:9999 Error: connect ECONNREFUSED 192.168.1.13:9999 Sep 18 15:49:51 galliumos Node-RED[31629]: at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1141:16) { Sep 18 15:49:51 galliumos Node-RED[31629]: errno: 'ECONNREFUSED', Sep 18 15:49:51 galliumos Node-RED[31629]: code: 'ECONNREFUSED', Sep 18 15:49:51 galliumos Node-RED[31629]: syscall: 'connect', Sep 18 15:49:51 galliumos Node-RED[31629]: address: '192.168.1.13', Sep 18 15:49:51 galliumos Node-RED[31629]: port: 9999 Sep 18 15:49:51 galliumos Node-RED[31629]: } Sep 18 15:49:51 galliumos Node-RED[31629]: [MP Trunk] device.send() Error: connect ECONNREFUSED 192.168.1.13:9999 Sep 18 15:49:51 galliumos Node-RED[31629]: at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1141:16) { Sep 18 15:49:51 galliumos Node-RED[31629]: errno: 'ECONNREFUSED', Sep 18 15:49:51 galliumos Node-RED[31629]: code: 'ECONNREFUSED', Sep 18 15:49:51 galliumos Node-RED[31629]: syscall: 'connect', Sep 18 15:49:51 galliumos Node-RED[31629]: address: '192.168.1.13', Sep 18 15:49:51 galliumos Node-RED[31629]: port: 9999 Sep 18 15:49:51 galliumos Node-RED[31629]: } Sep 18 15:49:51 galliumos Node-RED[31629]: 18 Sep 15:49:51 - [error] Error: connect ECONNREFUSED 192.168.1.13:9999 Sep 18 15:49:52 galliumos Node-RED[31629]: TCP 192.168.1.19:9999 Error: connect ECONNREFUSED 192.168.1.19:9999 Sep 18 15:49:52 galliumos Node-RED[31629]: at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1141:16) { Sep 18 15:49:52 galliumos Node-RED[31629]: errno: 'ECONNREFUSED', Sep 18 15:49:52 galliumos Node-RED[31629]: code: 'ECONNREFUSED', Sep 18 15:49:52 galliumos Node-RED[31629]: syscall: 'connect', Sep 18 15:49:52 galliumos Node-RED[31629]: address: '192.168.1.19', Sep 18 15:49:52 galliumos Node-RED[31629]: port: 9999 Sep 18 15:49:52 galliumos Node-RED[31629]: } Sep 18 15:49:52 galliumos Node-RED[31629]: [MP2 Couch] device.send() Error: connect ECONNREFUSED 192.168.1.19:9999 Sep 18 15:49:52 galliumos Node-RED[31629]: at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1141:16) { Sep 18 15:49:52 galliumos Node-RED[31629]: errno: 'ECONNREFUSED', Sep 18 15:49:52 galliumos Node-RED[31629]: code: 'ECONNREFUSED', Sep 18 15:49:52 galliumos Node-RED[31629]: syscall: 'connect', Sep 18 15:49:52 galliumos Node-RED[31629]: address: '192.168.1.19', Sep 18 15:49:52 galliumos Node-RED[31629]: port: 9999 Sep 18 15:49:52 galliumos Node-RED[31629]: } Sep 18 15:49:52 galliumos Node-RED[31629]: 18 Sep 15:49:52 - [error] Error: connect ECONNREFUSED 192.168.1.19:9999 Sep 18 15:49:52 galliumos Node-RED[31629]: TCP 192.168.1.19:9999 Error: connect ECONNREFUSED 192.168.1.19:9999 Sep 18 15:49:52 galliumos Node-RED[31629]: at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1141:16) { Sep 18 15:49:52 galliumos Node-RED[31629]: errno: 'ECONNREFUSED', Sep 18 15:49:52 galliumos Node-RED[31629]: code: 'ECONNREFUSED', Sep 18 15:49:52 galliumos Node-RED[31629]: syscall: 'connect', Sep 18 15:49:52 galliumos Node-RED[31629]: address: '192.168.1.19', Sep 18 15:49:52 galliumos Node-RED[31629]: port: 9999 Sep 18 15:49:52 galliumos Node-RED[31629]: } Sep 18 15:49:52 galliumos Node-RED[31629]: [MP2 Couch] device.send() Error: connect ECONNREFUSED 192.168.1.19:9999 Sep 18 15:49:52 galliumos Node-RED[31629]: at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1141:16) { Sep 18 15:49:52 galliumos Node-RED[31629]: errno: 'ECONNREFUSED', Sep 18 15:49:52 galliumos Node-RED[31629]: code: 'ECONNREFUSED', Sep 18 15:49:52 galliumos Node-RED[31629]: syscall: 'connect', Sep 18 15:49:52 galliumos Node-RED[31629]: address: '192.168.1.19', Sep 18 15:49:52 galliumos Node-RED[31629]: port: 9999 Sep 18 15:49:52 galliumos Node-RED[31629]: } Sep 18 15:49:52 galliumos Node-RED[31629]: TCP 192.168.1.19:9999 Error: connect ECONNREFUSED 192.168.1.19:9999 Sep 18 15:49:52 galliumos Node-RED[31629]: at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1141:16) { Sep 18 15:49:52 galliumos Node-RED[31629]: errno: 'ECONNREFUSED', Sep 18 15:49:52 galliumos Node-RED[31629]: code: 'ECONNREFUSED', Sep 18 15:49:52 galliumos Node-RED[31629]: syscall: 'connect', Sep 18 15:49:52 galliumos Node-RED[31629]: address: '192.168.1.19', Sep 18 15:49:52 galliumos Node-RED[31629]: port: 9999 Sep 18 15:49:52 galliumos Node-RED[31629]: } Sep 18 15:49:52 galliumos Node-RED[31629]: [MP2 Couch] device.send() Error: connect ECONNREFUSED 192.168.1.19:9999 Sep 18 15:49:52 galliumos Node-RED[31629]: at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1141:16) { Sep 18 15:49:52 galliumos Node-RED[31629]: errno: 'ECONNREFUSED', Sep 18 15:49:52 galliumos Node-RED[31629]: code: 'ECONNREFUSED', Sep 18 15:49:52 galliumos Node-RED[31629]: syscall: 'connect', Sep 18 15:49:52 galliumos Node-RED[31629]: address: '192.168.1.19', Sep 18 15:49:52 galliumos Node-RED[31629]: port: 9999 Sep 18 15:49:52 galliumos Node-RED[31629]: } Sep 18 15:49:52 galliumos Node-RED[31629]: 18 Sep 15:49:52 - [error] Error: connect ECONNREFUSED 192.168.1.19:9999 Sep 18 15:49:53 galliumos Node-RED[31629]: TCP 192.168.1.21:9999 Error: connect ECONNREFUSED 192.168.1.21:9999 Sep 18 15:49:53 galliumos Node-RED[31629]: at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1141:16) { Sep 18 15:49:53 galliumos Node-RED[31629]: errno: 'ECONNREFUSED', Sep 18 15:49:53 galliumos Node-RED[31629]: code: 'ECONNREFUSED', Sep 18 15:49:53 galliumos Node-RED[31629]: syscall: 'connect', Sep 18 15:49:53 galliumos Node-RED[31629]: address: '192.168.1.21', Sep 18 15:49:53 galliumos Node-RED[31629]: port: 9999 Sep 18 15:49:53 galliumos Node-RED[31629]: } Sep 18 15:49:53 galliumos Node-RED[31629]: [MP4 Modem] device.send() Error: connect ECONNREFUSED 192.168.1.21:9999 Sep 18 15:49:53 galliumos Node-RED[31629]: at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1141:16) { Sep 18 15:49:53 galliumos Node-RED[31629]: errno: 'ECONNREFUSED', Sep 18 15:49:53 galliumos Node-RED[31629]: code: 'ECONNREFUSED', Sep 18 15:49:53 galliumos Node-RED[31629]: syscall: 'connect', Sep 18 15:49:53 galliumos Node-RED[31629]: address: '192.168.1.21', Sep 18 15:49:53 galliumos Node-RED[31629]: port: 9999 Sep 18 15:49:53 galliumos Node-RED[31629]: } Sep 18 15:49:53 galliumos Node-RED[31629]: 18 Sep 15:49:53 - [error] Error: connect ECONNREFUSED 192.168.1.21:9999 Sep 18 15:49:53 galliumos Node-RED[31629]: TCP 192.168.1.21:9999 Error: connect ECONNREFUSED 192.168.1.21:9999 Sep 18 15:49:53 galliumos Node-RED[31629]: at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1141:16) { Sep 18 15:49:53 galliumos Node-RED[31629]: errno: 'ECONNREFUSED', Sep 18 15:49:53 galliumos Node-RED[31629]: code: 'ECONNREFUSED', Sep 18 15:49:53 galliumos Node-RED[31629]: syscall: 'connect', Sep 18 15:49:53 galliumos Node-RED[31629]: address: '192.168.1.21', Sep 18 15:49:53 galliumos Node-RED[31629]: port: 9999 Sep 18 15:49:53 galliumos Node-RED[31629]: } Sep 18 15:49:53 galliumos Node-RED[31629]: [MP4 Modem] device.send() Error: connect ECONNREFUSED 192.168.1.21:9999 Sep 18 15:49:53 galliumos Node-RED[31629]: at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1141:16) { Sep 18 15:49:53 galliumos Node-RED[31629]: errno: 'ECONNREFUSED', Sep 18 15:49:53 galliumos Node-RED[31629]: code: 'ECONNREFUSED', Sep 18 15:49:53 galliumos Node-RED[31629]: syscall: 'connect', Sep 18 15:49:53 galliumos Node-RED[31629]: address: '192.168.1.21', Sep 18 15:49:53 galliumos Node-RED[31629]: port: 9999 Sep 18 15:49:53 galliumos Node-RED[31629]: } Sep 18 15:49:53 galliumos Node-RED[31629]: TCP 192.168.1.21:9999 Error: connect ECONNREFUSED 192.168.1.21:9999 Sep 18 15:49:53 galliumos Node-RED[31629]: at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1141:16) { Sep 18 15:49:53 galliumos Node-RED[31629]: errno: 'ECONNREFUSED', Sep 18 15:49:53 galliumos Node-RED[31629]: code: 'ECONNREFUSED', Sep 18 15:49:53 galliumos Node-RED[31629]: syscall: 'connect', Sep 18 15:49:53 galliumos Node-RED[31629]: address: '192.168.1.21', Sep 18 15:49:53 galliumos Node-RED[31629]: port: 9999 Sep 18 15:49:53 galliumos Node-RED[31629]: } Sep 18 15:49:53 galliumos Node-RED[31629]: [MP4 Modem] device.send() Error: connect ECONNREFUSED 192.168.1.21:9999 Sep 18 15:49:53 galliumos Node-RED[31629]: at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1141:16) { Sep 18 15:49:53 galliumos Node-RED[31629]: errno: 'ECONNREFUSED', Sep 18 15:49:53 galliumos Node-RED[31629]: code: 'ECONNREFUSED', Sep 18 15:49:53 galliumos Node-RED[31629]: syscall: 'connect', Sep 18 15:49:53 galliumos Node-RED[31629]: address: '192.168.1.21', Sep 18 15:49:53 galliumos Node-RED[31629]: port: 9999 Sep 18 15:49:53 galliumos Node-RED[31629]: } Sep 18 15:49:53 galliumos Node-RED[31629]: 18 Sep 15:49:53 - [error] Error: connect ECONNREFUSED 192.168.1.21:9999

hufftheweevil commented 3 years ago

Just to make sure I understand this correctly, you're saying this does not happen after trying to control the lights? In other words, they are turning off/on without your input?

Also, how many of these nodes are you using? I'm just curious.

mobamoba commented 3 years ago

Correct. It happens when I'm doing absolutely nothing - sitting in my living room and then my lights randomly turn off then back on. They change state in the split second when the error is resolved, though it seems to my mind that the node should just ignore the error and do nothing when the error resolves itself.

I have 3 HS110s and 6 HS103s. I've only seen this off/on error with the HS103s.

hufftheweevil commented 3 years ago

Nothing in this node, nor the underlying library should be turning the plugs off/on without direction from the user. Occasionally there are some connection issues, which usually resolve themselves on next poll. But it should never trigger the light to toggle.

I had some issues with a HS300 strip a while back where it would do exactly what you're describing to all 6 plugs on the strip. This was way before I was even using Node-RED. In the last several months it has been much more rare, maybe occurring once every other week or so. I had always figured there was some firmware update that TP-Link did to mediate the issue.

How often is it occurring for you? Does it happen with all of your HS103s at the same time? Only some of them? Are you connecting to the switches using other methods at the same time, for example, using Home Assistant?

mobamoba commented 3 years ago

It occurs randomly and, when it happens, it 3 or 4 HS103s at the same time. I don't have anything other than Node Red hooked up to them and even in the Kasa app they're Local Only.

I've had several of my HS110s randomly forget the Wifi network (the Kasa forum is filled with people complaining about the same problem so it's clearly a firmware/hardware issue) but, when they do, they remain in whatever state they were in before the "forgetting" happened and the Node Red errors are just about being unreachable.

With this, the on/off occurred in conjunction with the resolution of the ECONNREFUSED error which is why I thought the on/off was coming from the node since otherwise it just seems too coincidental that the chose that exact moment to turn on/off. I hear you that it might be a firmware issue independent of Node Red but I wasn't seeing any other errors nor a loss of Wifi or anything like that so assumed that it was something between NR and the plug.

hufftheweevil commented 3 years ago

Obviously nothing has changed, but I'm curious if you are still having this issue or have tracked it down to anything else?

mobamoba commented 3 years ago

I haven't but then again Kasa pushed a firmware update between when I posted and now so perhaps that took care of it?

hufftheweevil commented 3 years ago

Great! Let us know if you have any other issues