ESP8266 Developer Zone The Official ESP8266 Forum 2015-08-09T21:34:54+08:00 https://bbs.espressif.com:443/feed.php?f=7&t=922 2015-08-09T21:34:54+08:00 2015-08-09T21:34:54+08:00 https://bbs.espressif.com:443/viewtopic.php?t=922&p=3104#p3104 <![CDATA[Re: mDNS seems to work only intermittantly]]> Statistics: Posted by stickben — Sun Aug 09, 2015 9:34 pm


]]>
2015-08-09T11:03:14+08:00 2015-08-09T11:03:14+08:00 https://bbs.espressif.com:443/viewtopic.php?t=922&p=3102#p3102 <![CDATA[mDNS seems to work only intermittantly]]>
Usually the sequence goes
1. connect to AP
2. mdns does not work
3. reset
4. mdns works
5. reset
6. mdns works
7. disconnect/reconnect
8. mdns does not work.

I have verified that my pc is getting a valid IP with the correct gateway. Anyone else having this problem?


Code:

NonvolStorageArea *pNonvol;

   if(pMDNSInfo != NULL)
   {
      espconn_mdns_close();
      os_free(pMDNSInfo);
   }

   if(SysStateSetupMode())
   {
      wifi_set_broadcast_if(STATIONAP_MODE);
   }
   else
   {
      wifi_set_broadcast_if(STATION_MODE);
   }

   pMDNSInfo = (struct mdns_info *)os_zalloc(sizeof(struct mdns_info));

   pNonvol = NonvolGetMemoryStore();
   pMDNSInfo->host_name = pNonvol->SystemSettings.ServerName;
   pMDNSInfo->ipAddr = ip;
   pMDNSInfo->server_name = pNonvol->SystemSettings.ServerName;
   pMDNSInfo->server_port = 80;
   espconn_mdns_init(pMDNSInfo);

Statistics: Posted by stickben — Sun Aug 09, 2015 11:03 am


]]>