From b44a87a3d84aefbc5301471b8c8d51a05d7afee9 Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Fri, 17 Jun 2022 16:37:32 +0200 Subject: [PATCH] Fix resolving MQTT and NTP servers - Fix resolving MQTT and NTP servers (#15816) - Bump version to v12.0.1 --- CHANGELOG.md | 6 ++++++ RELEASENOTES.md | 8 ++++---- tasmota/include/tasmota_version.h | 2 +- tasmota/tasmota_support/support_wifi.ino | 26 +----------------------- 4 files changed, 12 insertions(+), 30 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 84e39168f..02888fd49 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,12 @@ All notable changes to this project will be documented in this file. ## [Released] +## [12.0.1] 20220617 +- Release Paul + +### Fixed +- Resolving NTP and/or MQTT server names regression from v12.0.0 (#15816) + ## [12.0.0] 20220615 - Release Paul diff --git a/RELEASENOTES.md b/RELEASENOTES.md index aa09ba62f..840c8ecb7 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -72,7 +72,7 @@ Latest released binaries can be downloaded from - http://ota.tasmota.com/tasmota/release Historical binaries can be downloaded from -- http://ota.tasmota.com/tasmota/release-12.0.0 +- http://ota.tasmota.com/tasmota/release-12.0.1 The latter links can be used for OTA upgrades too like ``OtaUrl http://ota.tasmota.com/tasmota/release/tasmota.bin.gz`` @@ -97,7 +97,7 @@ Latest released binaries can be downloaded from - http://ota.tasmota.com/tasmota32/release Historical binaries can be downloaded from -- http://ota.tasmota.com/tasmota32/release-12.0.0 +- http://ota.tasmota.com/tasmota32/release-12.0.1 The latter links can be used for OTA upgrades too like ``OtaUrl http://ota.tasmota.com/tasmota32/release/tasmota32.bin`` @@ -107,7 +107,7 @@ The latter links can be used for OTA upgrades too like ``OtaUrl http://ota.tasmo [Complete list](BUILDS.md) of available feature and sensors. -## Changelog v12.0.0 Paul +## Changelog v12.0.1 Paul ### Added - Command ``SetOption139 0/1`` to switch between pressure unit "mmHg" (0) or "inHg" (1) when ``SO24 1`` [#15350](https://github.com/arendst/Tasmota/issues/15350) - Command ``SetOption140 0/1`` to switch between MQTT Clean Session (0) or Persistent Session (1) [#15530](https://github.com/arendst/Tasmota/issues/15530) @@ -142,8 +142,8 @@ The latter links can be used for OTA upgrades too like ``OtaUrl http://ota.tasmo - SCD40 start low power command [#15361](https://github.com/arendst/Tasmota/issues/15361) - BL09xx negative power presentation [#15374](https://github.com/arendst/Tasmota/issues/15374) - Possible pin output toggle after power on [#15630](https://github.com/arendst/Tasmota/issues/15630) -- Reduce blocking by adding WifiPollDns before resolving NTP and/or MQTT server names [#14394](https://github.com/arendst/Tasmota/issues/14394) - SHT1X driver hangs and wrong values on ESP32 [#15790](https://github.com/arendst/Tasmota/issues/15790) +- Resolving NTP and/or MQTT server names regression from v12.0.0 [#15816](https://github.com/arendst/Tasmota/issues/15816) - ESP32 Arduino Core WiFi timeout is changed from msec to seconds ### Removed diff --git a/tasmota/include/tasmota_version.h b/tasmota/include/tasmota_version.h index 6800a56d2..58b8835d4 100644 --- a/tasmota/include/tasmota_version.h +++ b/tasmota/include/tasmota_version.h @@ -20,6 +20,6 @@ #ifndef _TASMOTA_VERSION_H_ #define _TASMOTA_VERSION_H_ -const uint32_t VERSION = 0x0C000000; // 12.0.0.0 +const uint32_t VERSION = 0x0C000100; // 12.0.1.0 #endif // _TASMOTA_VERSION_H_ diff --git a/tasmota/tasmota_support/support_wifi.ino b/tasmota/tasmota_support/support_wifi.ino index c71826c38..075072c64 100644 --- a/tasmota/tasmota_support/support_wifi.ino +++ b/tasmota/tasmota_support/support_wifi.ino @@ -729,30 +729,6 @@ void wifiKeepAlive(void) { } #endif // ESP8266 -bool WifiPollDns(void) { - // WiFi.hostByName takes over ten seconds if no DNS server found - // This function checks to find the DNS server within 1 second - // This is an alternative for ping using less resources and some DNS server do not respond to pings (ICMP) - // See https://github.com/letscontrolit/ESPEasy/issues/1494#issuecomment-397872538 - WiFiClient DnsClient; - -#ifdef ESP8266 - DnsClient.setTimeout(1000); -#else - DnsClient.setTimeout(1); -#endif - uint32_t i = 3; // Check DNS1 only (to keep blocking to a minimum of 1 second) -// for (i = 3; i < 5; i++) { // Check DNS1 and DNS2 - uint32_t dns_address = (!TasmotaGlobal.global_state.eth_down) ? Settings->eth_ipv4_address[i] : Settings->ipv4_address[i]; - if (DnsClient.connect((IPAddress)dns_address, 53)) { - DnsClient.stop(); - return true; - } -// } - AddLog(LOG_LEVEL_DEBUG, PSTR("DNS: Disconnected")); - return false; -} - int WifiHostByName(const char* aHostname, IPAddress& aResult) { // Use this instead of WiFi.hostByName or connect(host_name,.. to block less if DNS server is not found aResult = (uint32_t)(0); @@ -760,7 +736,7 @@ int WifiHostByName(const char* aHostname, IPAddress& aResult) { // Host name is already an IP address so use it! return 1; } - else if (WifiPollDns() && WiFi.hostByName(aHostname, aResult)) { + else if (WiFi.hostByName(aHostname, aResult)) { // Host name resolved if (0xFFFFFFFF != (uint32_t)aResult) { return 1;