You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have read the documentation for esp-protocols components and the issue is not addressed there.
I have updated my esp-protocols branch (master or release) to the latest version and checked that the issue is present there.
I have searched the issue tracker for a similar issue and not found a similar issue.
General issue report
Recently in Home Assistant there have been issues when resolving mdns addresses of devices running on esp32. After some debugging it seems that when requesting SRV and TXT records along with A and AAAA from name.local the devices fail to respond at all. I believe this is the default in Zeroconf. However if requesting only A and AAAA record then do correctly get a response.
This affects Arduino v3, but also tested on esp-idf v5.4 with latest mDNS component and using the query_advertise example which has same issue.
Here is a test script that reproduces the issues, running this script no answer is ever received.
import asyncio
import logging
from zeroconf import (
DNSOutgoing,
DNSQuestion,
)
from zeroconf.asyncio import AsyncZeroconf
from zeroconf.const import (
_CLASS_IN,
_FLAGS_QR_QUERY,
_TYPE_A,
_TYPE_AAAA,
_TYPE_ANY,
_TYPE_TXT,
_TYPE_SRV,
)
logging.basicConfig(level=logging.DEBUG)
logging.getLogger("zeroconf").setLevel(logging.DEBUG)
name = "esp32-mdns.local."
lower_name = name.lower()
async def test_send_a_aaaa_query_lowercase_a_with_srv_txt():
"""Send a query with the A record type with the lowercase name."""
aiozc = AsyncZeroconf()
await aiozc.zeroconf.async_wait_for_start()
outgoing = DNSOutgoing(_FLAGS_QR_QUERY)
outgoing.add_question(DNSQuestion(lower_name, _TYPE_SRV, _CLASS_IN))
outgoing.add_question(DNSQuestion(lower_name, _TYPE_TXT, _CLASS_IN))
outgoing.add_question(DNSQuestion(lower_name, _TYPE_A, _CLASS_IN))
outgoing.add_question(DNSQuestion(lower_name, _TYPE_AAAA, _CLASS_IN))
aiozc.zeroconf.async_send(outgoing)
await asyncio.sleep(3)
asyncio.run(test_send_a_aaaa_query_lowercase_a_with_srv_txt())
However if remove the following 2 lines from that script:
github-actionsbot
changed the title
mDNS resolution fails when requesting SRV and TXT records
mDNS resolution fails when requesting SRV and TXT records (IDFGH-14556)
Feb 1, 2025
Shouldn't you be asking for the actual service/protocol when querying SRV and TXT records?
I can see that the ESP32 sees the query packet as:
RX[0][0]: From: 192.168.0.32:5353, To: 224.0.0.251, Packet[1494370]:
Q: esp32-mdns...local. SRV IN
Q: esp32-mdns...local. TXT IN
Q: esp32-mdns.local. A IN
Q: esp32-mdns.local. AAAA IN
which are not the services and TXT records it advertizes:
I'll have to consult the specification on these invalid queries, if we still need to reply, at least to the valid items or not. (it looks like the older versions of mdns lib were more permissive, but need to double check...)
Answers checklist.
General issue report
Recently in Home Assistant there have been issues when resolving mdns addresses of devices running on esp32. After some debugging it seems that when requesting
SRV
andTXT
records along withA
andAAAA
fromname.local
the devices fail to respond at all. I believe this is the default in Zeroconf. However if requesting onlyA
andAAAA
record then do correctly get a response.This affects Arduino v3, but also tested on esp-idf v5.4 with latest mDNS component and using the query_advertise example which has same issue.
Here is a test script that reproduces the issues, running this script no answer is ever received.
However if remove the following 2 lines from that script:
It works as expected and a response is received:
The text was updated successfully, but these errors were encountered: