Does anyone happen to know what the .getMinutes() function from the ntpclient library do when there is no internet connection. Does the library keep counting itself from the latest update and return a value or does the code just break ?
perhaps you could tell us a bit more about your hardware? eg what are you using?
I'm using an esp 8266
naked? or eg a NodeMCU?
node mcu
@noiasca could answer that.
I don't know what the unspecified "ntpclient library" is really doing.
If @lmjiscool would just use the core functionalities like from your link or my page, I could tell that the internal RTC will "continue counting" and return an updated tm_min even if one NTP requests would fail or when wifi is currently unavailable.
If Wi-Fi is lost and then comes back on the 'getMinutes()' returns with the current real time as shown below. (.getFormattedTime() in my case)
Note that the initial TIME and DATE that it returns with may not be correct as shown at the top of the following screen grab:
- DATE: 2106-02-06
- TIME: 23:28:4
But, in most cases this is corrected in the next time reported.
Also note that Wi-Fi is
lost at TIME: 09:38:5. and
returns at TIME: 09:44:3 with the correct DATE as well.
Hope this helps.
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.