Raw SDK mdns problems
Posted: Sun Sep 11, 2016 11:56 pm
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:
I'm calling this after the IP is connected (EVENT_STAMODE_GOT_IP) with:
Any clues?
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 all
void 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?