You can chat about native SDK questions and issues here.

User avatar
By cmarrin
#54925 I'm setting up mdns based on the example in the SDK documentation. I wait until the IP is connected and I can = ping the board using the mdns name I gave it.

The odd thing is that I'm using the iNet Network Scanner Bonjour browsers (macOS). My mdns name almost never shows up there. Every once in a while it does and shows the service I've set on the ESP8266. Then soon after it goes away. This may or may not be related to my accessing the board through telnet (I set up a telnet server on it with a simple shell). Like I said before, I can go:

telnet <myname>.local 22

and I reliably access the board. Any idea what's going on. Here is the code for my mdns setup:

Code: Select allvoid initmdns(const char* hostname, uint8_t interface)
{
    struct ip_info ipconfig;
    wifi_get_ip_info(interface, &ipconfig);
    mdnsInfo.host_name = (char*) hostname;
    mdnsInfo.server_name = (char*) "m8rscript_server";
    mdnsInfo.ipAddr = ipconfig.ip.addr;
    mdnsInfo.server_port = 22;
    mdnsInfo.txt_data[0] = (char*) "version = now";
    mdnsInfo.txt_data[1] = (char*) "user1 = data1";
    mdnsInfo.txt_data[2] = (char*) "user2 = data2";
    espconn_mdns_init(&mdnsInfo);
    os_printf("The mDNS responder is running at %s.local.\n", hostname);
}


I'm calling this after the IP is connected (EVENT_STAMODE_GOT_IP) with:

Code: Select all        initmdns("m8rscript", STATION_IF);


Any clues?
User avatar
By cmarrin
#54965 After researching more, my answer may be that the the built-in functionality only does the "announcement" of the service and is not an mDNS responder. So I'm not looking at the various mDNS responder classes for Sming, Arduino and others to see how they do it
User avatar
By cmarrin
#57833 Just to look back here. m8rscript (https://github.com/cmarrin/m8rscript) now has an MDNSResponder class which is built directly on top of my UDP class, which is built on top of the espconn APIs. It works great and is very reliable. I wrote a blog post about my experiences:

http://marrin.org/2016/09/21/multicast- ... bulations/