Page 1 of 1

MDNS service persistence

Posted: Fri Sep 03, 2021 12:30 am
by braincat
I noticed that mdns record that I am publishing, disappears after some time. My code follows mdns example:

Code: Select all

mdns_init();
mdns_hostname_set(hostname);
mdns_instance_name_set(instance_name);
const int txt_length = 1;
mdns_txt_item_t txt[txt_length] = {
  {"topic", "some_topic"}
  };
  mdns_service_add(nullptr, "_myservice", "_tcp", 20000, txt, txt_length);
I can see the published record e.g. in avahi-browse in linux, but that record goes away after some time even though the device is still up.

Thanks.

Re: MDNS service persistence

Posted: Fri Sep 03, 2021 1:51 am
by braincat
Turns out MDNS is just a symptom. Wifi on esp32 is disconnecting with a message
wifi:bcn_timout,ap_probe_send_start

Re: MDNS service persistence

Posted: Fri Sep 03, 2021 2:35 am
by braincat
... and I found a heap memory leak. Happy to say, once I fixed it, the problem went away.

Re: MDNS service persistence

Posted: Fri Sep 03, 2021 3:32 am
by WiFive

Re: MDNS service persistence

Posted: Fri Sep 03, 2021 12:38 pm
by braincat
Very interesting, thanks for pointing this out.