moritzmhmk / homebridge-camera-rpi

raspberry pi camera plugin for homebridge
MIT License
159 stars 29 forks source link

Issue with "buffer.js" #59

Closed jonerikandersen closed 5 years ago

jonerikandersen commented 5 years ago

Some background facts: Tried installing it as user and root, now installed as root.

Installed ok, added config (with some modifications - name, id, pin, username - due to to cameras with same sw on the network).

However when starting, it loads and runs. When adding the camera through the Home app, it get's to the final stage where its handshaking the key and then the app stops and the following appears in the console.

root@merlin:/usr/share/homebridge-camera-rpi# /usr/bin/node /usr/share/homebridge-camera-rpi/standalone.js -c /etc/homebridge-camera-rpi.conf.json HAP-NodeJS starting... Scan this code with your HomeKit App on your iOS device to pair with Camera:

┌────────────┐     
│ 031-45-153 │     
└────────────┘     
buffer.js:314
      throw new TypeError('"list" argument must be an Array of Buffers');
      ^
TypeError: "list" argument must be an Array of Buffers
    at Function.Buffer.concat (buffer.js:314:13)
    at Object.encode (/usr/share/homebridge-camera-rpi/node_modules/hap-nodejs/lib/util/tlv.js:26:35)
    at Object.encode (/usr/share/homebridge-camera-rpi/node_modules/hap-nodejs/lib/util/tlv.js:51:39)
    at Object.encode (/usr/share/homebridge-camera-rpi/node_modules/hap-nodejs/lib/util/tlv.js:51:39)
    at HAPServer._handlePairStepFive (/usr/share/homebridge-camera-rpi/node_modules/hap-nodejs/lib/HAPServer.js:459:21)
    at HAPServer._handlePairStepFour (/usr/share/homebridge-camera-rpi/node_modules/hap-nodejs/lib/HAPServer.js:439:8)
    at HAPServer._handlePairStepThree (/usr/share/homebridge-camera-rpi/node_modules/hap-nodejs/lib/HAPServer.js:413:8)
    at HAPServer._handlePair (/usr/share/homebridge-camera-rpi/node_modules/hap-nodejs/lib/HAPServer.js:315:10)
    at HAPServer.<anonymous> (/usr/share/homebridge-camera-rpi/node_modules/hap-nodejs/lib/HAPServer.js:209:39)
    at emitNone (events.js:86:13)
root@merlin:/usr/share/homebridge-camera-rpi# cat /etc/homebridge-camera-rpi.conf.json 
{
  "name": "Pi Camera 2",
  "id": "Pi Camera 2",
  "pincode": "031-45-153",
  "username": "EC:23:3D:D3:CE:DE"
}
moritzmhmk commented 5 years ago

Looks like the error is from hap-nodejs.

What nodejs version do you use?

jonerikandersen commented 5 years ago

I had 6.9.5, upgraded to 8.11.1. Still same issue. It's strange though, I have to devices running on the same network with different cams. Both on same Node version. It works on one of them, not on the other. Hence the change in name, id, pin and username. Because if they are equal, Home app hangs and don't get a feed from neither.

Edit: One of them had 8.11.1 on node and nodejs. The other had an 6.9.5 on nodejs. Fixed it with an update. Thank you for an awesome app and great support : )