beele / homebridge-unifi-protect-camera-motion

Camera & Motion sensor support for Unifi Protect cameras in Homekit via Homebridge
Apache License 2.0
103 stars 12 forks source link

Cannot get cameras: Error: ERROR: Could not enumerate motion sensors: Error: Authentication failed: {} #64

Closed sullyhome closed 3 years ago

sullyhome commented 3 years ago

Version: homebridge-unifi-protect-camera-motion v0.4.1

Despite having the correct ID and password in my config file I get the error: Cannot get cameras: Error: ERROR: Could not enumerate motion sensors: Error: Authentication failed: {}

This happens with both local and cloud user accounts to try to rule that out.

Here is full log file.

[8/2/2020, 1:20:54 PM] [Config] Homebridge restart request received [8/2/2020, 1:20:54 PM] [Config] UI / Bridge settings have not changed; only restarting Homebridge process [8/2/2020, 1:20:54 PM] [HB Supervisor] Sending SIGTERM to Homebridge [8/2/2020, 1:20:54 PM] Got SIGTERM, shutting down Homebridge... [8/2/2020, 1:20:59 PM] [HB Supervisor] Homebridge Process Ended. Code: 143, Signal: null [8/2/2020, 1:21:04 PM] [HB Supervisor] Restarting Homebridge... [8/2/2020, 1:21:04 PM] [HB Supervisor] Starting Homebridge with extra flags: -I [8/2/2020, 1:21:04 PM] [HB Supervisor] Started Homebridge v1.1.1 with PID: 7738 [8/2/2020, 1:21:05 PM] Loaded config.json with 0 accessories and 2 platforms. [8/2/2020, 1:21:05 PM] --- [8/2/2020, 1:21:06 PM] Loaded plugin: homebridge-config-ui-x@4.24.0 [8/2/2020, 1:21:06 PM] Registering platform 'homebridge-config-ui-x.config' [8/2/2020, 1:21:06 PM] --- cpu backend was already registered. Reusing existing backend factory. Platform node has already been set. Overwriting the platform with [object Object]. [8/2/2020, 1:21:09 PM] Loaded plugin: homebridge-unifi-protect-camera-motion@0.4.1 [8/2/2020, 1:21:09 PM] Registering platform 'homebridge-unifi-protect-camera-motion.UnifiProtectMotion' [8/2/2020, 1:21:09 PM] --- [8/2/2020, 1:21:09 PM] Loading 2 platforms... [8/2/2020, 1:21:09 PM] [Config] Initializing config platform... [8/2/2020, 1:21:09 PM] [Config] Running in Service Mode [8/2/2020, 1:21:09 PM] [Unifi protect cameras & motion sensors] Initializing UnifiProtectMotion platform... [8/2/2020, 1:21:09 PM] [Unifi protect cameras & motion sensors] Configuring accessory Test [8/2/2020, 1:21:09 PM] [Unifi protect cameras & motion sensors] Configuring accessory Right Side [8/2/2020, 1:21:09 PM] [Unifi protect cameras & motion sensors] Configuring accessory Front Door [8/2/2020, 1:21:09 PM] [Unifi protect cameras & motion sensors] Configuring accessory Garage [8/2/2020, 1:21:09 PM] [Unifi protect cameras & motion sensors] Configuring accessory Left Side [8/2/2020, 1:21:09 PM] [Unifi protect cameras & motion sensors] Configuring accessory Rear Door Setup Payload: X-HM://0023N1Q0Y3EK3 Enter this code with your HomeKit app on your iOS device to pair with Homebridge:

┌────────────┐     
│ 102-72-002 │     
└────────────┘     

[8/2/2020, 1:21:09 PM] Homebridge is running on port 51740. [8/2/2020, 1:21:09 PM] [Unifi protect cameras & motion sensors] Endpoint Style: UnifiOS [8/2/2020, 1:21:13 PM] [Unifi protect cameras & motion sensors] Cannot get cameras: Error: ERROR: Could not enumerate motion sensors: Error: Authentication failed: {}

beele commented 3 years ago

Post your redacted config please

sullyhome commented 3 years ago

Post your redacted config please

{ "bridge": { "name": "Homebridge D415", "username": "username", "port": 51740, "pin": "102-72-002" }, "accessories": [], "platforms": [ { "name": "Config", "port": 8581, "platform": "config" }, { "platform": "UnifiProtectMotion", "name": "Unifi protect cameras & motion sensors", "unifi": { "controller": "https://192.168.1.172", "controller_rtsp": "https://192.168.1.172:7447", "username": "userid", "password": "password", "motion_interval": 5000, "motion_repeat_interval": 30000, "motion_score": 0, "enhanced_motion": true, "enhanced_motion_score": 55, "enhanced_classes": [ "person" ], "save_snapshot": false, "enable_motion_trigger": true, "enable_doorbell_for": [], "debug": true, "debug_network_traffic": true }, "googlePhotos": { "upload_gphotos": false, "auth_clientId": "CLIENT_ID", "auth_clientSecret": "CLIENT_SECRET", "auth_redirectUrl": "http://localhost:8080/oauth2-callback" }, "videoConfig": { "vcodec": "h264_omx", "audio": true, "maxStreams": 2, "maxWidth": 1920, "maxHeight": 1080, "maxFPS": 15, "mapvideo": "0:1", "mapaudio": "0:0", "maxBitrate": "3000", "packetSize": 188, "additionalCommandline": "-protocol_whitelist https,crypto,srtp,rtp,udp" } } ] }

hfagelnour commented 3 years ago

@beele i get the same error as above until i add a "/" at the end of the controller URL which will then Authenticate but gives this error afterwards [8/3/2020, 20:53:24] [Unifi protect cameras & motion sensors] Cannot get cameras: Error: ERROR: Could not enumerate motion sensors: TypeError: Cannot read property 'status' of undefined

sullyhome commented 3 years ago

@beele i get the same error as above until i add a "/" at the end of the controller URL which will then Authenticate but gives this error afterwards [8/3/2020, 20:53:24] [Unifi protect cameras & motion sensors] Cannot get cameras: Error: ERROR: Could not enumerate motion sensors: TypeError: Cannot read property 'status' of undefined

Hmm the forward slash on the url didnt get me any further.

hfagelnour commented 3 years ago

Which Unifi OS and controller are u using? I am on 1.8rc11 and 6.0.8

Sent from my iPhone

On Aug 4, 2020, at 1:39 AM, sullyhome notifications@github.com wrote:

 @beele i get the same error as above until i add a "/" at the end of the controller URL which will then Authenticate but gives this error afterwards [8/3/2020, 20:53:24] [Unifi protect cameras & motion sensors] Cannot get cameras: Error: ERROR: Could not enumerate motion sensors: TypeError: Cannot read property 'status' of undefined

Hmm the forward slash on the url didnt get me any further.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

sullyhome commented 3 years ago

Which Unifi OS and controller are u using? I am on 1.8rc11 and 6.0.8 Sent from my iPhone On Aug 4, 2020, at 1:39 AM, sullyhome @.***> wrote:  @beele i get the same error as above until i add a "/" at the end of the controller URL which will then Authenticate but gives this error afterwards [8/3/2020, 20:53:24] [Unifi protect cameras & motion sensors] Cannot get cameras: Error: ERROR: Could not enumerate motion sensors: TypeError: Cannot read property 'status' of undefined Hmm the forward slash on the url didnt get me any further. — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

The new Protect NVR. Firmware 1.3.12 which appears to be the latest. Protect Controller version 1.14.11. Web UI Version 1.23.2

sullyhome commented 3 years ago

FWIW the new Version 3 of homebridge-unifi-protect2 is working perfectly for me so doesnt appear to be an issue on my side. Going to switch to using that for now.

beele commented 3 years ago

I've gone over: https://github.com/hjdhjd/homebridge-unifi-protect2/blob/master/src/protect-api.ts And my plugin does basically the same thing. I'll try some small changes to see if they have any effect.

hfagelnour commented 3 years ago

Protect2 ver 3.0 worked fine for me as well

Sent from my iPhone

On Aug 5, 2020, at 12:41 PM, Kevin Van den Abeele notifications@github.com wrote:

 I've gone over: https://github.com/hjdhjd/homebridge-unifi-protect2/blob/master/src/protect-api.ts And my plugin does basically the same thing. I'll try some small changes to see if they have any effect.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

beele commented 3 years ago

@sullyhome & @hfagelnour Could you try with: sudo npm i -g --unsafe-perm=true homebridge-unifi-protect-camera-motion@0.4.2-beta.1 I've reworked the calls to the Unifi side of things

hfagelnour commented 3 years ago

worked like a charm :) i get an exit code 1 though which is an ffmpeg audio setting i need to look at.

On Wed, Aug 5, 2020 at 2:30 PM Kevin Van den Abeele < notifications@github.com> wrote:

Could you try with: sudo npm i -g --unsafe-perm=true homebridge-unifi-protect-camera-motion@0.4.2-beta.1 I've reworked the calls to the Unifi side of things

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/beele/homebridge-unifi-protect-camera-motion/issues/64#issuecomment-669164893, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOOJ25YTQVHSQMHO2XWFOPDR7FGE7ANCNFSM4PSUVIJQ .

hfagelnour commented 3 years ago

while the plugin is working fine i though to share with you the log output i am getting maybe it helps speed up things which is very fast already

Hi there 👋. Looks like you are running TensorFlow.js in Node.js. To speed things up dramatically, install our node backend, which binds to TensorFlow C++, by running npm i @tensorflow/tfjs-node, or npm i @tensorflow/tfjs-node-gpu if you have CUDA. Then call require('@tensorflow/tfjs-node'); (-gpu suffix for CUDA) at the start of your program. Visit https://github.com/tensorflow/tfjs-node for more details.

On Wed, Aug 5, 2020 at 2:30 PM Kevin Van den Abeele < notifications@github.com> wrote:

Could you try with: sudo npm i -g --unsafe-perm=true homebridge-unifi-protect-camera-motion@0.4.2-beta.1 I've reworked the calls to the Unifi side of things

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/beele/homebridge-unifi-protect-camera-motion/issues/64#issuecomment-669164893, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOOJ25YTQVHSQMHO2XWFOPDR7FGE7ANCNFSM4PSUVIJQ .

beele commented 3 years ago

@hfagelnour good to hear that it's working now. That message appears to be an error in their code, and can be ignored, tensorflow is already running with the C++ backend. But since the node & tensorflow integration is kinda shitty (mismatching versions and broken build instructions)

beele commented 3 years ago

Unifi OS should be working now