From e9b307343de86fd11a8b6d66041a5cf8fd64d6b4 Mon Sep 17 00:00:00 2001 From: Moirtz Wagner Date: Thu, 22 Jan 2026 18:54:40 +0100 Subject: [PATCH] improve response time on poor wifi connection; Fix NTP time sync. --- FingerprintDoorbell/src/main.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/FingerprintDoorbell/src/main.cpp b/FingerprintDoorbell/src/main.cpp index 9c792de..2cecb2b 100644 --- a/FingerprintDoorbell/src/main.cpp +++ b/FingerprintDoorbell/src/main.cpp @@ -121,7 +121,7 @@ String getLogMessagesAsHtml() { String getTimestampString(){ struct tm timeinfo; - if(!getLocalTime(&timeinfo)){ + if(!getLocalTime(&timeinfo, 1000)){ Serial.println("Failed to obtain time"); return "no time"; } @@ -270,7 +270,7 @@ bool initWifi() { Serial.println("Connected!"); setenv("TZ", TZ_INFO, 1); // Zeitzone muss nach dem reset neu eingestellt werden tzset(); - configTzTime(TZ_INFO, settingsManager.getAppSettings().ntpServer.c_str(), "pool.ntp.org"); // ESP32 Systemzeit mit NTP Synchronisieren + configTzTime(TZ_INFO, settingsManager.getAppSettings().ntpServer.c_str(),"nas.local","fritz.box"); // ESP32 Systemzeit mit NTP Synchronisieren // Print ESP32 Local IP Address Serial.println(WiFi.localIP()); @@ -719,7 +719,6 @@ void doScan() } break; case ScanResult::matchFound: - notifyClients( String("Match Found: ") + match.matchId + " - " + match.matchName + " with confidence of " + match.matchConfidence ); if (match.scanResult != lastMatch.scanResult) { if (checkPairingValid()) { openDoor(match); @@ -727,14 +726,15 @@ void doScan() notifyClients("Security issue! Match was not sent by MQTT because of invalid sensor pairing! This could potentially be an attack! If the sensor is new or has been replaced by you do a (re)pairing in settings page."); } } + notifyClients( String("Match Found: ") + match.matchId + " - " + match.matchName + " with confidence of " + match.matchConfidence ); break; case ScanResult::noMatchFound: - notifyClients(String("No Match Found (Code ") + match.returnCode + ")"); if (match.scanResult != lastMatch.scanResult) { ringBell(); } else { setCooldown(5000); // wait some time before next scan to let the LED blink } + notifyClients(String("No Match Found (Code ") + match.returnCode + ")"); break; case ScanResult::error: notifyClients(String("ScanResult Error (Code ") + match.returnCode + ")");