ESP8266 Developer Zone The Official ESP8266 Forum 2015-08-21T14:08:05+08:00 https://bbs.espressif.com:443/feed.php?f=7&t=908 2015-08-21T14:08:05+08:00 2015-08-21T14:08:05+08:00 https://bbs.espressif.com:443/viewtopic.php?t=908&p=3352#p3352 <![CDATA[Re: mDNS errors with "udp_join_multigrup failed!"]]>
To expand on it a bit, the startup code does not do wifi_get_ip_info() it populate the 'struct ip_info ipconfig' before the mDNS init.

So, the IP Address in the in 'struct mdns_info *info ' ... initialized later :

Code:

      
      struct mdns_info *info = (struct mdns_info *)os_zalloc(sizeof(struct mdns_info));
      info->ipAddr = ipconfig.ip.addr; //ESP8266 station IP


is likely null, or worse undefined. Thus creating the error. startup() is called multiple as part of the os_timer boottimer - however, when removing the ntp call to test, wifi_get_ip_info() and the initialization of the struct mdns_info, are done in the same loop, so the local struct had the info, verse when waiting for the time to get set, multiple calls of startup() were needed, resulting in struct ip_info n to be un-initialized.

Statistics: Posted by DavidDPD — Fri Aug 21, 2015 2:08 pm


]]>
2015-08-11T14:45:01+08:00 2015-08-11T14:45:01+08:00 https://bbs.espressif.com:443/viewtopic.php?t=908&p=3138#p3138 <![CDATA[Re: mDNS errors with "udp_join_multigrup failed!"]]>
The "struct ip_info ipconfig;" in function "startup" is a local variable.

Code:

static void CP_ICACHE_FLASH_ATTR
startup()
{
   uint32 t;
   uint32_t status;
   char buffer[128] = {0};
   struct ip_info ipconfig;
... ...
}

Statistics: Posted by ESP_Faye — Tue Aug 11, 2015 2:45 pm


]]>
2015-08-10T13:30:31+08:00 2015-08-10T13:30:31+08:00 https://bbs.espressif.com:443/viewtopic.php?t=908&p=3110#p3110 <![CDATA[Re: mDNS errors with "udp_join_multigrup failed!"]]>
Espressif_Faye wrote:
Hi,

Could you provide the captured packets for debugging ?

Could you provide your test code, we will have a try.

Thanks for your interest in Espressif Systems and ESP8266 !



I was ripping down the code to give you a smaller snippet, and in the process, I've found the issue. I am also using the NTP code by Richard Burton at https://github.com/raburton/esp8266/tree/master/ntp to grab the current unixtime.

This call is apparently polluting the UDP stack, something that the closed source mDNS SDK calls need. Simply calling mDNS before the NTP call fixes the issue. And for my application, this is perfectly acceptable.

However, this shouldn't be the case, so here is the the broken code, in case there is some clean up in the SDK to be done on the UDP side. It could be a usage bug with the NTP client, however it's pretty much following the suggested and sample code in the SDK docs.

I have not done a packet capture, but here is very reproducible code, with ifdef broken and unbroken examples with the NTP code. I have it up over at github.

https://github.com/daviddpd/dpd8266/tree/master/mdns

Statistics: Posted by DavidDPD — Mon Aug 10, 2015 1:30 pm


]]>
2015-08-07T19:25:55+08:00 2015-08-07T19:25:55+08:00 https://bbs.espressif.com:443/viewtopic.php?t=908&p=3080#p3080 <![CDATA[Re: mDNS errors with "udp_join_multigrup failed!"]]>
Could you provide the captured packets for debugging ?

Could you provide your test code, we will have a try.

Thanks for your interest in Espressif Systems and ESP8266 !

Statistics: Posted by ESP_Faye — Fri Aug 07, 2015 7:25 pm


]]>
2015-08-06T10:59:51+08:00 2015-08-06T10:59:51+08:00 https://bbs.espressif.com:443/viewtopic.php?t=908&p=3064#p3064 <![CDATA[mDNS errors with "udp_join_multigrup failed!"]]>

Code:

udp_join_multigrup failed!


I validate that the station is connected and has a validate IP before issuing the mdns setup.

Statistics: Posted by DavidDPD — Thu Aug 06, 2015 10:59 am


]]>