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

Cameras won't appear under add manually #60

Closed nicgraner closed 4 years ago

nicgraner commented 4 years ago

Setup in homebridge, and they show in the logs as "add manually using code xxx-xx-xxx" however when I click add accessory, then select I don't have a code, only one camera out of 6 appears. Any ideas on how to troubleshoot this would be helpful, as it seems everything is happy on the Homebridge and Unifi end.


[7/27/2020, 8:13:35 PM] Please add [Doorbell] manually in Home app. Setup Code: 111-69-420
[7/27/2020, 8:13:35 PM] Office is running on port 38999.
[7/27/2020, 8:13:35 PM] Please add [Office] manually in Home app. Setup Code: 111-69-420
[7/27/2020, 8:13:35 PM] Stairs is running on port 39169.
[7/27/2020, 8:13:35 PM] Please add [Stairs] manually in Home app. Setup Code: 111-69-420
[7/27/2020, 8:13:35 PM] Bedroom is running on port 40165.
[7/27/2020, 8:13:35 PM] Please add [Bedroom] manually in Home app. Setup Code: 111-69-420
[7/27/2020, 8:13:35 PM] Living room is running on port 44513.
[7/27/2020, 8:13:35 PM] Please add [Living room] manually in Home app. Setup Code: 111-69-420
[7/27/2020, 8:13:35 PM] Kitchen  is running on port 44433.
[7/27/2020, 8:13:35 PM] Please add [Kitchen ] manually in Home app. Setup Code: 111-69-420```

RTSP is set to medium on all 6 cams. Please let me know if you would like any other info :) 
beele commented 4 years ago

Please try the latest beta build as that uses a new method to get the camera's in Homekit. It no longer requires manually adding them in.

nicgraner commented 4 years ago

What is the latest beta build? 7?

nicgraner commented 4 years ago

Also what is the best practice for installing beta version? Uninstall main branch, reboot, install beta branch? I tried installing Beta 7 and im still only seeing one cam, as well as the stream no longer works on the one cam that did work :(

also , I see this when I look in logs: One of your plugins incorrectly registered an external accessory using the platform name (Camera-UniFi-Protect) and not the plugin identifier. Please report this to the developer!

Ok, progress! I redid the config to match whats in the wiki rather than what was made using the template in Hoobs, and the cameras all auto added! however it seems it kills homebridge now

[7/28/2020, 4:18:14 PM] TypeError: this.logDebug is not a function at UnifiStreamingDelegate.handleSnapshotRequest (/usr/lib/node_modules/homebridge-unifi-protect-camera-motion/src/streaming/unifi-streaming-delegate.js:15:14) at CameraController.handleSnapshotRequest (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/controller/CameraController.ts:351:23) at Bridge.Accessory._handleResource (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Accessory.ts:1507:18) at HAPServer.emit (events.js:223:5) at HAPServer.EventEmitter.emit (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/EventEmitter.ts:42:22) at HAPServer._this._handleResource (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/HAPServer.ts:918:12) at IncomingMessage.<anonymous> (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/HAPServer.ts:280:24) at IncomingMessage.emit (events.js:223:5) at endReadableNT (_stream_readable.js:1185:12) at processTicksAndRejections (internal/process/task_queues.js:81:21)

This happens after about 30 seconds of homebridge being up with beta 8

went back to beta 7, and it seems to be fine in terms of crashes, however, now im only getting one frame every 20 seconds or so

Doorbell gives this: ffmpeg exited with code: 1 and signal: null (Error) Doorbell whenever I try to stream.

All other cams produce sound, but only one new frame every 20 seconds or so. using traditional h264 as codec.

beele commented 4 years ago

@nicgraner homebridge-unifi-protect-camera-motion@0.4.1-Beta.9 should have fixed the logging issues

nicgraner commented 4 years ago

Just loaded up beta 9 and restarted the server, getting

[7/29/2020, 4:34:26 PM] [Unifi protect cameras & motion sensors] ffmpeg exited with code: 1 and signal: null (Error) Doorbell

for any stream I try. It sends notifications, and updates snapshots without issue though. video config is as follows:


                "vcodec": "h264_omx",
                "audio": true,
                "maxStreams": 2,
                "maxWidth": 1024,
                "maxHeight": 576,
                "maxFPS": 15,
                "mapvideo": "0:1",
                "mapaudio": "0:0",
                "maxBitrate": 3000,
                "packetSize": 376,
                "additionalCommandline": "-protocol_whitelist https,crypto,srtp,rtp,udp"```

Running on a SFF Dell PC Ubuntu Bionic Beaver
beele commented 4 years ago

Can you remove the _omx specification from the vcodec and see if that works

nicgraner commented 4 years ago

[7/30/2020, 8:36:45 AM] [Unifi protect cameras & motion sensors] Starting video stream: 1024x576, 15 fps, 299 kbps Doorbell
[7/30/2020, 8:36:46 AM] [Unifi protect cameras & motion sensors] ffmpeg exited with code: 1 and signal: null (Error) Doorbell
[7/30/2020, 8:36:46 AM] [Unifi protect cameras & motion sensors] Stopped video stream. Doorbell
[7/30/2020, 8:36:50 AM] [Unifi protect cameras & motion sensors] Starting video stream: 1024x576, 15 fps, 299 kbps Stairs
[7/30/2020, 8:36:54 AM] [Unifi protect cameras & motion sensors] Device appears to be inactive for over 5 seconds. Stopping stream. Doorbell
[7/30/2020, 8:36:54 AM] [Unifi protect cameras & motion sensors] Stopped video stream. Doorbell
[7/30/2020, 8:36:56 AM] [Unifi protect cameras & motion sensors] ffmpeg exited with code: 1 and signal: null (Error) Stairs```

No dice :( 

```        {
            "name": "Unifi protect cameras & motion sensors",
            "unifi": {
                "enhanced_classes": [
                    "person",
                    "dog"
                ],
                "controller": "https://10.11.12.149",
                "controller_rtsp": "rtsp://10.11.12.149:7447",
                "username": "XXXXXXXXXXX",
                "password": "XXXXXXXXXX",
                "motion_interval": 5000,
                "motion_repeat_interval": 30000,
                "motion_score": 50,
                "enhanced_motion": true,
                "enhanced_motion_score": 50,
                "enable_motion_trigger": true,
                "save_snapshot": true,
                "debug": false,
                "debug_network_traffic": false
            },
            "googlePhotos": {
                "upload_gphotos": false,
                "auth_redirectUrl": "http://localhost:8080/oauth2-callback"
            },
            "videoConfig": {
                "maxStreams": 2,
                "maxWidth": 1024,
                "maxHeight": 576,
                "maxFPS": 15,
                "maxBitrate": 3000,
                "vcodec": "h264",
                "packetSize": 376,
                "audio": true,
                "additionalCommandline": "-protocol_whitelist https,crypto,srtp,rtp,udp"
            },
            "platform": "UnifiProtectMotion"
        }```
madrobby commented 4 years ago

@beele Still having same issue: snapshots work, but video streaming doesn't.

I'm open to screenshare my homebridge Mac mini for you debug when you have a minute. Thanks for your hard work on this plugin. :)

beele commented 4 years ago

for streaming issues refer to: https://github.com/beele/homebridge-unifi-protect-camera-motion/issues/62