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

Fix ONVIF Camera Connectivity Behind NAT and Routers #15886

Draft
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

tibacher
Copy link

@tibacher tibacher commented Jan 8, 2025

Proposed change

This pull request addresses an issue with ONVIF cameras located behind NAT (Network Address Translation) routers in Frigate. When queried, these cameras return their private IP addresses and internal ports, making it impossible to access them externally. This issue is particularly relevant for users with cameras installed behind routers.

The solution involves rewriting the xaddrs in the ONVIF response to utilize the external IP address and port provided during the connection setup, a method already implemented in the python-onvif-zeep package.

I have tested this solution successfully in Frigate version 14.1, ensuring that it works as expected for cameras behind routers. This update will greatly improve connectivity in NAT environments and ensure that users can access their cameras from outside the local network.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code
  • Documentation Update

Additional information

Checklist

  • The code change is tested and works locally. Also tested in realworld scenario with camera behind NAT.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • The code has been formatted using Ruff (ruff format frigate)

Sorry had no time sofar to formt with ruff and run the local test pass.

Copy link

netlify bot commented Jan 8, 2025

Deploy Preview for frigate-docs canceled.

Name Link
🔨 Latest commit 4e3f50f
🔍 Latest deploy log https://app.netlify.com/sites/frigate-docs/deploys/677e2a61f7c56b00083f43b6

@hawkeye217
Copy link
Collaborator

Because we recently updated the base image and python version for 0.16, we plan to upgrade to python-onvif-zeep-async at some point soon: https://github.com/openvideolibs/python-onvif-zeep-async

@NickM-27
Copy link
Collaborator

NickM-27 commented Jan 8, 2025

See #15894

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

Successfully merging this pull request may close these issues.

Support for ONVIF Camera Connections Behind NAT and Routers
3 participants