Fix resolving NTP and/or MQTT server

- Fix resolving NTP and/or MQTT server names regression from v12.0.0 (#15816)
- Bump version to v12.0.1.1
This commit is contained in:
Theo Arends 2022-06-17 17:35:52 +02:00
parent b6409a6a6f
commit e9708a4e5a
4 changed files with 10 additions and 28 deletions

View File

@ -3,7 +3,7 @@ All notable changes to this project will be documented in this file.
## [Unreleased] - Development
## [12.0.0.1]
## [12.0.1.1]
### Added
@ -18,6 +18,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

@ -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.1
## Changelog v12.0.1.1
### Added
### Breaking Changed

View File

@ -20,6 +20,6 @@
#ifndef _TASMOTA_VERSION_H_
#define _TASMOTA_VERSION_H_
const uint32_t VERSION = 0x0C000001; // 12.0.0.1
const uint32_t VERSION = 0x0C000101; // 12.0.1.1
#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;