diff --git a/code/components/jomjol_flowcontroll/ClassFlowPostProcessing.cpp b/code/components/jomjol_flowcontroll/ClassFlowPostProcessing.cpp index 7d75d061d..a1712b5d5 100644 --- a/code/components/jomjol_flowcontroll/ClassFlowPostProcessing.cpp +++ b/code/components/jomjol_flowcontroll/ClassFlowPostProcessing.cpp @@ -874,6 +874,7 @@ bool ClassFlowPostProcessing::doFlow(string zwtime) UpdatePreValueINI = true; string _zw = NUMBERS[j]->name + ": Raw: " + NUMBERS[j]->ReturnRawValue + ", Value: " + NUMBERS[j]->ReturnValue + ", Status: " + NUMBERS[j]->ErrorMessageText; + ESP_LOGD(TAG, "%s", zw.c_str()); LogFile.WriteToFile(ESP_LOG_INFO, TAG, _zw); WriteDataLog(j); } diff --git a/code/components/jomjol_time_sntp/time_sntp.cpp b/code/components/jomjol_time_sntp/time_sntp.cpp index 6240e6877..cc687d6c7 100644 --- a/code/components/jomjol_time_sntp/time_sntp.cpp +++ b/code/components/jomjol_time_sntp/time_sntp.cpp @@ -63,8 +63,8 @@ bool setup_time() // Is time set? If not, tm_year will be (1970 - 1900). if (!getTimeIsSet()) { - ESP_LOGI(TAG, "Time is not set yet. Getting time over NTP."); initialize_sntp(); + LogFile.WriteToFile(ESP_LOG_INFO, TAG, "Time is not set yet. Getting time over NTP server " + std::string(sntp_getservername(0))); if (!obtain_time()) { success = false; } @@ -103,9 +103,9 @@ static bool obtain_time(void) bool success = true; time(&now); - localtime_r(&now, &timeinfo); + localtime_r(&now, &timeinfo); - ESP_LOGI(TAG, "Waiting until we get a time from the NTP server..."); + LogFile.WriteToFile(ESP_LOG_INFO, TAG, "Waiting until we get a time from the NTP server " + std::string(sntp_getservername(0))); while (true) { retry++; @@ -118,7 +118,7 @@ static bool obtain_time(void) sntp_sync_status_t status = sntp_get_sync_status(); logNtpStatus(status); if (status == SNTP_SYNC_STATUS_COMPLETED) { - ESP_LOGI(TAG, "Time is synced with NTP Server"); + LogFile.WriteToFile(ESP_LOG_INFO, TAG, "Time is synced with NTP Server " + std::string(sntp_getservername(0))); break; } @@ -146,10 +146,10 @@ void logNtpStatus(sntp_sync_status_t status) { void reset_servername(std::string _servername) { - ESP_LOGD(TAG, "Set SNTP-Server: %s", _servername.c_str()); sntp_stop(); sntp_setoperatingmode(SNTP_OPMODE_POLL); sntp_setservername(0, _servername.c_str()); + LogFile.WriteToFile(ESP_LOG_INFO, TAG, "Set SNTP-Server to " + std::string(sntp_getservername(0))); sntp_init(); obtain_time(); std::string zw = gettimestring("%Y%m%d-%H%M%S"); diff --git a/sd-card/config/config.ini b/sd-card/config/config.ini index 68b9fbc0f..8670fd0cd 100644 --- a/sd-card/config/config.ini +++ b/sd-card/config/config.ini @@ -94,7 +94,7 @@ LogfileRetentionInDays = 3 [System] TimeZone = CET-1CEST,M3.5.0,M10.5.0/3 -;TimeServer = undefined +;TimeServer = pool.ntp.org ;AutoAdjustSummertime = false ;Hostname = undefined SetupMode = true