Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebRTC external access #192

Closed
Morphy99 opened this issue Jan 23, 2023 · 14 comments
Closed

WebRTC external access #192

Morphy99 opened this issue Jan 23, 2023 · 14 comments
Labels
question Further information is requested

Comments

@Morphy99
Copy link

Morphy99 commented Jan 23, 2023

I'm having trouble viewing webrtc streams from outside my network. I'm using the Frigate v12 beta 5 addon in HA OS and I've defined my external IP as a candidate. I've also opened port 8555 on my router and forwarded it to the local IP of my HA instance.

  webrtc:
    candidates:
      - xxx.xxx.xxx.xxx:8555

I've also tried with local ip:8555, stun:8555 but nothing works.

I get the following on the addon starting:
[WARN] Failed to get IP address from supervisor

On shields up has reported the port as being open:
image

I did think this was working as I was using the previous version of WebRTC Camera and it didn't report the protocol being used, which turned out to be MSE.

@AlexxIT AlexxIT added the question Further information is requested label Jan 23, 2023
@AlexxIT
Copy link
Owner

AlexxIT commented Jan 23, 2023

Are you sure that port 8555 is open on the Frigate addon? Because, as I know, it is closed by default.

[WARN] Failed to get IP address from supervisor

I don't know how the IP detection mechanism works in the Frigate addon. It is better to ask this in the Frigate project.

@Morphy99
Copy link
Author

It's open as far as the settings show.
image

I don't know how the IP detection mechanism works in the Frigate addon. It is better to ask this in the Frigate project.

Ok, I did ask but they said to check the go2rtc settings and something about a symmetrical NAT but I don't think I have one of those.

@AlexxIT
Copy link
Owner

AlexxIT commented Jan 23, 2023

Well. Port forward only helps if you have public IP. It not related with symmetrical NAT.

If client and server not behind symmetric NAT - you not need any port forward.
I don't know if this test accurate: https://tomchen.github.io/symmetric-nat-test/

@Morphy99
Copy link
Author

I have a public IP yes and not behind a symmetric NAT.
So I just restarted my host as it occurred to me I hadn't tried that. Now Frigate won't start as the port 8555 is in use. Which then led me to realise the WebRTC Camera integration is using it... So I've disabled it now but I still can't connect. I didn't realise Frigate and WebRTC Camera can't coexist.

@NickM-27
Copy link
Contributor

I didn't realise Frigate and WebRTC Camera can't coexist.

they can, if you use version 3.0 of webrtc integration it will auto detect frigate 0.12 and use it as the webrtc provider (since they both use go2rtc internally)

@NickM-27
Copy link
Contributor

you should use the browser console to get logs as to why webrtc isn't working

@AlexxIT
Copy link
Owner

AlexxIT commented Jan 23, 2023

@Morphy99 you need reinstall WebRTC Camera integration. It can automatically find external go2rtc and link to it.
So it won't run build-in go2rtc.

@Morphy99
Copy link
Author

Ah ok! I didn't see any mention of this in either docs, apologies if I missed it! I removed the integration, then deleted from HACS, restarted HA core and then downloaded and added again.

This time I get a prompt to add the server. It says to add it as http://localhost:1984 however that wouldn't work and neither would 127.0.0.1 so I added the Frigate hostname ccab4aaf-frigate-fa-beta which says success!

Wasn't able to load it still so I did a test with my laptop tethered to mobile data and the webrtc card looked as though it was going to play, the camera image is displayed however nothing after that. Then I went back to the Android app and started playing but very jerky and stop start. After a few minutes I went back to it and now it's playing fine! I have no idea why it took so long to play well, almost like it needed warming up!

@NickM-27
Copy link
Contributor

This time I get a prompt to add the server. It says to add it as http://localhost:1984 however that wouldn't work and neither would 127.0.0.1

That's because port 1984 isn't passed through on the addon by default for frigate

@Morphy99
Copy link
Author

Sorry yes, of course. I've enabled that port and re-added the integration with localhost. Thanks Nick.

@AlexxIT
Copy link
Owner

AlexxIT commented Jan 23, 2023

So no problem? Close issue?

@Morphy99
Copy link
Author

Yes I'll close it. It's stopped working again now but I think it's something to do with codecs.

@Morphy99
Copy link
Author

Is there something that would prevent webrtc viewing from a device on a cell data network (4g/5g)? I have a HA instance on another LAN and when my mobile device is connected to another, completely separate LAN, via WiFi, webrtc works. When connected via the cellular network it doesn't.

@AlexxIT
Copy link
Owner

AlexxIT commented Jan 25, 2023

AlexxIT/WebRTC#378

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants