alguevara7 / homebridge-ssh

SSH plugin for homebridge: https://github.com/nfarina/homebridge
51 stars 14 forks source link

keeps crashing #11

Open KennyVB opened 8 years ago

KennyVB commented 8 years ago

/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/util/once.js:11 throw new Error("This callback function has already been called by someone else; it can only be called one time."); ^

Error: This callback function has already been called by someone else; it can only be called one time. at /usr/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/util/once.js:11:13 at null. (/usr/lib/node_modules/homebridge-ssh/index.js:74:5) at emitOne (events.js:77:13) at emit (events.js:169:7) at readableAddChunk (/usr/lib/node_modules/homebridge-ssh/node_modules/readable-stream/lib/_stream_readable.js:201:16) at Readable.push (/usr/lib/node_modules/homebridge-ssh/node_modules/readable-stream/lib/_stream_readable.js:165:10) at Duplexify._forward (/usr/lib/node_modules/homebridge-ssh/node_modules/duplexify/index.js:162:26) at Channel.onreadable (/usr/lib/node_modules/homebridge-ssh/node_modules/duplexify/index.js:126:10) at emitNone (events.js:67:13) at Channel.emit (events.js:166:7)

alguevara7 commented 8 years ago

I'll take a look later in today. Which version on node / os are you running on ?

mtk64 commented 8 years ago

i get the same problem right now, running on "Debian GNU/Linux 7 (wheezy)":

/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/util/once.js:11 throw new Error("This callback function has already been called by someone else; it can only be called one time."); ^

Error: This callback function has already been called by someone else; it can only be called one time. at /usr/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/util/once.js:11:13 at null. (/usr/lib/node_modules/homebridge-ssh/index.js:74:5) at emitOne (events.js:77:13) at emit (events.js:169:7) at readableAddChunk (/usr/lib/node_modules/homebridge-ssh/node_modules/readable-stream/lib/_stream_readable.js:201:16) at Readable.push (/usr/lib/node_modules/homebridge-ssh/node_modules/readable-stream/lib/_stream_readable.js:165:10) at Duplexify._forward (/usr/lib/node_modules/homebridge-ssh/node_modules/duplexify/index.js:162:26) at Channel.onreadable (/usr/lib/node_modules/homebridge-ssh/node_modules/duplexify/index.js:126:10) at emitNone (events.js:67:13) at Channel.emit (events.js:166:7)

already made some npm install -g homebridge-ssh to update, but no change :-(

feel free to ask for more details if necessary :-)

regards michael

mtk64 commented 8 years ago

just identified the configuration which is producing the problem. just removed that section and it sems to work. just calling to bash scripts setting a switch and a variable within my homeautomation. { "accessory": "SSH", "name": "Flur LED", "on": "/aio/daheim-Devices Wohnzimmer LED-Flur On;/aio/daheim-Variable Status IR_LED_Flur on", "off": "/aio/daheim-Devices Wohnzimmer LED-Flur Off;/aio/daheim-Variable Status IR_LED_Flur off", "state": "/aio/daheim-Variable Status IR_LED_Flur", "on_value" : "on", "exact_match": true, "ssh": { "user": "root", "host": "127.0.0.1", "port": 22, ... will examine more .... michael

mtk64 commented 8 years ago

fixed with pipe to grep 'on' | wc -l and expecting only one value. So it seems the expected "on_value" has to match exactly like described in the line below, my mistake! But the exception handling of the plugin code could be better and should not crash the homebridge. Maybe you might improve that :-)

  {
          "accessory": "SSH",
          "name": "Flur LED",
          "on": "/aio/daheim-Devices Wohnzimmer LED-Flur On;/aio/daheim-Variable Status IR_LED_Flur on",
          "off": "/aio/daheim-Devices Wohnzimmer LED-Flur Off;/aio/daheim-Variable Status IR_LED_Flur off",
          "state": "/aio/daheim-Variable Status IR_LED_Flur| grep 'on' | wc -l",
          "on_value" : "2",
          "exact_match": true,
          "ssh": {

...

alguevara7 commented 8 years ago

yes that's a good point. there is really no exception handling at all at this point in time, I think I will have time this weekend to cobble something :) thanks for posting this issue.