From a8515a7d6626cd1e969980bd4f1e8183d684b994 Mon Sep 17 00:00:00 2001 From: david gauchard Date: Wed, 5 Feb 2020 10:14:42 +0100 Subject: [PATCH 1/2] use STA as default interface in mDNS (#7042) --- libraries/ESP8266mDNS/src/LEAmDNS.cpp | 27 +++++++-------------------- 1 file changed, 7 insertions(+), 20 deletions(-) diff --git a/libraries/ESP8266mDNS/src/LEAmDNS.cpp b/libraries/ESP8266mDNS/src/LEAmDNS.cpp index 1d8e3e5fb..628432411 100644 --- a/libraries/ESP8266mDNS/src/LEAmDNS.cpp +++ b/libraries/ESP8266mDNS/src/LEAmDNS.cpp @@ -114,33 +114,20 @@ bool MDNSResponder::begin(const char* p_pcHostname, const IPAddress& p_IPAddress IPAddress sta = WiFi.localIP(); IPAddress ap = WiFi.softAPIP(); - if (!sta.isSet() && !ap.isSet()) + if (sta.isSet()) { - - DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] internal interfaces (STA, AP) are not set (none was specified)\n"))); - return false; + DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] STA interface selected\n"))); + ipAddress = sta; } - - if (ap.isSet()) + else if (ap.isSet()) { - - if (sta.isSet()) - { - DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] default interface AP selected over STA (none was specified)\n"))); - } - else - { - DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] default interface AP selected\n"))); - } + DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] AP interface selected\n"))); ipAddress = ap; - } else { - - DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] default interface STA selected (none was specified)\n"))); - ipAddress = sta; - + DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] standard interfaces are not up, please specify one in ::begin()\n"))); + return false; } // continue to ensure interface is UP From f45da1cf259d4eafad3308b508fa6f5ce3cdc9f3 Mon Sep 17 00:00:00 2001 From: M Hightower <27247790+mhightower83@users.noreply.github.com> Date: Fri, 7 Feb 2020 09:59:17 -0800 Subject: [PATCH 2/2] Updated stack offsets for postmortem stack dump. Changed ets_putc to ets_uart_putc1 to better newline handling. --- cores/esp8266/core_esp8266_postmortem.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cores/esp8266/core_esp8266_postmortem.cpp b/cores/esp8266/core_esp8266_postmortem.cpp index 0486ee573..84aad50a0 100644 --- a/cores/esp8266/core_esp8266_postmortem.cpp +++ b/cores/esp8266/core_esp8266_postmortem.cpp @@ -89,7 +89,7 @@ static void ets_printf_P(const char *str, ...) { vsnprintf(destStr, sizeof(destStr), str, argPtr); va_end(argPtr); while (*c) { - ets_putc(*(c++)); + ets_uart_putc1(*(c++)); } } @@ -147,10 +147,10 @@ void __wrap_system_restart_local() { // (determined empirically, might break) uint32_t offset = 0; if (rst_info.reason == REASON_SOFT_WDT_RST) { - offset = 0x1b0; + offset = 0x1a0; } else if (rst_info.reason == REASON_EXCEPTION_RST) { - offset = 0x1a0; + offset = 0x190; } else if (rst_info.reason == REASON_WDT_RST) { offset = 0x10;