Skip to content

Commit

Permalink
fix: wifi reset issue when STA cannot be found
Browse files Browse the repository at this point in the history
  • Loading branch information
ZanzyTHEbar committed Dec 21, 2023
1 parent c06963a commit a2c679e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
6 changes: 2 additions & 4 deletions NetworkManager/src/network/wifihandler/wifi_handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,6 @@ bool WiFiHandler::iniSTA(const std::string& ssid, const std::string& password,
this->configManager.setState(this->getName(),
WiFiState_e::WiFiState_Error);
log_e("Connection to: %s TIMEOUT \n\r", ssid.c_str());
this->configManager.setState(this->getName(),
WiFiState_e::WiFiState_Connecting);
delay(8000);
return false;
}
Expand Down Expand Up @@ -198,14 +196,14 @@ void WiFiHandler::update(const StateVariant& event) {
}
void WiFiHandler::onWiFiEvent(WiFiEvent_t event) {
switch (event) {
case SYSTEM_EVENT_WIFI_READY:
/* case SYSTEM_EVENT_WIFI_READY:
this->configManager.setState(this->getName(),
WiFiState_e::WiFiState_Idle);
break;
case SYSTEM_EVENT_SCAN_DONE:
this->configManager.setState(this->getName(),
WiFiState_e::WiFiState_Scanning_Done);
break;
break; */
case SYSTEM_EVENT_STA_DISCONNECTED:
this->configManager.setState(this->getName(),
WiFiState_e::WiFiState_Disconnected);
Expand Down
4 changes: 2 additions & 2 deletions NetworkManager/wokwi.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[wokwi]
version = 1
elf = ".pio/build/esp32dev_debug/EasyNetworkManager-v5.0.0-esp32dev_debug-308391d-main.elf"
firmware = ".pio/build/esp32dev_debug/EasyNetworkManager-v5.0.0-esp32dev_debug-308391d-main.bin"
elf = ".pio/build/esp32dev_debug/EasyNetworkManager-v5.1.1-esp32dev_debug-c06963a-main.elf"
firmware = ".pio/build/esp32dev_debug/EasyNetworkManager-v5.1.1-esp32dev_debug-c06963a-main.bin"
[[net.forward]]
from = "localhost:8180"
to = "target:80"

0 comments on commit a2c679e

Please sign in to comment.