RTSPtoWebRTC - public access

Hi,

I’ve installed the RTSPtoWebRTC - Home Assistant extension to improve the streaming performance with ReoLink cameras.

The loading time is now almost instant; no more lag or buffering with the 2 cameras I have. Everything works great on the local network.

I’m now trying to get the streams working from the external URL from an external network. Right now I only get still pictures.

I have read that a stun server should be configured. So I added the google one stun.l.google.com:19302 into the RTSPtoWebRTC integration configuration and reloaded it.

image

No success, no javascript error, nothing in the logs.

I have home assistant behind Nginx Proxy Manager.

Does someone have insights how to configure this or pointers where to look for logs?

Have I done the necessary home assistant configuration? Is there something special to take into consideration for the nginx proxy?

Thanks!

The developer monitors this topic:

Hi,

My impression is just adding that there is all you need to do! However, maybe it depends on the type of NAT you have in front of the add-on. When I did this, it just worked for me and others. This is basically what is happening behind the scenes: Introduction to WebRTC protocols - Web APIs | MDN

Hi Allen,

My topology is crappy cable router → Mikrotik Router → Nginx Proxy Manager → hass box

If I put a laptop before or after the Mikrotik Router (different subnets) I am able to get the streams. Probably because they use both local UDP connection and NAT is working.

So something goes wrong with the ICE negotiation / firewall / crappy router blocking the traffic. Is there any ways to log the ICE negotiation in the integration, as well as the SDP offer?

I do see something from google chrome logs when trying to create the camera stream. There are several connection candidates but the IPs are incomplete. So it would be nice checking the SDP offer.

When I test the stun server from web browser on other machines in the same subnet as the hass box, I get a valid response. Same for the client laptop on the phone hotspot.

Tricky one :slight_smile:

When i’ve tried to do this before to get it working initially I would look at these:

  • Use browser developer tools to see the SDP offer and response. You can see it in the websocket to home assistant frontend
  • Use tcpdump and see what kinds of packets are sent