1

Hardware- ESP8266 Based NodeMCU

I am using NTP Client for time in my alarm project.

I am facing an issue where NTP client is not returning proper values, in the sense that it works properly for the first few hours- returning the time every second, however after some time the values go haywire.

First few hours:-

21:00:45
21:00:46
21:00:47
21:00:48

After sometime:-

06:00:02
06:00:45
06:00:49

What could be the cause of this and how do prevent it?

3
  • 3
    don't use NTP library on esp. esp has 'built-in' ntp functions. see the esp8266/NTP-TZ-DST.ino in IDE examples menu Commented May 8, 2021 at 6:14
  • returning the time every second ... maybe the NTP server starts to ignore your request Commented May 8, 2021 at 16:31
  • @jsotala I'm only using timeClient.getFormattedTime and timeClient.update() , in my loop, I have found out that timeClient.update() does not return anything until the update interval is over, which in my case is about 10 mins Commented May 10, 2021 at 1:34

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.