mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2026-05-02 12:07:02 +00:00
remove double wifi lost message
This commit is contained in:
@@ -86,7 +86,6 @@ void Network::begin() {
|
|||||||
[this](WiFiEvent_t /*event*/, WiFiEventInfo_t info) {
|
[this](WiFiEvent_t /*event*/, WiFiEventInfo_t info) {
|
||||||
last_disconnect_reason_ = info.wifi_sta_disconnected.reason;
|
last_disconnect_reason_ = info.wifi_sta_disconnected.reason;
|
||||||
wifi_connect_pending_ = false;
|
wifi_connect_pending_ = false;
|
||||||
LOG_WARNING("WiFi lost connection. Reason: %s", disconnectReason(last_disconnect_reason_));
|
|
||||||
},
|
},
|
||||||
ARDUINO_EVENT_WIFI_STA_DISCONNECTED);
|
ARDUINO_EVENT_WIFI_STA_DISCONNECTED);
|
||||||
|
|
||||||
@@ -169,7 +168,6 @@ void Network::reconnect() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// disconnect AP
|
// disconnect AP
|
||||||
|
|
||||||
if (WiFi.getMode() & WIFI_AP) {
|
if (WiFi.getMode() & WIFI_AP) {
|
||||||
stopAP();
|
stopAP();
|
||||||
}
|
}
|
||||||
@@ -181,6 +179,7 @@ void Network::reconnect() {
|
|||||||
has_ipv6_ = false;
|
has_ipv6_ = false;
|
||||||
juststopped_ = true;
|
juststopped_ = true;
|
||||||
wifi_connect_pending_ = false;
|
wifi_connect_pending_ = false;
|
||||||
|
last_disconnect_reason_ = 0;
|
||||||
|
|
||||||
// reload the network settings, as this could be called from the console
|
// reload the network settings, as this could be called from the console
|
||||||
begin();
|
begin();
|
||||||
@@ -201,8 +200,10 @@ void Network::loop() {
|
|||||||
startWIFI(); // WiFi
|
startWIFI(); // WiFi
|
||||||
startEthernet(); // Ethernet
|
startEthernet(); // Ethernet
|
||||||
|
|
||||||
if (network_ip_ != 0) {
|
// already have a connection: verify it's still alive
|
||||||
checkConnection(); // already have a connection: verify it's still alive
|
// or trigger if the WiFi handshaked failed on the WiFi.begin() call
|
||||||
|
if (network_ip_ != 0 || last_disconnect_reason_ != 0) {
|
||||||
|
checkConnection();
|
||||||
}
|
}
|
||||||
findNetworks(); // detect new connections
|
findNetworks(); // detect new connections
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -928,7 +928,7 @@ void System::send_info_mqtt() {
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
} else if (WiFi.status() == WL_CONNECTED) {
|
} else if (EMSESP::network_.wifi_connected()) {
|
||||||
doc["network"] = "wifi";
|
doc["network"] = "wifi";
|
||||||
doc["hostname"] = WiFi.getHostname();
|
doc["hostname"] = WiFi.getHostname();
|
||||||
doc["SSID"] = WiFi.SSID();
|
doc["SSID"] = WiFi.SSID();
|
||||||
@@ -1647,7 +1647,7 @@ bool System::check_upgrade() {
|
|||||||
|
|
||||||
// changes going to v3.9 from an earlier version
|
// changes going to v3.9 from an earlier version
|
||||||
if (settings_version.major() == 3 && settings_version.minor() < 9) {
|
if (settings_version.major() == 3 && settings_version.minor() < 9) {
|
||||||
#ifndef EMSESP_STANDALONE
|
#ifndef EMSESP_STANDALONE
|
||||||
EMSESP::esp32React.getAPSettingsService()->update([&](APSettings & apSettings) {
|
EMSESP::esp32React.getAPSettingsService()->update([&](APSettings & apSettings) {
|
||||||
if (apSettings.provisionMode == 0) {
|
if (apSettings.provisionMode == 0) {
|
||||||
apSettings.provisionMode = AP_MODE_DISCONNECTED; // AP_MODE_ALWAYS has been removed
|
apSettings.provisionMode = AP_MODE_DISCONNECTED; // AP_MODE_ALWAYS has been removed
|
||||||
@@ -1656,7 +1656,7 @@ bool System::check_upgrade() {
|
|||||||
}
|
}
|
||||||
return StateUpdateResult::UNCHANGED;
|
return StateUpdateResult::UNCHANGED;
|
||||||
});
|
});
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
// changes to application settings
|
// changes to application settings
|
||||||
|
|||||||
Reference in New Issue
Block a user