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

unifi-protect: Use connectionHost to support cameras distributed between stacked nvrs #1128

Merged
merged 3 commits into from
Oct 12, 2023
Merged

unifi-protect: Use connectionHost to support cameras distributed between stacked nvrs #1128

merged 3 commits into from
Oct 12, 2023

Conversation

regaw-leinad
Copy link
Contributor

Problem

When utilizing stacked NVRs with the unifi-protect plugin, we encountered an issue where the plugin failed to generate correct RTSP stream URLs for cameras connected to the secondary NVR. This limitation stemmed from the fact that only the primary IP was available and configurable in the UI. As a result, we could only access camera streams from the primary NVR, rendering those on the secondary NVR inaccessible.

Action

To address this issue, we revised the approach to generating RTSP stream URLs. Instead of statically utilizing the primary NVR's IP, we integrated the use of the connectionHost property, which is returned from the API for each camera. The connectionHost property contains the specific IP address of the host NVR that a camera is connected to, ensuring that the correct IP address is used for generating the RTSP stream URL, whether the camera is on the primary or secondary NVR.

Result

This modification results in a successful and consistent generation of RTSP stream URLs for all cameras across both primary and secondary NVRs.

Other Solutions Considered

We evaluated an alternative solution that involved manually adding the secondary IP during the setup process. However, we decided against this approach as it compromises the abstraction of NVR stacking. It would also introduce additional configuration steps, increasing the potential for user errors and complicating the setup process.

cc: @shyawnkarim

@koush koush merged commit 0349977 into koush:main Oct 12, 2023
koush added a commit that referenced this pull request Oct 14, 2023
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.

None yet

2 participants