ivesdebruycker / node-red-contrib-maxcube

A node-red node to control the eQ-3 Max! Cube
Other
13 stars 12 forks source link

Crash on failed connection attempt & losing connection after a while. #14

Open jessevl opened 7 years ago

jessevl commented 7 years ago

Hi,

I seem to have two related problems with this node and I'm having a hard time figuring out how it could be fixed:

  1. Whenever another application is connected to the Max Cube (e.g. the desktop app) the node fails to connect. While I know is a limitation of the cube itself, in my instance the entire Node-Red Docker container goes down because of this unhandled exception (logs):

2016-12-30 21:24:02 { [Error: connect ETIMEDOUT 192.168.0.49:62910] 2016-12-30 21:24:02   code: 'ETIMEDOUT', 2016-12-30 21:24:02   errno: 'ETIMEDOUT', 2016-12-30 21:24:02   syscall: 'connect', 2016-12-30 21:24:02   address: '192.168.0.49', 2016-12-30 21:24:02   port: 62910 } 2016-12-30 21:24:02 30 Dec 21:24:02 - [red] Uncaught Exception: 2016-12-30 21:24:02 30 Dec 21:24:02 - Error: Uncaught, unspecified "error" event. (undefined) 2016-12-30 21:24:02     at MaxCubeLowLevel.emit (events.js:144:17) 2016-12-30 21:24:02     at Socket. (/data/node_modules/node-red-contrib-maxcube/node_modules/maxcube/maxcube-lowlevel.js:46:10) 2016-12-30 21:24:02     at emitOne (events.js:77:13) 2016-12-30 21:24:02     at Socket.emit (events.js:169:7) 2016-12-30 21:24:02     at emitErrorNT (net.js:1269:8) 2016-12-30 21:24:02     at nextTickCallbackWith2Args (node.js:442:9) 2016-12-30 21:24:02     at process._tickCallback (node.js:356:17) 2016-12-30 21:24:02 2016-12-30 21:24:02 npm info node-red-docker@0.14.4 Failed to exec start script 2016-12-30 21:24:02 npm ERR! Linux 3.10.77 2016-12-30 21:24:02 npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "start" "--" "--userDir" "/data" 2016-12-30 21:24:02 npm ERR! node v4.4.7 2016-12-30 21:24:02 npm ERR! npm  v2.15.8 2016-12-30 21:24:02 npm ERR! code ELIFECYCLE 2016-12-30 21:24:02 npm ERR! node-red-docker@0.14.4 start: node $NODE_OPTIONS node_modules/node-red/red.js -v $FLOWS "--userDir" "/data" 2016-12-30 21:24:02 npm ERR! Exit status 1 2016-12-30 21:24:02 npm ERR!  2016-12-30 21:24:02 npm ERR! Failed at the node-red-docker@0.14.4 start script 'node $NODE_OPTIONS node_modules/node-red/red.js -v $FLOWS "--userDir" "/data"'. 2016-12-30 21:24:02 npm ERR! This is most likely a problem with the node-red-docker package, 2016-12-30 21:24:02 npm ERR! not with npm itself. 2016-12-30 21:24:02 npm ERR! Tell the author that this fails on your system: 2016-12-30 21:24:02 npm ERR!     node $NODE_OPTIONS node_modules/node-red/red.js -v $FLOWS "--userDir" "/data" 2016-12-30 21:24:02 npm ERR! You can get information on how to open an issue for this project with: 2016-12-30 21:24:02 npm ERR!     npm bugs node-red-docker 2016-12-30 21:24:02 npm ERR! Or if that isn't available, you can get their info via: 2016-12-30 21:24:02 npm ERR!  2016-12-30 21:24:02 npm ERR!     npm owner ls node-red-docker 2016-12-30 21:24:02 npm ERR! There is likely additional logging output above. 2016-12-30 21:24:02  2016-12-30 21:24:02 npm ERR! Please include the following file with any support request: 2016-12-30 21:24:02 npm ERR!     /usr/src/node-red/npm-debug.log

  1. Another issue that I seem to be having is that even when not using any other applications it will disconnect from node-red after a time (an hour or so maybe) and won't reconnect automatically afterwards. Node-Red won't crash in that case, but commands will fail. The log output is like this:

2016-12-31 10:43:17,stdout,31 Dec 10:43:17 - [error] [maxcube out:b53a8714.1bfd48] Error: Maxcube not initialised 2016-12-31 10:43:16,stdout,31 Dec 10:43:16 - [error] [maxcube in:f19f204d.16c07] Error: Maxcube not initialised

Is there something I'm doing wrong?

Thanks! Jesse

dude2k commented 7 years ago

Same here, looses connection. "Error: Maxcube not initialised"

am78 commented 6 years ago

Same Error Here. Die anybody found a solution already?

feldi740 commented 6 years ago

Yep, error still exists. Only chance to get the rest of Node-Red working is to delete the config node and re-deploy. Already tried the "/maxcube" fix from the pull request by pvgennip (adding the handler into ~/.node-red/node_modules/maxcube/maxcube-lowlevel.js) but it doesn't seem to solve the issue in case of node-red-contrib-maxcube. Please provide a fix because it is causing the whole home-automation to stop working if the maxcube becomes offline. Thanks.