felixls / node-red-contrib-tplink-smarthome

A collection of node-red nodes for TP-Link Smart Home devices
MIT License
8 stars 29 forks source link

Smartbulb TCP Timeouts when not switched on #13

Open 877dev opened 4 years ago

877dev commented 4 years ago

My 16GB SDscard quickly filled up withe 8GB of log files, due to adding the smartbulb to one of my flows. I'm not sure of the exact issue.

Here is a small sample of the logs, literally tens of thousands of entries....

Oct 25 19:30:50 raspberrypi Node-RED[347]: TCP Timeout
Oct 25 19:30:57 raspberrypi Node-RED[347]: (node:347) UnhandledPromiseRejectionWarning: Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client
Oct 25 19:30:57 raspberrypi Node-RED[347]:     at ServerResponse.setHeader (_http_outgoing.js:470:11)
Oct 25 19:30:57 raspberrypi Node-RED[347]:     at ServerResponse.header (/usr/lib/node_modules/node-red/node_modules/express/lib/response.js:767:10)
Oct 25 19:30:57 raspberrypi Node-RED[347]:     at ServerResponse.send (/usr/lib/node_modules/node-red/node_modules/express/lib/response.js:170:12)
Oct 25 19:30:57 raspberrypi Node-RED[347]:     at client.getDevice.then.catch.error (/home/pi/.node-red/node_modules/node-red-contrib-tplink-smarthome/smart-plug.js:291:27)
Oct 25 19:30:57 raspberrypi Node-RED[347]:     at process._tickCallback (internal/process/next_tick.js:68:7)
Oct 25 19:30:57 raspberrypi Node-RED[347]: (node:347) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
Oct 25 19:30:57 raspberrypi Node-RED[347]: (node:347) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Oct 25 19:30:57 raspberrypi Node-RED[347]: (node:347) UnhandledPromiseRejectionWarning: Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client
Oct 25 19:30:57 raspberrypi Node-RED[347]:     at ServerResponse.setHeader (_http_outgoing.js:470:11)
Oct 25 19:30:57 raspberrypi Node-RED[347]:     at ServerResponse.header (/usr/lib/node_modules/node-red/node_modules/express/lib/response.js:767:10)
Oct 25 19:30:57 raspberrypi Node-RED[347]:     at ServerResponse.send (/usr/lib/node_modules/node-red/node_modules/express/lib/response.js:170:12)
Oct 25 19:30:57 raspberrypi Node-RED[347]:     at client.getDevice.then.catch.error (/home/pi/.node-red/node_modules/node-red-contrib-tplink-smarthome/smart-bulb.js:247:27)
Oct 25 19:30:57 raspberrypi Node-RED[347]:     at process._tickCallback (internal/process/next_tick.js:68:7)
Oct 25 19:30:57 raspberrypi Node-RED[347]: (node:347) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
Oct 25 19:30:59 raspberrypi Node-RED[347]: TCP Timeout
grumpazoid commented 3 years ago

Same problem here. Lots of errors to log when bulb is turned off at the mains. I get "Error: TCP Timeout" in the node red debug.