-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Description
I've tried getting a list of service instances with this code:
numServices = MDNS.queryService("_revpipyload", "tcp");
When using a service browser, I see both of my instances like so:
Both the MQTT and NodeRED instances are visible.
However, no matter what I do, the line above always only returns "1". Also, whenever i try to look up the entries with MDNS.hostname(X). Only index 0 returns a value.
I've tried this with different ESP32 devkits, Including but not limited to: wESP32, Olimex POE ISO, ESP32_CAM, ESP32 Devkit V4, and so on...
Each one so far has the same problem.
I've also tried changing the service names and protocols using other Avahi/Bonjour capable devices, but I get the same results.
I use the ESP32 Arduino core version 2.0.8 with PlatformIO.
And my code's setup looks like this:
void setup()
{
Serial.begin(115200);
ETH.begin(0, -1, 16, 17, ETH_PHY_RTL8201);
MDNS.begin("ControlUnit");
MDNS.addService("revpipyload", "tcp", 123);
numServices = MDNS.queryService("_revpipyload", "tcp");
Serial.print("Number of services found: ");
Serial.println(numServices);
for (int i = 0; i < numServices; i=i+1) {
Serial.println("---------------");
Serial.print("Hostname: ");
Serial.println(MDNS.hostname(i));
Serial.print("IP address: ");
Serial.println(MDNS.IP(i));
Serial.print("Port: ");
Serial.println(MDNS.port(i));
Serial.println("---------------");
}
}
Even if i try manually to print out MDNS.hostname(1) I get nothing.
Is this considered a bug?