Brandawg93 / homebridge-nest-cam_old

Use your Nest Cam as IP camera in HomeKit.
Apache License 2.0
92 stars 14 forks source link

can't get it to work #3

Closed taimurasad closed 6 years ago

taimurasad commented 6 years ago

is this all I need to add under

"accessories":[

{ "platform": "Nest-cam", "username": "user@user.com", "password": "pass123", "useOMX": true }

]

cause doing this throws indexof error. any help?

KhaosT commented 6 years ago

This is a platform plugin, so it needs to be put in plugin section. Here is an example of full config.json

{
    "bridge": {
        "name": "Homebridge",
        "username": "EE:11:33:DD:CE:30",
        "pin": "031-45-154"
    },
    "accessories": [],
    "platforms": [{
        "platform": "Nest-cam",
        "username": "user@user.com",
        "password": "pass123",
        "useOMX": true
    }]
}
taimurasad commented 6 years ago

That fixed it. thank you so much. working now, well mostly. the problem now is that whenever I try and open the camera preview window into full screen, home bridge crashes with this error:

buffer.js:332 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:332:13) at NexusStreamer._sendMessage (/usr/lib/node_modules/homebridge-nest-cam/lib/streamer.js:139:30) at NexusStreamer.requestHello (/usr/lib/node_modules/homebridge-nest-cam/lib/streamer.js:187:10) at TLSSocket.self.socket.tls.connect (/usr/lib/node_modules/homebridge-nest-cam/lib/streamer.js:78:12) at Object.onceWrapper (events.js:293:19) at emitNone (events.js:86:13) at TLSSocket.emit (events.js:188:7) at TLSSocket. (_tls_wrap.js:1109:14) at emitNone (events.js:86:13) at TLSSocket.emit (events.js:188:7)

I can see the 10s previews of all cameras I have just fine in smaller windows. just that if I open the window, home bridge crashes.

running home bridge on Pi3 here. Have enabled useOMX to true. any help?

KhaosT commented 6 years ago

What node version are you on? I think one of the library is using Uint8Array and Buffer in node.js only added support for concat normal Buffer and Uint8Array in v8.0.

I can probably fix this by create a buffer first...

taimurasad commented 6 years ago

you mean the version of home bridge im running? not sure how I can check it. can you tell me the command to check and report back here?

KhaosT commented 6 years ago

Node.js version. You can check that with npm version.

taimurasad commented 6 years ago

{ npm: '4.2.0', ares: '1.10.1-DEV', cldr: '30.0.3', http_parser: '2.7.0', icu: '58.2', modules: '51', node: '7.10.0', openssl: '1.0.2k', tz: '2016j', unicode: '9.0', uv: '1.11.0', v8: '5.5.372.43', zlib: '1.2.11' }

KhaosT commented 6 years ago

Yeah it's v7.10 so the buffer concat failed. If you can wait, I'll make a new version fix this from my side. Or you can upgrade to v8.x for now if you want.

taimurasad commented 6 years ago

can you tell me the command to update node to 8.0?

taimurasad commented 6 years ago

just ran sudo apt-get update and it doesn't appear to have updated node

KhaosT commented 6 years ago

That's because nodejs's repo is version dependent. You can follow guide from here to update repo to v8.x.

KhaosT commented 6 years ago

Alright v0.0.5 should fix this.

KhaosT commented 6 years ago

(If you haven't update node you can just try reinstall this package from npm)

taimurasad commented 6 years ago

can confirm that updating to 0.0.5 fixed the issue! thank you so much!

KhaosT commented 6 years ago

Great :) also just curious, which Raspberry Pi are you using and does the live video mains an acceptable latency?

taimurasad commented 6 years ago

just got around to updating node on my Pi3 as well using the following two commands

curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash - sudo apt-get install -y nodejs

everything works perfect. streaming works too on my Pi3 with useOMX": true! Thank you so much for this KhaosT. All 6 of my Nest cams are more useful than ever before!

taimurasad commented 6 years ago

im using Raspberry Pi 3. Think it's the latest version? As for video quality of stream, it's not that great as I can see pixelated boxes here and there but I guess on Pi 3 that is too be expected. I'll take that for integration into HomeKit. If I need a very high quality stream, can always use the stock Nest app!

organiska commented 6 years ago

I tried to follow these steps, but taimurasad’s steps for updating node have turned everything read only.

As a result I can no longer edit my config.json I also cannot launch homebridge.

organiska commented 6 years ago

To clarify, I typed in: <curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash - sudo apt-get install -y nodejs>