brutella / hc

hc is a lightweight framework to develop HomeKit accessories in Go.
Apache License 2.0
1.74k stars 189 forks source link

Issues with dnssd v1.2.0 #198

Closed mrlnc closed 2 years ago

mrlnc commented 3 years ago

Hi everybody,

I'm facing issues with commit 4da759009452b2863db09ff6b03c349103ec5bd6. I haven't found the root cause, but it seems that dnssd detects conflicts even if there are none.

https://github.com/brutella/dnssd/blob/665cf86dce8e8a8b4c6164e2ac038d6b667dc80b/probe.go#L77 https://github.com/brutella/dnssd/blob/665cf86dce8e8a8b4c6164e2ac038d6b667dc80b/probe.go#L83

I tried patching the format, but still the .local address is being incremented. Reverting 4da759009452b2863db09ff6b03c349103ec5bd6 works for me.

brutella commented 3 years ago

On which platform are you using the library?

mrlnc commented 3 years ago

I'm on Ubuntu Server 20.04.1, Raspberry Pi 4 (arm64).

[EDIT]

hc 1.2.4 seems to work just fine on a standard Intel machine.

I removed the sensor from Home, deleted the profile folder, and added the sensor again. PCAPs for amd64/arm64: pcaps.zip Filter: ip.addr == iPad && (mdns || http)

rblenkinsopp commented 3 years ago

I encountered this issue running on a device with 2 interfaces to the same network. dnssd appeared to conflict with itself creating an "InstanceID (2)" entry which was unconnectable from homekit.

Disabling one of the two interfaces successfully works around the issue in my case, but it's something that should be looked at.

brutella commented 2 years ago

This issue should already be fixed by now.

mrlnc commented 2 years ago

I still encounter the same issue with the latest commit, but I could fix it like @rblenkinsopp suggested. I had two interfaces (eth and wifi) connected to the same network.

Thanks both of you.