MDNS service persistence

braincat
Posts: 12
Joined: Tue Jun 15, 2021 9:54 pm

MDNS service persistence

Postby braincat » Fri Sep 03, 2021 12:30 am

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.

braincat
Posts: 12
Joined: Tue Jun 15, 2021 9:54 pm

Re: MDNS service persistence

Postby braincat » Fri Sep 03, 2021 1:51 am

Turns out MDNS is just a symptom. Wifi on esp32 is disconnecting with a message
wifi:bcn_timout,ap_probe_send_start

braincat
Posts: 12
Joined: Tue Jun 15, 2021 9:54 pm

Re: MDNS service persistence

Postby braincat » Fri Sep 03, 2021 2:35 am

... and I found a heap memory leak. Happy to say, once I fixed it, the problem went away.

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: MDNS service persistence

Postby WiFive » Fri Sep 03, 2021 3:32 am


braincat
Posts: 12
Joined: Tue Jun 15, 2021 9:54 pm

Re: MDNS service persistence

Postby braincat » Fri Sep 03, 2021 12:38 pm

Very interesting, thanks for pointing this out.

Who is online

Users browsing this forum: No registered users and 61 guests