Improve NTP (#1364)

* checking NTP status on every round and restart NTP client if we still are in 1970

* .

* .

* .

Co-authored-by: CaCO3 <caco@ruinelli.ch>
This commit is contained in:
CaCO3
2022-11-17 19:01:24 +01:00
committed by GitHub
parent bf8ab423e3
commit ecc43edbba
3 changed files with 81 additions and 19 deletions

View File

@@ -286,6 +286,12 @@ bool ClassFlowControll::doFlow(string time)
LogFile.WriteHeapInfo("ClassFlowControll::doFlow - Start");
#endif
/* Check if we have a valid date/time and if not restart the NTP client */
if (! getTimeIsSet()) {
LogFile.WriteToFile(ESP_LOG_WARN, TAG, "Time not set, restarting NTP Client!");
restartNtpClient();
}
for (int i = 0; i < FlowControll.size(); ++i)
{
zw_time = gettimestring("%H:%M:%S");