1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-04-19 23:22:16 +03:00

in example properly wait for NTP to be set (#4000)

fix #3905
This commit is contained in:
david gauchard 2017-12-21 20:27:58 +01:00 committed by Develo
parent d0a4900e2d
commit d5bb4a99f6

View File

@ -53,7 +53,7 @@ void setup() {
Serial.print("Setting time using SNTP"); Serial.print("Setting time using SNTP");
configTime(8 * 3600, 0, "pool.ntp.org", "time.nist.gov"); configTime(8 * 3600, 0, "pool.ntp.org", "time.nist.gov");
time_t now = time(nullptr); time_t now = time(nullptr);
while (now < 1000) { while (now < 8 * 3600 * 2) {
delay(500); delay(500);
Serial.print("."); Serial.print(".");
now = time(nullptr); now = time(nullptr);