dgreif / ring

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

Live Streams with Apple Airport Routers #87

Closed dgreif closed 5 years ago

dgreif commented 5 years ago

Per conversation in #74, it appears that Apple Airport Routers are blocking the current method for "hole-punching" through NAT. Need to investigate alternate approaches to the problem such as port forwarding for a specific range that we can use for RTP, or figure out what configuration needs to be set on the Airport routers to allow this to work. DMZing the homebridge server appears to fix the issue, but this is very dangerous as it opens every port on that device to the outside world.

Sunoo commented 5 years ago

Not an ideal solution, but what I've done currently is open ports 10001-65535 (the highest port used by the Airport itself is 10000, so including that causes problems). It's still pretty kludgy, but it's better than DMZing the entire device. The ideal solution would still be to be able to choose specific ports, as mentioned in the other thread.

image
dgreif commented 5 years ago

I did some research and found that Apple Airports don't support the normal protocols for opening NAT ports. They do, however, support NAT-PMP which should get us what we need. I just release v5.0.0 which will now attempt to negotiate with the router using NAT-PMP or whatever protocol is supported. Can someone with an Airport try disabling the DMZ and port forwarding settings and see if it works out-of-the-box now?

Sunoo commented 5 years ago

Looks like you nailed it! I just disabled my port forwards, and the steaming video works perfectly. Thanks so much.

dgreif commented 5 years ago

image

@onefish2 @Frederik840 @metroidmen Can you give v5.0.0 a try with DMZ/port forwarding disabled? I'm hoping this solves all remaining live stream issues šŸ¤ž

onefish2 commented 5 years ago

@dgreif. Working great without the Pi running homebridge in the DMZ or having port forwarding enabled. You are a ROCK-STAR!!!

Frederik840 commented 5 years ago

Working perfectly! šŸ˜€

metroidmen commented 5 years ago

@dgreif

This issue is maddening. It still doesnā€™t work properly for me.

Every update, or reboot, it starts out fine. Getting snapshots, live streams, etc. But after a while it just stops working. No snapshots. Streams wonā€™t connect. Sometimes after a few hours, snapshots start back up magically. But stop shortly after. Same with live-streams, albeit more rare.

Iā€™ve tried reinstalling. Iā€™ve tried resetting up my homebridge entirely. Iā€™ve port forwarded and DMZed it. It does the exact same thing.

When it works, it works great. But then it just stops entirely. Itā€™s extremely frustrating.

I have a really solid network and have no network issues with any devices, including other HomeKit and homebridge devices. The devices pull up just fine in the ring app whenever I need them.

dgreif commented 5 years ago

@metroidmen I think you are the only one still having issues at this point. Have you checked the homebridge logs when it fails? Do other devices from Ring still work (like alarm/lights) when the camera feeds fail?

metroidmen commented 5 years ago

The logs usually just stick on ā€œpreparing live streamā€ and never do anything else.

metroidmen commented 5 years ago

Sometimes it says snapshot requested but the snapshot never updates in the app.

dgreif commented 5 years ago

Both of those things point to a situation where Ring is not responding to requests from the plugin. I can't say for sure what would cause it, but my guess would be a poor connection between your camera and your router. Beyond that, you would need to dive into the code and do some debugging yourself. I really want this plugin to work for everyone, but there are some situations where I just can't help any farther. Without more info, there is nothing for me to fix.

metroidmen commented 5 years ago

Well if it has that issue and I immediately open the ring app itā€™ll connect just fine. I have this issue with all 5 of my cameras simultaneously.

I donā€™t know anything about coding so Iā€™m completely lost.