Location Speichern geht? abrufen der gespeicherten location aus properties muss noch gemacht werden

This commit is contained in:
Carsten Graf
2025-06-11 22:52:30 +02:00
parent 22cc4fe99c
commit b6fa2d69e7
8 changed files with 319 additions and 14 deletions

View File

@@ -184,24 +184,35 @@ void saveWifiSettings() {
preferences.putString("ssid", ssidSTA);
preferences.putString("password", passwordSTA);
preferences.end();
Serial.printf("WLAN-Einstellungen gespeichert: SSID=%s, Passwort=%s\n", ssidSTA, passwordSTA);
delay(500); // Warte 2 Sekunden, bevor der Neustart erfolgt
ESP.restart(); // Neustart des ESP32
}
void loadLocationSettings() {
preferences.begin("location", true);
masterlocation = preferences.getString("location", "");
preferences.end();
}
void saveLocationSettings() {
preferences.begin("location", false);
preferences.putString("location", masterlocation);
preferences.end();
}
void loadWifiSettings() {
preferences.begin("wifi", true);
// Neue Werte laden und dynamisch zuweisen
String ssid = preferences.getString("ssid", "");
String password = preferences.getString("password", "");
ssidSTA = strdup(ssid.c_str());
passwordSTA = strdup(password.c_str());
preferences.end();
// Debug-Ausgabe
Serial.printf("WLAN-Einstellungen geladen: SSID=%s, Passwort=%s\n", ssidSTA, passwordSTA);
}
int checkLicence() {
loadLicenceFromPrefs();
String id = getUniqueDeviceID();