Fixed mqtt issues

This commit is contained in:
Magnus Persson
2022-01-12 17:39:54 +01:00
parent a83a74b5a4
commit aad35e20bd
4 changed files with 15 additions and 5 deletions

View File

@ -83,6 +83,16 @@ WifiConnection::WifiConnection() {
bool WifiConnection::hasConfig() {
if (strlen(myConfig.getWifiSSID())) return true;
if (strlen(userSSID)) return true;
// Check if there are stored WIFI Settings we can use.
String ssid = WiFi.SSID();
if (ssid.length()) {
Log.notice(F("WIFI: Found credentials in EEPORM." CR));
myConfig.setWifiSSID(WiFi.SSID());
myConfig.setWifiPass(WiFi.psk());
myConfig.saveFile();
return true;
}
return false;
}