mDNS seems to work only intermittantly

stickben
Posts: 12
Joined: Tue Jun 23, 2015 12:28 pm

mDNS seems to work only intermittantly

Postby stickben » Sun Aug 09, 2015 11:03 am

I have some code that is trying to set up the mdns so that I can refer to my module by name. But I usually I have to reset esp8266 several times before this works.

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: Select all

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);

stickben
Posts: 12
Joined: Tue Jun 23, 2015 12:28 pm

Re: mDNS seems to work only intermittantly

Postby stickben » Sun Aug 09, 2015 9:34 pm

Also, using version 1.3.0 of the SDK

Who is online

Users browsing this forum: No registered users and 28 guests