mirror of https://github.com/arendst/Tasmota.git
mDNS Performance Fix & mDNS ESP32 Support
This commit is contained in:
parent
e35cac1ba8
commit
f99f413065
|
@ -1,4 +1,4 @@
|
|||
//
|
||||
// Compat with ESP32
|
||||
//
|
||||
#include <mDNS.h>
|
||||
#include <ESPmDNS.h>
|
||||
|
|
|
@ -223,7 +223,7 @@
|
|||
#define KNX_ENHANCED false // [Knx_Enhanced] Enable KNX Enhanced Mode
|
||||
|
||||
// -- mDNS ----------------------------------------
|
||||
#define MDNS_ENABLED false // [SetOption55] Use mDNS (false = Disable, true = Enable)
|
||||
#define MDNS_ENABLED true // [SetOption55] Use mDNS (false = Disable, true = Enable)
|
||||
|
||||
// -- Time - Up to three NTP servers in your region
|
||||
#define NTP_SERVER1 "pool.ntp.org" // [NtpServer1] Select first NTP server by name or IP address (129.250.35.250)
|
||||
|
|
|
@ -78,12 +78,15 @@ void MdnsAddServiceHttp(void) {
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef ESP8266 //Not needed with esp32 mdns
|
||||
void MdnsUpdate(void) {
|
||||
if (2 == Mdns.begun) {
|
||||
MDNS.update();
|
||||
AddLog_P(LOG_LEVEL_DEBUG_MORE, PSTR(D_LOG_MDNS "MDNS.update"));
|
||||
MDNS.update(); // this is basically passpacket like a webserver
|
||||
// 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 // USE_DISCOVERY
|
||||
|
||||
|
|
|
@ -401,11 +401,6 @@ void WifiCheckIp(void)
|
|||
memcpy((void*) &Settings.wifi_bssid, (void*) bssid, sizeof(Settings.wifi_bssid));
|
||||
}
|
||||
Wifi.status = WL_CONNECTED;
|
||||
#ifdef USE_DISCOVERY
|
||||
#ifdef WEBSERVER_ADVERTISE
|
||||
MdnsUpdate();
|
||||
#endif // USE_DISCOVERY
|
||||
#endif // WEBSERVER_ADVERTISE
|
||||
} else {
|
||||
WifiSetState(0);
|
||||
uint8_t wifi_config_tool = Settings.sta_config;
|
||||
|
|
|
@ -383,6 +383,17 @@ void SleepDelay(uint32_t mseconds) {
|
|||
void loop(void) {
|
||||
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);
|
||||
XsnsCall(FUNC_LOOP);
|
||||
|
||||
|
|
|
@ -123,7 +123,7 @@ String EthernetMacAddress(void);
|
|||
#undef USE_RF_FLASH
|
||||
|
||||
// Not ported (yet)
|
||||
#undef USE_DISCOVERY
|
||||
|
||||
#undef USE_MY92X1
|
||||
#undef USE_TUYA_MCU
|
||||
#undef USE_PS_16_DZ
|
||||
|
|
Loading…
Reference in New Issue