It's still possible with javascript Node library "bonjour" or standard "dns-sd" command in macOS terminal, but the thing is, I want to make a standalone mDNS announcer on ESP8266 Wemos D1 module.
But when I do as follows I get the same hostname and name of service:
#include <ESP8266mDNS.h>
void setup() {
if (!MDNS.begin("Homebridge-1234")) {
Serial.println("Error setting up MDNS announcer!");
while (1) {
delay(1000);
}
}
Serial.println("mDNS announcer is started");
MDNS.addService("hap", "tcp", 51226);
MDNS.addServiceTxt("hap", "tcp", "pv", "1.1");
MDNS.addServiceTxt("hap", "tcp", "ff", "0");
MDNS.addServiceTxt("hap", "tcp", "s#", "1");
MDNS.addServiceTxt("hap", "tcp", "c#", "2");
...
}
void loop() {
MDNS.update();
}
name: "Homebridge-1234"
hostname: homebridge-12324.local