AlexanderBabel / homebridge-irobot-roomba

[INACTIVE] Homebridge Plugin for Roomba 800 and 900 series
Apache License 2.0
4 stars 4 forks source link

Incorrect Roomba Password causes unhandled execption which crashes homebridge #2

Open W0GER opened 5 years ago

W0GER commented 5 years ago

I noticed this morning that somehow my Roomba's password ended up getting changed. When the homebridge-irobot-roomba plugin would attempt to communicate with the Roomba an error "Connection refused: Not authorized" is returned and then thrown. This unhandled exception causes homebridge to crash.

From the log:

homebridge[913]: /usr/lib/node_modules/homebridge-irobot-roomba/node_modules/dorita980/lib/v2/local.js:30
homebridge[913]:     throw e;
homebridge[913]:     ^
homebridge[913]: Error: Connection refused: Not authorized
homebridge[913]:     at MqttClient._handleConnack (/usr/lib/node_modules/homebridge-irobot-roomba/node_modules/mqtt/lib/client.js:896:15)
homebridge[913]:     at MqttClient._handlePacket (/usr/lib/node_modules/homebridge-irobot-roomba/node_modules/mqtt/lib/client.js:332:12)
homebridge[913]:     at work (/usr/lib/node_modules/homebridge-irobot-roomba/node_modules/mqtt/lib/client.js:274:12)
homebridge[913]:     at Writable.writable._write (/usr/lib/node_modules/homebridge-irobot-roomba/node_modules/mqtt/lib/client.js:284:5)
homebridge[913]:     at doWrite (/usr/lib/node_modules/homebridge-irobot-roomba/node_modules/readable-stream/lib/_stream_writable.js:428:64)
homebridge[913]:     at writeOrBuffer (/usr/lib/node_modules/homebridge-irobot-roomba/node_modules/readable-stream/lib/_stream_writable.js:417:5)
homebridge[913]:     at Writable.write (/usr/lib/node_modules/homebridge-irobot-roomba/node_modules/readable-stream/lib/_stream_writable.js:334:11)
systemd[1]: homebridge.service: Main process exited, code=exited, status=1/FAILURE
systemd[1]: homebridge.service: Unit entered failed state.
systemd[1]: homebridge.service: Failed with result 'exit-code'.
iRayanKhan commented 5 years ago

Update it in the config then?

W0GER commented 5 years ago

Update it in the config then?

While that is the ultimate fix, I've seen a couple of times where the Roomba has reset the password (not sure what is causing this), but when that happens and I'm not at home, then Homebridge is crashing, which causes all other devices connected via Homebridge to become "Not responding" in Home. This then reduces the wife-acceptance-factor. Ideally, a message would be logged (like it is), but Homebridge should continue to handle other requests.