mirror of https://github.com/arendst/Tasmota.git
Merge pull request #10487 from BBBits/development
mDNS Performance Fix & mDNS ESP32 Support
This commit is contained in:
commit
7102189572
|
@ -1,4 +1,4 @@
|
||||||
//
|
//
|
||||||
// Compat with ESP32
|
// Compat with ESP32
|
||||||
//
|
//
|
||||||
#include <mDNS.h>
|
#include <ESPmDNS.h>
|
||||||
|
|
|
@ -78,12 +78,15 @@ void MdnsAddServiceHttp(void) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef ESP8266 //Not needed with esp32 mdns
|
||||||
void MdnsUpdate(void) {
|
void MdnsUpdate(void) {
|
||||||
if (2 == Mdns.begun) {
|
if (2 == Mdns.begun) {
|
||||||
MDNS.update();
|
MDNS.update(); // this is basically passpacket like a webserver
|
||||||
AddLog_P(LOG_LEVEL_DEBUG_MORE, PSTR(D_LOG_MDNS "MDNS.update"));
|
// being called in main loop so no logging
|
||||||
|
// AddLog_P(LOG_LEVEL_DEBUG_MORE, PSTR(D_LOG_MDNS "MDNS.update"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif // ESP8266
|
||||||
#endif // WEBSERVER_ADVERTISE
|
#endif // WEBSERVER_ADVERTISE
|
||||||
#endif // USE_DISCOVERY
|
#endif // USE_DISCOVERY
|
||||||
|
|
||||||
|
|
|
@ -401,11 +401,6 @@ void WifiCheckIp(void)
|
||||||
memcpy((void*) &Settings.wifi_bssid, (void*) bssid, sizeof(Settings.wifi_bssid));
|
memcpy((void*) &Settings.wifi_bssid, (void*) bssid, sizeof(Settings.wifi_bssid));
|
||||||
}
|
}
|
||||||
Wifi.status = WL_CONNECTED;
|
Wifi.status = WL_CONNECTED;
|
||||||
#ifdef USE_DISCOVERY
|
|
||||||
#ifdef WEBSERVER_ADVERTISE
|
|
||||||
MdnsUpdate();
|
|
||||||
#endif // USE_DISCOVERY
|
|
||||||
#endif // WEBSERVER_ADVERTISE
|
|
||||||
} else {
|
} else {
|
||||||
WifiSetState(0);
|
WifiSetState(0);
|
||||||
uint8_t wifi_config_tool = Settings.sta_config;
|
uint8_t wifi_config_tool = Settings.sta_config;
|
||||||
|
|
|
@ -383,6 +383,17 @@ void SleepDelay(uint32_t mseconds) {
|
||||||
void loop(void) {
|
void loop(void) {
|
||||||
uint32_t my_sleep = millis();
|
uint32_t my_sleep = millis();
|
||||||
|
|
||||||
|
// check LEAmDNS.h
|
||||||
|
// MDNS.update() needs to be called in main loop
|
||||||
|
#ifdef ESP8266 //Not needed with esp32 mdns
|
||||||
|
#ifdef USE_DISCOVERY
|
||||||
|
#ifdef WEBSERVER_ADVERTISE
|
||||||
|
// previously this was only called in WifiCheckIp() and that causes delays in responses to mdns
|
||||||
|
MdnsUpdate();
|
||||||
|
#endif // WEBSERVER_ADVERTISE
|
||||||
|
#endif // USE_DISCOVERY
|
||||||
|
#endif // ESP8266
|
||||||
|
|
||||||
XdrvCall(FUNC_LOOP);
|
XdrvCall(FUNC_LOOP);
|
||||||
XsnsCall(FUNC_LOOP);
|
XsnsCall(FUNC_LOOP);
|
||||||
|
|
||||||
|
|
|
@ -123,7 +123,7 @@ String EthernetMacAddress(void);
|
||||||
#undef USE_RF_FLASH
|
#undef USE_RF_FLASH
|
||||||
|
|
||||||
// Not ported (yet)
|
// Not ported (yet)
|
||||||
#undef USE_DISCOVERY
|
|
||||||
#undef USE_MY92X1
|
#undef USE_MY92X1
|
||||||
#undef USE_TUYA_MCU
|
#undef USE_TUYA_MCU
|
||||||
#undef USE_PS_16_DZ
|
#undef USE_PS_16_DZ
|
||||||
|
|
Loading…
Reference in New Issue