Replies: 2 comments 1 reply
-
|
The example code is intended to be used as a base for commercial thread border router products to the best of my understanding, so it should provide a "best practices" example of how to set up the hostname for mdns. I would recommend using (part of) the mac address in the hostname in order to make it unique. A fairly common practice that i've seen in commercial devices is to take the last two bytes of the mac address in hex and append them to the hostname. It's unlikely that someone will have two devices from the same vendor where the mac address matches in the last 2 bytes. Alternately, use the whole mac address in hex with a short (~3 letter) prefix. The thread border router example code already uses the mac address to make the wifi AP name unique for performing setup over wifi. |
Beta Was this translation helpful? Give feedback.
-
|
Hi @jamesonuk and @kepstin The TBR example is intended to demonstrate how to run a FreeRTOS-based Thread Border Router on an ESP chip, with the primary focus on Thread features. Regarding the host name, this is typically application-specific, and you are free to define your own TBR host name. As for your comment that it “gives them a static mDNS name which has led to some confusion and conflicts,” I believe mDNS includes a mechanism to automatically resolve name conflicts. Please see: https://github.com/espressif/esp-protocols/blob/master/components/mdns/mdns_receive.c#L136C11-L136C77 So even if multiple TBRs are set with the same host name within the same local network, there should be no conflicts. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I setup two of these to test their use and also to test TREL.
I believe
esp-thread-br/examples/basic_thread_border_router/main/esp_ot_br.c
Line 98 in b8bffd2
gives them a static mdns name which has lead to some confusion and conflicts.
would this be better to use the MAC address or some other identifier in the name here or is there a better way to do this?
AI has suggested setting
CONFIG_OPENTHREAD_BORDER_AGENT_MESHCOP_SERVICE_BASE_NAMEto match the one set above.It also mentioned that
mdns_instance_name_setshould be used to set a display name.Any advice appreciated and is it worth including any of this in the example code?
Beta Was this translation helpful? Give feedback.
All reactions