mDNS queryService for self reports nothing?

davepl
Posts: 29
Joined: Wed Jun 27, 2018 5:29 pm

mDNS queryService for self reports nothing?

Postby davepl » Mon Oct 22, 2018 5:25 pm

I have the following code which I -expected- would return my own service that I just successfully added. A delay doesn't help!

Code: Select all

    if (g_mDNS.begin("LEDWifi"))
    {
	    Serial.println("mDNS registered");
        g_mDNS.addService("nightdriver", "tcp", 81);
    }
	else
		Serial.println("ERROR: mDNS failed to register");

    if (0 == g_mDNS.queryService("nightdriver", "tcp"))
        Serial.println("WARNING: Did not find _nightdriver._tcp service");
Does anyone know why this wouldn't work (ie: queryService returns 0)? And in any event, all I'm looking for is my own hostname that I can see publicly in a Bonjour browser, like LEDWifi-2 or LEDWifi-3, depending on what order they boot up in!

Who is online

Users browsing this forum: No registered users and 69 guests