Fix resolving MQTT and NTP servers

- Fix resolving MQTT and NTP servers (#15816)
- Bump version to v12.0.1
This commit is contained in:
Theo Arends 2022-06-17 16:37:32 +02:00
parent 7bc7be56ee
commit b44a87a3d8
4 changed files with 12 additions and 30 deletions

View File

@ -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

View File

@ -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

View File

@ -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_

View File

@ -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;