-->
Page 1 of 1

NTPClient

PostPosted: Mon Dec 27, 2021 2:05 pm
by ken english
I have been using NTP client for about a year on esp8266,, recently updated my board manager to 3.0.0 and found the calculator for the date was not working, did some major troubleshooting , re typing my code, installing new libraries and finally got wind that the board manager is at fault,,,, Loaded version 2.7.4 as per Sara at Random Nerd Tutorials, this is what worked,,, Not Sure who is publishing the board managers, but I thought this might be the best shot and getting the NTPClient library to work on the new board managers,,,, Anybody else find these problems

Re: NTPClient

PostPosted: Thu Dec 30, 2021 1:04 am
by JurajA
why do you use the NTPClient library?
Code: Select all  configTime(TIME_ZONE, "pool.ntp.org");
  time_t now = time(nullptr);
  while (now < SECS_YR_2000) {
    delay(100);
    now = time(nullptr);
  }
  setTime(now);


with

Code: Select all#include <ESP8266WiFi.h>
#include <TimeLib.h>
#include <sntp.h>
#include <TZ.h>

#define TIME_ZONE TZ_Europe_London