dgreif / ring

Unofficial packages for Ring Doorbells, Cameras, Alarm System, and Smart Lighting
MIT License
1.21k stars 163 forks source link

Streaming not working over Unifi #339

Closed markcarroll closed 4 years ago

markcarroll commented 4 years ago

Live Streaming Issue

Describe the live streaming issue

I used to have streaming working a while back, but more recently the camera stream never seems to resolve.I do get preview pictures but no live stream.

I think it stopped working when I switched to a Unifi UDM as my router. Up until a few weeks ago I was getting the Preparing...Waiting... then nothing. Since the last update I am now getting past the waiting stage and see a "Receiving..." but it always seems to respond just over 10 seconds after the request starts, at which point the UI has timed out. I do have UPnP and NATPMP turned on.

I did wonder if it was my home bridge setup, so I built a new homebridge instance on a clean Raspberry Pi and still got the same results.

What confuses me is that the Ring app works just fine on all my devices while running on the same Wifi as the RPi, so why is this different?

(I am a longtime web/cloud dev so not a noob, but I am also not a hardcore networking expert)

Screenshots/Logs

[5/30/2020, 12:41:00 PM] [Ring] Preparing Live Stream for Front Door
[5/30/2020, 12:41:00 PM] [Ring] Waiting for stream data from Front Door (0.32s)
[5/30/2020, 12:41:07 PM] [Ring] Snapshot for Front Door is still within its life time (28.97s old)
[5/30/2020, 12:41:09 PM] [Ring] Snapshot for Driveway is still within its life time (1.247s old)
[5/30/2020, 12:41:20 PM] [Ring] Received stream data from Front Door (20.385s)
[5/30/2020, 1:45:33 PM] [Ring] Preparing Live Stream for Front Door
[5/30/2020, 1:45:34 PM] [Ring] Waiting for stream data from Front Door (0.941s)
[5/30/2020, 1:45:44 PM] [Ring] Stopped Live Stream for Front Door
[5/30/2020, 1:45:44 PM] [Ring] Received stream data from Front Door (10.764s)
[5/30/2020, 1:46:13 PM] [Ring] Preparing Live Stream for Front Door
[5/30/2020, 1:46:13 PM] [Ring] Ding 6832741206375923018 is expired (480).  Fetching a new ding and trying video stream again
[5/30/2020, 1:46:14 PM] [Ring] Waiting for stream data from Front Door (1.692s)
[5/30/2020, 1:46:24 PM] [Ring] Stopped Live Stream for Front Door
[5/30/2020, 1:46:24 PM] [Ring] Received stream data from Front Door (11.007s)

Recommended solution

I have tried everything I can think of and am humbly looking for advice here.

Environment

Network Environment

Comcast XFinity gateway put in bridge mode Unifi UDM Raspberry Pi running latest OS, clean install of Homebridge. Wired connection directly to the UDM. Apple TV 4K as HomeKit Hub.

dgreif commented 4 years ago

Could you try installing v8.3.0-alpha.3? I've done a lot of work on live streaming and it should work on any network setup

markcarroll commented 4 years ago

Yep, I'll give that a go now

markcarroll commented 4 years ago

Well that was interesting. It worked for the first few seconds. Then the stream went blank (black screen). I closed it, tried to open again and got the "wait until someone else in this home stops viewing the camera" error.

[5/30/2020, 2:14:58 PM] [Ring] Preparing Live Stream for Front Door
[5/30/2020, 2:14:59 PM] [Ring] Waiting for stream data from Front Door (0.999s)
[5/30/2020, 2:14:59 PM] [Ring] Received stream data from Front Door (1.832s)
[5/30/2020, 2:15:00 PM] [Ring] Streaming active for Front Door
[5/30/2020, 2:15:24 PM] [Ring] Preparing Live Stream for Front Door
[5/30/2020, 2:15:24 PM] [Ring] Waiting for stream data from Front Door (0.35s)
[5/30/2020, 2:15:25 PM] [Ring] Received stream data from Front Door (1.138s)
[5/30/2020, 2:15:26 PM] [Ring] Streaming active for Front Door
markcarroll commented 4 years ago

Now I am not getting any more success. I get a log saying streaming is active for the other cameras in the house, but no active stream on the phone.

[5/30/2020, 2:21:19 PM] [Ring] Preparing Live Stream for Backyard
[5/30/2020, 2:21:20 PM] [Ring] Waiting for stream data from Backyard (0.911s)
[5/30/2020, 2:21:21 PM] [Ring] Received stream data from Backyard (1.714s)
[5/30/2020, 2:21:21 PM] [Ring] Streaming active for Backyard
markcarroll commented 4 years ago

Another update. I am getting some success now when I view the cameras from the Home app on my Mac and the stream seems to hold out ok.
On my phone it is a different issue. I seem to now constantly get the "someone else" error on the first camera that worked for a second. One of the other cameras worked for a few seconds then also went blank. Now none of them work on the phone.

dgreif commented 4 years ago

Glad it's working! The "someone else" error is due to a limited number of streams available through HomeKit. If you give it a few minutes that should go away. Switching between cameras rapidly (which is what most users do while testing) can definitely cause issues. In normal use, it should work pretty well. As long as it works sometimes, then it's working as well as I can make it work at this point

markcarroll commented 4 years ago

Yeah giving it some time, it seems to resolve. I'm very happy it is working on my Mac at least, I just need to work out now why it is not working on the phone or iPad.

Thank you for all your work on this plugin. I will close this bug now.