MDNS ESP8266 fix

This commit is contained in:
2021-12-26 15:49:34 +03:00
parent 2779c9f7d5
commit c67bab2173

View File

@@ -544,10 +544,11 @@ lan_status lanLoop() {
char mdnsName[32] = "LightHub";
SetBytes(sysConf.mac+4,2,mdnsName+8);
mdnsName[8+4]='\0';
if (!MDNS.begin(mdnsName))
errorSerial<<("Error setting up MDNS responder!")<<endl;
else infoSerial<<("mDNS responder started")<<endl;
else infoSerial<<F("mDNS responder started: ")<<mdnsName<<F(".local")<<endl;
MDNS.addService("http", "tcp", OTA_PORT);
#endif
@@ -2291,6 +2292,8 @@ void loop_main() {
#ifndef WIFI_ENABLE
yield();
mdns.run();
#elif defined(ARDUINO_ARCH_ESP8266)
MDNS.update();
#endif
#endif
}
@@ -2373,6 +2376,8 @@ void modbusIdle(void) {
#ifdef MDNS_ENABLE
#ifndef WIFI_ENABLE
mdns.run();
#elif defined(ARDUINO_ARCH_ESP8266)
MDNS.update();
#endif
#endif
} //End network runners