homebridge-plugins / homebridge-arlo

Arlo platform plugin for homebridge

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Plugin broken in Homebridge 1.0.1

solarbeat opened this issue · comments

Errors out, preventing Homebridge startup.

[37m[4/27/2020, 8:40:53 AM] [39m[31mTypeError: Cannot read property 'length' of undefined[39m [31m at Object.encode (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/util/tlv.ts:18:14)[39m [31m at /usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/camera/RTPStreamManagement.ts:1160:39[39m [31m at Array.forEach (<anonymous>)[39m [31m at StreamController.RTPStreamManagement._supportedVideoStreamConfiguration (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/camera/RTPStreamManagement.ts:1153:31)[39m [31m at StreamController.RTPStreamManagement (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/camera/RTPStreamManagement.ts:508:51)[39m [31m at new StreamController (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/camera/RTPStreamManagement.ts:1375:5)[39m [31m at ArloCameraSource._createStreamControllers (/usr/local/lib/node_modules/homebridge-arlo/index.js:547:32)[39m [31m at new ArloCameraSource (/usr/local/lib/node_modules/homebridge-arlo/index.js:490:14)[39m [31m at ArloPlatform.addAccessory (/usr/local/lib/node_modules/homebridge-arlo/index.js:82:45)[39m [31m at ArloPlatform.<anonymous> (/usr/local/lib/node_modules/homebridge-arlo/index.js:135:26)[39m [31m at Arlo.emit (events.js:311:20)[39m [31m at Arlo.<anonymous> (/usr/local/lib/node_modules/homebridge-arlo/node_modules/node-arlo/lib/Arlo.js:49:26)[39m [31m at Request._callback (/usr/local/lib/node_modules/homebridge-arlo/node_modules/node-arlo/lib/Arlo.js:310:21)[39m [31m at Request.self.callback (/usr/local/lib/node_modules/homebridge-arlo/node_modules/request/request.js:185:22)[39m [31m at Request.emit (events.js:311:20)[39m [31m at Request.<anonymous> (/usr/local/lib/node_modules/homebridge-arlo/node_modules/request/request.js:1154:10)[39m [31m at Request.emit (events.js:311:20)[39m [31m at IncomingMessage.<anonymous> (/usr/local/lib/node_modules/homebridge-arlo/node_modules/request/request.js:1076:12)[39m [31m at Object.onceWrapper (events.js:417:28)[39m [31m at IncomingMessage.emit (events.js:323:22)[39m [31m at endReadableNT (_stream_readable.js:1204:12)[39m [31m at processTicksAndRejections (internal/process/task_queues.js:84:21)[39m [37m[4/27/2020, 8:40:53 AM] [39mGot SIGTERM, shutting down Homebridge...

This is related to an regression introduced in HAP-NodeJS 0.6.0
Is fixed in 0.6.7 homebridge/HAP-NodeJS@5e36254 which will be included in the next release of homebridge and probably any moment in the latest beta version of homebridge.

The causing line is https://github.com/devbobo/homebridge-arlo/blob/2e740ca2e5a870b9f1eee3cd366ff430dca1c303/index.js#L477

The fix is live with homebridge@1.0.3-beta.3

Still broken after upgrading to 1.0.3 - homebridge now cycles between running/not running continuously. Plugin is v0.0.3

[4/28/2020, 5:42:34 PM] Error: Cannot update reachability on non-bridged accessory!
at Accessory._this.updateReachability (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Accessory.ts:399:13)
at PlatformAccessory.updateReachability (/usr/local/lib/node_modules/homebridge/src/platformAccessory.ts:124:34)
at new ArloBaseStationAccessory (/usr/local/lib/node_modules/homebridge-arlo/index.js:174:24)
at ArloPlatform.addAccessory (/usr/local/lib/node_modules/homebridge-arlo/index.js:52:48)
at ArloPlatform. (/usr/local/lib/node_modules/homebridge-arlo/index.js:135:26)
at Arlo.emit (events.js:311:20)
at Arlo. (/usr/local/lib/node_modules/homebridge-arlo/node_modules/node-arlo/lib/Arlo.js:40:26)
at Request._callback (/usr/local/lib/node_modules/homebridge-arlo/node_modules/node-arlo/lib/Arlo.js:310:21)
at Request.self.callback (/usr/local/lib/node_modules/homebridge-arlo/node_modules/request/request.js:185:22)
at Request.emit (events.js:311:20)
at Request. (/usr/local/lib/node_modules/homebridge-arlo/node_modules/request/request.js:1154:10)
at Request.emit (events.js:311:20)
at IncomingMessage. (/usr/local/lib/node_modules/homebridge-arlo/node_modules/request/request.js:1076:12)
at Object.onceWrapper (events.js:417:28)
at IncomingMessage.emit (events.js:323:22)
at endReadableNT (_stream_readable.js:1204:12)
at processTicksAndRejections (internal/process/task_queues.js:84:21)

A fix was incorporated into homebridge and published in the current latest beta version homebridge@1.0.4-beta.1. (It will probably be released in the next few days as v1.0.4).
Would be great if you could try that by installing

sudo npm install -g homebridge@beta

@devbobo updateReachability is deprecated since a long time. And doesn't really do anything anymore. You might as well just remove the following call https://github.com/devbobo/homebridge-arlo/blob/2e740ca2e5a870b9f1eee3cd366ff430dca1c303/index.js#L174 (and any other possible occurrences in your codebase).

Confirmed fixed on 1.0.4