Shelly-homekit: Devices appear and disappear from Bonjour

Created on 5 Aug 2020  路  13Comments  路  Source: mongoose-os-apps/shelly-homekit

Originally reported here:

https://github.com/mongoose-os-apps/shelly-homekit/issues/30#issuecomment-665771893

Devices seem to be constantly appear and disappear from Bonjour.
This may or may not impact connectivity, this is not clear, but should be looked into anyway.

All 13 comments

can you try this firmware: https://rojer.me/files/shelly/2.4.0-beta2/
it has more frequent advertisements (every 20 seconds instead of every 60), hopefully enough will get through so records don't expire. @NS-K, can you try and let me know if it's any better?

@rojer quick question (as I'm also developing some mdns stuff currently). Does the mongoose mdns library send periodic announcements? Quickly checked the code and it seems like it does.
If I'm not wrong a mdns responder must not send periodic announcements.

From RFC 6762 8.3. Announcing

   A Multicast DNS responder MUST NOT send announcements in the absence
   of information that its network connectivity may have changed in some
   relevant way. In particular, a Multicast DNS responder MUST NOT send
   regular periodic announcements as a matter of course.

Am I missing any information? I'm currently also struggling with mdns related in my own mdns implementation (seemingly only in vlan setups), so I'm currently searching for anything I might have missed in my implementation.

um... ok, that's news to me. yes, we do advertise at regular intervals. not sure i'[m comfortable with removing this... the standard is pretty clear though.

@rojer saw the comment this issue originates from. This is actually normal behavior with the dns-sd tool on macOS. At least that is what I also observer on more or less crowded networks with certified HomeKit accessories.
Every hour (when mDNSResponder makes its query) sometimes all services get displayed as being removed and then added again a few milliseconds later. Don鈥檛 ask why, but doesn鈥檛 impact operation, unsure if this is related to this exact case.

What TTL does the mongoose mdns implementation use for the main PTR record (and TXT and SRV records). The required 75 minutes (4500 seconds) and 120 seconds for SRV?

we use 120 for all records

120 seconds should only be used for records where the hostname is included (SRV, A, AAAA). All records other than that (in the context of dns-as) has 4500.
https://tools.ietf.org/html/rfc6762#section-10

Otherwise it should be 4500 seconds, especially the main _hap._tcp.local PTR record. This will result in the querier only sending one query all 60 minutes. Otherwise a querier would need to reduce its intervals to 1-2 minutes. Not every querier might do that and might loose the advertisement (I experienced that with mDNSResponder). Could be the problem here.

updated the dns-sd library, PTR records now have 75 minute TTL

Additionally TXT records should use 75 minutes as well.

@rojer are you responsible for the dns-sd implementation? Scanned the code a bit and you might want to check out the RFC 6762 in general as I think there is a bunch of things missing. Especially the section about RFC 6762 7. Traffic Reduction (with focus on the known-answer suppression) is something you should checkout as its a must according to the spec.

I was out of order for a little while and now try to catch up with everything. I spend some time last weekend to assign all network devices an ip address and all the sudden there is no issue with shellys not responding in Bonjour.
Maybe this will help others as well.

I was out of order for a little while and now try to catch up with everything. I spend some time last weekend to assign all network devices an ip address and all the sudden there is no issue with shellys not responding in Bonjour.
Maybe this will help others as well.

You mean you've configured static ip addresses on your router?
That solved your issues?

Or try assigning an IP in your DHCP Server to each device, I do that here

@pivale
yes i assigned a static ip for all devices in my network. not just shellys.

I've added the suggestion to the trouble shooting guide. Thank you!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tohmc picture tohmc  路  10Comments

Baza207 picture Baza207  路  5Comments

italoc picture italoc  路  3Comments

andyblac picture andyblac  路  9Comments

andyblac picture andyblac  路  12Comments