diff --git a/cores/esp32/esp32-hal-time.c b/cores/esp32/esp32-hal-time.c index e7048307..2d0276ff 100644 --- a/cores/esp32/esp32-hal-time.c +++ b/cores/esp32/esp32-hal-time.c @@ -44,6 +44,8 @@ static void setTimeZone(long offset, int daylight) /* * configTime * Source: https://github.com/esp8266/Arduino/blob/master/cores/esp8266/time.c + * Note: Bundled Arduino lwip supports only ONE ntp server, 2nd and 3rd options are silently ignored + * see CONFIG_LWIP_DHCP_MAX_NTP_SERVERS define in ./tools/sdk/esp32/sdkconfig * */ void configTime(long gmtOffset_sec, int daylightOffset_sec, const char* server1, const char* server2, const char* server3) { @@ -63,6 +65,8 @@ void configTime(long gmtOffset_sec, int daylightOffset_sec, const char* server1, /* * configTzTime * sntp setup using TZ environment variable + * Note: Bundled Arduino lwip supports only ONE ntp server, 2nd and 3rd options are silently ignored + * see CONFIG_LWIP_DHCP_MAX_NTP_SERVERS define in ./tools/sdk/esp32/sdkconfig * */ void configTzTime(const char* tz, const char* server1, const char* server2, const char* server3) { diff --git a/libraries/FFat/examples/FFat_time/FFat_time.ino b/libraries/FFat/examples/FFat_time/FFat_time.ino index 475cfea0..090a3bbc 100644 --- a/libraries/FFat/examples/FFat_time/FFat_time.ino +++ b/libraries/FFat/examples/FFat_time/FFat_time.ino @@ -148,6 +148,10 @@ void setup(){ Serial.println("IP address: "); Serial.println(WiFi.localIP()); Serial.println("Contacting Time Server"); + /* + Note: Bundled Arduino lwip supports only ONE ntp server, 2nd and 3rd options are silently ignored + see CONFIG_LWIP_DHCP_MAX_NTP_SERVERS define in ./tools/sdk/esp32/sdkconfig + */ configTime(3600*timezone, daysavetime*3600, "time.nist.gov", "0.pool.ntp.org", "1.pool.ntp.org"); struct tm tmstruct ; delay(2000); diff --git a/libraries/HTTPUpdate/examples/httpUpdateSecure/httpUpdateSecure.ino b/libraries/HTTPUpdate/examples/httpUpdateSecure/httpUpdateSecure.ino index 1c85ace0..cff8f45c 100644 --- a/libraries/HTTPUpdate/examples/httpUpdateSecure/httpUpdateSecure.ino +++ b/libraries/HTTPUpdate/examples/httpUpdateSecure/httpUpdateSecure.ino @@ -17,6 +17,10 @@ WiFiMulti WiFiMulti; // Set time via NTP, as required for x.509 validation void setClock() { + /* + Note: Bundled Arduino lwip supports only ONE ntp server, 2nd and 3rd options are silently ignored + see CONFIG_LWIP_DHCP_MAX_NTP_SERVERS define in ./tools/sdk/esp32/sdkconfig + */ configTime(0, 0, "pool.ntp.org", "time.nist.gov"); // UTC Serial.print(F("Waiting for NTP time sync: ")); diff --git a/libraries/LittleFS/examples/LITTLEFS_time/LITTLEFS_time.ino b/libraries/LittleFS/examples/LITTLEFS_time/LITTLEFS_time.ino index 038261b1..bb5b9c3a 100644 --- a/libraries/LittleFS/examples/LITTLEFS_time/LITTLEFS_time.ino +++ b/libraries/LittleFS/examples/LITTLEFS_time/LITTLEFS_time.ino @@ -160,6 +160,10 @@ void setup(){ Serial.println("IP address: "); Serial.println(WiFi.localIP()); Serial.println("Contacting Time Server"); + /* + Note: Bundled Arduino lwip supports only ONE ntp server, 2nd and 3rd options are silently ignored + see CONFIG_LWIP_DHCP_MAX_NTP_SERVERS define in ./tools/sdk/esp32/sdkconfig + */ configTime(3600*timezone, daysavetime*3600, "time.nist.gov", "0.pool.ntp.org", "1.pool.ntp.org"); struct tm tmstruct ; delay(2000); diff --git a/libraries/SD/examples/SD_time/SD_time.ino b/libraries/SD/examples/SD_time/SD_time.ino index cef80dd6..ff35d673 100644 --- a/libraries/SD/examples/SD_time/SD_time.ino +++ b/libraries/SD/examples/SD_time/SD_time.ino @@ -164,6 +164,10 @@ void setup(){ Serial.println("IP address: "); Serial.println(WiFi.localIP()); Serial.println("Contacting Time Server"); + /* + Note: Bundled Arduino lwip supports only ONE ntp server, 2nd and 3rd options are silently ignored + see CONFIG_LWIP_DHCP_MAX_NTP_SERVERS define in ./tools/sdk/esp32/sdkconfig + */ configTime(3600*timezone, daysavetime*3600, "time.nist.gov", "0.pool.ntp.org", "1.pool.ntp.org"); struct tm tmstruct ; delay(2000); diff --git a/libraries/SD_MMC/examples/SDMMC_time/SDMMC_time.ino b/libraries/SD_MMC/examples/SDMMC_time/SDMMC_time.ino index 4472f8c6..c15a1648 100644 --- a/libraries/SD_MMC/examples/SDMMC_time/SDMMC_time.ino +++ b/libraries/SD_MMC/examples/SDMMC_time/SDMMC_time.ino @@ -164,6 +164,10 @@ void setup(){ Serial.println("IP address: "); Serial.println(WiFi.localIP()); Serial.println("Contacting Time Server"); + /* + Note: Bundled Arduino lwip supports only ONE ntp server, 2nd and 3rd options are silently ignored + see CONFIG_LWIP_DHCP_MAX_NTP_SERVERS define in ./tools/sdk/esp32/sdkconfig + */ configTime(3600*timezone, daysavetime*3600, "time.nist.gov", "0.pool.ntp.org", "1.pool.ntp.org"); struct tm tmstruct ; delay(2000); diff --git a/libraries/SPIFFS/examples/SPIFFS_time/SPIFFS_time.ino b/libraries/SPIFFS/examples/SPIFFS_time/SPIFFS_time.ino index a8675969..60cd6484 100644 --- a/libraries/SPIFFS/examples/SPIFFS_time/SPIFFS_time.ino +++ b/libraries/SPIFFS/examples/SPIFFS_time/SPIFFS_time.ino @@ -148,6 +148,10 @@ void setup(){ Serial.println("IP address: "); Serial.println(WiFi.localIP()); Serial.println("Contacting Time Server"); + /* + Note: Bundled Arduino lwip supports only ONE ntp server, 2nd and 3rd options are silently ignored + see CONFIG_LWIP_DHCP_MAX_NTP_SERVERS define in ./tools/sdk/esp32/sdkconfig + */ configTime(3600*timezone, daysavetime*3600, "time.nist.gov", "0.pool.ntp.org", "1.pool.ntp.org"); struct tm tmstruct ; delay(2000);