Questions tagged [ntpclient]

7 questions
3
votes
0 answers

How to correctly synchronize time with NTP server?

I want to synchronize time with NTP server once in some time. I am using DOIT ESP32 DEVKIT V1, I tried with getLocalTime() function but it returned true even without wifi, but as I know without wifi it can not conect to NTP server. Can anyone say if…
hungryman
  • 39
  • 4
2
votes
1 answer

How to attempt connection to WiFi only once?

I am working on a garden timer project, I connect to WiFi once and if its successful show time from NTPClient or else show time from RTC. I have been done the above, and it works in the sense that if I turn off the WiFi while the program is running,…
Coder9390
  • 512
  • 1
  • 7
  • 25
1
vote
2 answers

Passing variable into catch() exception

I'm working with a try{} catch(){} exception right now and I want to change a Variable. For this my board has to connect to the Internet and with a try{} statement it will try to do so. If it fails I simply want to set the variables to 0. try { …
LMJ
  • 29
  • 5
1
vote
0 answers

Exception 29 when trying to display NTP time on an LED

I'm currently working with a "WEMOS D1 R2 & mini" and am trying to call the time from an NTP server and display it onto an OLED display. I've been stuck on an error code that I can't seem to work around and was hoping for some pointers in the right…
David C
  • 11
  • 1
0
votes
1 answer

(Why is) getLocalTime() on ESP32 taking several seconds to complete successfully

This is a cross-post from https://github.com/espressif/arduino-esp32/discussions/8653 as it didn't yield any results there. I noticed that getLocalTime() is consistently taking 5-10+ seconds to complete. So far I haven't been able to find the root…
Marcel Stör
  • 125
  • 1
  • 9
0
votes
1 answer

ESP32, NTP and SW reset

After HW reset (button or power reconnect) I get the correct NTP shift, but when I use ESP.restart() via MQTT I get the correct time without 3 3 HRS shift due to Tz. What happens after SW reset that behaves in such manner and how to fix it? bool…
guyd
  • 1,049
  • 2
  • 26
  • 61
0
votes
1 answer

Error using `NtpClientLib.h`

Since Core of ESP8266 upgraded to v.3.0 (now it is 3.0.2), I encounter errors using this library. First, the deprecation of byte to uint8 (hoped that an upgrade of NTP lib to 3.0.2 beta will solve it ), but now even using library's built in example…
guyd
  • 1,049
  • 2
  • 26
  • 61