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

Unifi OS: Authenticated, returning session - Cannot get cameras #49

Closed janthony6 closed 4 years ago

janthony6 commented 4 years ago

Describe the bug Installed the plugin and finally got it to Authenticate. I'm using a UDMP with Unifi-OS.

Specifications RPBi4 UDMP - UnifiOS

Logging [Unifi protect cameras & motion sensors] Authenticated, returning session [Unifi protect cameras & motion sensors] Cannot get cameras: Error: ERROR: Could not enumerate motion sensors: Error: Invalid response, missing: cameras on data

hfagelnour commented 4 years ago

Strange! I am running the same and still get “can not enumerate cameras” Would u pls share ur config.jason (removing the credentials of course)

Sent from my iPhone

On Jul 19, 2020, at 9:46 PM, Thomas Fuchs notifications@github.com wrote:

 UDM-PRO 1.8.0-rc.7 Protect Controller 1.14.11-beta6, Web UI 1.23.0-beta.9

On Jul 19, 2020, at 11:49 AM, hfagelnour notifications@github.com wrote:

I've upgraded my UDM-PRO to the latest beta firmware and now cameras are enumerated correctly and I can see snapshots in the Home app. However, I can't live-stream video. What should I take a look at?

What versions of UnifiOS and protect are u running?

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

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

beele commented 4 years ago

@madrobby That is good news, you are running the latest available beta version? (I haven't had the time to get in touch with you yet) Does your livestream never start or does it exit with an error code in the logging?

@hfagelnour It might indeed be config related.

madrobby commented 4 years ago

@beele Livestream never starts, I don't see anyting in the logs.

beele commented 4 years ago
"videoConfig": {
    "vcodec": "h264",
    "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 -loglevel verbose"
}

That's the video config I use on my main and test setup (on my main setup I do use the omx variant of the vcodec)

@madrobby can you post your config that's working for the camera enumeration?

madrobby commented 4 years ago

Config:

 {
            "name": "Unifi Protect",
            "unifi": {
                "enhanced_classes": [],
                "controller": "https://192.168.16.1:443",
                "controller_rtsp": "rtsp://192.168.16.1:7447",
                "username": “xxxxxxxx",
                "password": "xxxxxxxx",
                "motion_interval": 5000,
                "motion_repeat_interval": 30000,
                "motion_score": 50,
                "enhanced_motion": true,
                "enhanced_motion_score": 50,
                "save_snapshot": false,
                "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": "libx264",
                "packetSize": 376,
                "audio": false,
                "additionalCommandline": "-protocol_whitelist https,crypto,srtp,rtp,udp"
            },
            "videoProcessor": "/usr/local/bin/ffmpeg",
            "platform": "UnifiProtectMotion"
        }
hfagelnour commented 4 years ago

Thx so much It looks like u r using a USG and not a UDMP. Pls correct me if I am wrong

Sent from my iPhone

On Jul 21, 2020, at 4:03 PM, Thomas Fuchs notifications@github.com wrote:

 Config:

{ "name": "Unifi Protect", "unifi": { "enhanced_classes": [], "controller": "https://192.168.16.1:443", "controller_rtsp": "rtsp://192.168.16.1:7447", "username": “xxxxxxxx", "password": "xxxxxxxx", "motion_interval": 5000, "motion_repeat_interval": 30000, "motion_score": 50, "enhanced_motion": true, "enhanced_motion_score": 50, "save_snapshot": false, "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": "libx264", "packetSize": 376, "audio": false, "additionalCommandline": "-protocol_whitelist https,crypto,srtp,rtp,udp" }, "videoProcessor": "/usr/local/bin/ffmpeg", "platform": "UnifiProtectMotion" } — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

madrobby commented 4 years ago

You’re wrong, I’m using a UDM-Pro. :)

On Jul 21, 2020, at 12:40 PM, hfagelnour notifications@github.com wrote:

 Thx so much It looks like u r using a USG and not a UDMP. Pls correct me if I am wrong

Sent from my iPhone

On Jul 21, 2020, at 4:03 PM, Thomas Fuchs notifications@github.com wrote:

 Config:

{ "name": "Unifi Protect", "unifi": { "enhanced_classes": [], "controller": "https://192.168.16.1:443", "controller_rtsp": "rtsp://192.168.16.1:7447", "username": “xxxxxxxx", "password": "xxxxxxxx", "motion_interval": 5000, "motion_repeat_interval": 30000, "motion_score": 50, "enhanced_motion": true, "enhanced_motion_score": 50, "save_snapshot": false, "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": "libx264", "packetSize": 376, "audio": false, "additionalCommandline": "-protocol_whitelist https,crypto,srtp,rtp,udp" }, "videoProcessor": "/usr/local/bin/ffmpeg", "platform": "UnifiProtectMotion" } — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe. — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

hfagelnour commented 4 years ago

:) ok may be this is my problem then. I wasn’t using 443 as the controller port. Thx again

Sent from my iPhone

On Jul 21, 2020, at 9:46 PM, Thomas Fuchs notifications@github.com wrote:

 You’re wrong, I’m using a UDM-Pro. :)

On Jul 21, 2020, at 12:40 PM, hfagelnour notifications@github.com wrote:

 Thx so much It looks like u r using a USG and not a UDMP. Pls correct me if I am wrong

Sent from my iPhone

On Jul 21, 2020, at 4:03 PM, Thomas Fuchs notifications@github.com wrote:

 Config:

{ "name": "Unifi Protect", "unifi": { "enhanced_classes": [], "controller": "https://192.168.16.1:443", "controller_rtsp": "rtsp://192.168.16.1:7447", "username": “xxxxxxxx", "password": "xxxxxxxx", "motion_interval": 5000, "motion_repeat_interval": 30000, "motion_score": 50, "enhanced_motion": true, "enhanced_motion_score": 50, "save_snapshot": false, "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": "libx264", "packetSize": 376, "audio": false, "additionalCommandline": "-protocol_whitelist https,crypto,srtp,rtp,udp" }, "videoProcessor": "/usr/local/bin/ffmpeg", "platform": "UnifiProtectMotion" } — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe. — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe. — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

beele commented 4 years ago

@hfagelnour did you get it working with the corrected URL?

hfagelnour commented 4 years ago

Thx for asking but no, I am still getting the same error msg “can not enumerate the motion sensors”

Sent from my iPhone

On Jul 23, 2020, at 8:26 PM, Kevin Van den Abeele notifications@github.com wrote:

 @hfagelnour did you get it working with the corrected URL?

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

beele commented 4 years ago

0.4.1 has been released. Can all people that are having issues with Unifi OS update to the latest version, check the readme so you are using the correct URLs and report back?

beele commented 4 years ago

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 The controller URL should NOT end with a slash!

beele commented 4 years ago

Unifi OS should be working now

madrobby commented 4 years ago

@beele with the latest version, I still have the same issue: snapshots work, but I can't stream video

beele commented 4 years ago

@madrobby that's currently a more global issue with homebridge camera ffmpeg (which this plugin uses as a dependency). A solution for it is being worked on though. Best to continue this in #62