Skip to content

Commit d0c6ef6

Browse files
committed
fix wifi reconnect
1 parent c419a75 commit d0c6ef6

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ All notable changes to this project will be documented in this file.
1515
- Changed the width of the confirm dialog.
1616
- SvelteKit bundling as single files to reduce heap consumption.
1717

18+
### Fixes
19+
20+
- [#109](https://github.com/theelims/ESP32-sveltekit/issues/109)
21+
1822
## [0.6.0] - 2025-11-03
1923

2024
> [!CAUTION]

lib/framework/EthernetSettingsService.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ void EthernetSettingsService::configureNetwork(ethernet_settings_t &network)
8686
#if CONFIG_IDF_TARGET_ESP32
8787
// ESP32 chips with built-in ethernet MAC/PHY
8888
ETH.begin();
89-
#else
89+
#elif FT_ENABLED(FT_ETHERNET)
9090
// For SPI based ethernet modules like W5500, ENC28J60 etc.
9191
SPI.begin(ETH_SPI_SCK, ETH_SPI_MISO, ETH_SPI_MOSI);
9292
ETH.begin(ETH_PHY_TYPE, ETH_PHY_ADDR, ETH_PHY_CS, ETH_PHY_IRQ, ETH_PHY_RST, SPI);

lib/framework/WiFiSettingsService.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,7 @@ void WiFiSettingsService::manageSTA()
149149
{
150150
return;
151151
}
152-
153-
// Connect or reconnect as required
154-
if ((WiFi.getMode() & WIFI_STA) == 0)
152+
else
155153
{
156154
#ifdef SERIAL_INFO
157155
Serial.println("Connecting to WiFi...");
@@ -297,7 +295,7 @@ void WiFiSettingsService::updateRSSI()
297295

298296
void WiFiSettingsService::onStationModeDisconnected(WiFiEvent_t event, WiFiEventInfo_t info)
299297
{
300-
WiFi.disconnect(true);
298+
manageSTA();
301299
}
302300

303301
void WiFiSettingsService::onStationModeStop(WiFiEvent_t event, WiFiEventInfo_t info)

0 commit comments

Comments
 (0)