hjdhjd / homebridge-unifi-protect

:video_camera: Complete HomeKit integration for all UniFi Protect device types with full support for most features including HomeKit Secure Video, and more. https://homebridge.io
Other
1.39k stars 84 forks source link

Multiple Interfaces issue #1091

Closed pudge closed 2 weeks ago

pudge commented 2 weeks ago

Homebridge UniFi Protect Version

v7.1.2

Homebridge Platform and OS

Ubuntu 22.04.4

Homebridge Version

v1.8.2

Node Version

v20.12.2

UniFi OS Version

v3.2.12

UniFi Protect Controller Version

v4.0.33

Describe the problem

I set my Homebridge to bind to my main interface IP, but the streams still come through with different IPs (I am using Wireshark to peek at it; binding to 192.168.1.12, but the stream now is at 192.168.2.12).

Is there any way to tell the stream to bind to a specific IP?

Homebridge HBUP JSON configuration

{
    "controllers": [
        {
            "address": "192.168.1.1",
            "password": "xxx",
            "username": "homebridge"
        }
    ],
    "name": "UniFi Protect",
    "options": [
        "Disable.Video.Transcode"
    ],
    "ringDelay": 0,
    "verboseFfmpeg": true,
    "_bridge": {
        "username": "0E:17:88:49:AA:34",
        "port": 44730
    },
    "platform": "UniFi Protect"
}

Relevant log output

[6/18/2024, 8:43:52 AM] [UniFi Protect] G4 Cage [G4 Bullet]: [info] Output #0, rtp, to 'srtp://192.168.1.37:63876?rtcpport=63876&pkt_size=1378':

From Wireshark on the Mac:
Internet Protocol Version 4, Src: 192.168.1.37, Dst: 192.168.2.12
User Datagram Protocol, Src Port: 63876, Dst Port: 45014

Acknowledgment that you are only running UniFi OS and UniFi Protect releases from the Ubiquiti Official release channel

hjdhjd commented 2 weeks ago

There is...and it's in the documentation. :smile: This is not an HBUP issue but a Homebridge one.

Troubleshooting

pudge commented 2 weeks ago

I’m sorry, I wasn’t fully clear. I did that, but the address that comes through keeps changing.

hjdhjd commented 2 weeks ago

Homebridge supplies the addresses...if you believe there's a bug, I'd suggest moving this issue to the Homebridge issue list, there really isn't much for me to do on the HBUP end I'm afraid. HBUP supplies the stream based on what Homebridge is asking it to do. If there's a problem in how Homebridge is processing interfaces and IPs, I'd point you over there.

I run on a Mac myself, also multi homed, and don't run into these issues, for what it's worth. You might want to investigate a bit further in your own setup. It may seem obvious, but I'd also suggest:

  1. Making sure you restart Homebridge holistically once you make changes to it's configuration.
  2. Troubleshooting by removing multihoming from the equation and ensuring things work correctly.
  3. If you're using Docker or similar containerization strategies, running natively. It has numerous advantages including hardware acceleration on macOS.
  4. If you're running more complex networking setups (VLANs etc), simplifying things and seeing where things may be breaking down incrementally. Based on your own troubleshooting, I suspect this one is the least likely to be helpful at the moment.
pudge commented 2 weeks ago

To be even more clear: the stream was being requested on 192.168.1.12. Then I changed the Homebridge to bind to that interface. Now the stream is on 192.168.2.12. It’s also been on 192.168.3.12. It keeps moving!

pudge commented 2 weeks ago

One more comment: the stream has worked. It worked after first install. It worked after binding Homebridge to 192.168.1.12. But eventually the stream moves again.

hjdhjd commented 2 weeks ago

Again - your issue isn't in HBUP. There's not much more I can do here. 😄

pudge commented 2 weeks ago

Ok. Sorry, I started replying before I saw your previous reply about Homebridge being the problem. Thanks for your help.

If I find anything relevant I’ll let you know.

pudge commented 2 weeks ago

Hi, quick question (hopefully): where in your code would I find where you are receiving the IP from Homebridge?

(Also, deactivating my other interfaces solved the problem, but I might try to bring them back up if I can figure out the issue here.)

Thanks!

github-actions[bot] commented 2 weeks ago

This issue is locked to prevent necroposting on closed issues. Please create a new issue for related support requests, bug reports, or feature suggestions.