mirror of
https://github.com/jomjol/AI-on-the-edge-device.git
synced 2025-12-08 20:46:52 +03:00
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:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user