0

Updated Espressif 8266 to 4.0.1 (platform.io), getting time from NTP stopped working on all esp8266/32s. Silently assumes 1970s. Seemingly ignores configTime(MYTZ, "pool.ntp.org", "google.time.com", "time.cloudflare.com"); in time.h code variant.

Tried time.h (https://github.com/esp8266/Arduino/blob/master/libraries/esp8266/examples/NTP-TZ-DST/NTP-TZ-DST.ino) And NTPClient.h (arduino-libraries/NTPClient@^3.2.1)

Google is spammed by copy pasted examples around those two.

Is there a working for the setup example?

Les
  • 242
  • 1
  • 4
  • 13
  • did you wait until it retrieves the time from the NTP server? – Juraj Jul 18 '22 at 09:34
  • Yes, synchronously, asynchronously - time wasn't changed, something like this ``` do { time(&now); localtime_r(&now, &timeinfo); Serial.print("."); delay(200); } while (((millis() - start) <= (1000U * sec)) && (timeinfo.tm_year < (2016 - 1900))); if (timeinfo.tm_year <= (2016 - 1900)) return false;{} ``` Please, take a note, that code was the same, just stopped working after update platform and libs to the latest versions. Also - see the examples, all of them have the waiting. – Les Jul 18 '22 at 10:17

0 Answers0