From 4ecf3288513c2da65fd589e369ff0a8c0840f084 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20St=C3=BCrmer?= Date: Tue, 10 Dec 2024 13:43:15 +0100 Subject: [PATCH] add verbose log to indicate, that the restart is on purpose --- src/LogMessages_DE.cpp | 1 + src/LogMessages_EN.cpp | 1 + src/LogMessages_FR.cpp | 1 + src/System.cpp | 1 + src/logmessages.h | 1 + 5 files changed, 5 insertions(+) diff --git a/src/LogMessages_DE.cpp b/src/LogMessages_DE.cpp index 31d75c9a..fca94e75 100644 --- a/src/LogMessages_DE.cpp +++ b/src/LogMessages_DE.cpp @@ -253,4 +253,5 @@ const char cantConnectToWifi[] = "WLAN-Verbindung fehlgeschlagen."; const char wifiSetLastSSID[] = "Schreibe letzte erfolgreiche SSID in NVS für WLAN Schnellstart: %s"; const char mDNSStarted[] = "mDNS gestartet: http://%s.local"; const char mDNSFailed[] = "mDNS Start fehlgeschlagen, Hostname: %s"; +const char restartAfterOperationModeChange[] = "Operation Mode geändert. ESPuino wird neu gestartet..."; #endif diff --git a/src/LogMessages_EN.cpp b/src/LogMessages_EN.cpp index 048cafdc..e5f492f8 100644 --- a/src/LogMessages_EN.cpp +++ b/src/LogMessages_EN.cpp @@ -254,4 +254,5 @@ const char cantConnectToWifi[] = "Failed to connect to WiFi."; const char wifiSetLastSSID[] = "Write last successful SSID to NVS for WiFi fast-path: %s"; const char mDNSStarted[] = "mDNS started: http://%s.local"; const char mDNSFailed[] = "mDNS failure, hostname: %s"; +const char restartAfterOperationModeChange[] = "Operation Mode changed. Restart ESPuino now..."; #endif diff --git a/src/LogMessages_FR.cpp b/src/LogMessages_FR.cpp index 5417cd41..7b2fbf02 100644 --- a/src/LogMessages_FR.cpp +++ b/src/LogMessages_FR.cpp @@ -252,4 +252,5 @@ const char cantConnectToWifi[] = "Impossible de se connecter au WiFi."; const char wifiSetLastSSID[] = "Écrire le dernier SSID réussi dans le NVS pour le chemin rapide WiFi : %s"; const char mDNSStarted[] = "mDNS démarré : http://%s.local"; const char mDNSFailed[] = "Échec de mDNS, nom d'hôte : %s"; +const char restartAfterOperationModeChange[] = "Le mode de fonctionnement a changé. Redémarrez ESPuino maintenant..."; #endif diff --git a/src/System.cpp b/src/System.cpp index e1c898e7..b0c6c753 100644 --- a/src/System.cpp +++ b/src/System.cpp @@ -148,6 +148,7 @@ void System_SetOperationMode(uint8_t opMode) { uint8_t currentOperationMode = gPrefsSettings.getUChar("operationMode", OPMODE_NORMAL); if (currentOperationMode != opMode) { if (gPrefsSettings.putUChar("operationMode", opMode)) { + Log_Println(restartAfterOperationModeChange, LOGLEVEL_INFO); ESP.restart(); } } diff --git a/src/logmessages.h b/src/logmessages.h index c7a228bd..9aa1575af 100644 --- a/src/logmessages.h +++ b/src/logmessages.h @@ -253,3 +253,4 @@ extern const char cantConnectToWifi[]; extern const char wifiSetLastSSID[]; extern const char mDNSStarted[]; extern const char mDNSFailed[]; +extern const char restartAfterOperationModeChange[];