Comments on: [SOLVED] Reconnect ESP32 to Wi-Fi Network After Lost Connection https://randomnerdtutorials.com/solved-reconnect-esp32-to-wifi/ Learn ESP8266, ESP32, Arduino, and Raspberry Pi Thu, 06 Nov 2025 06:30:25 +0000 hourly 1 https://wordpress.org/?v=6.8.5 By: Ramesh https://randomnerdtutorials.com/solved-reconnect-esp32-to-wifi/#comment-1119387 Thu, 06 Nov 2025 06:30:25 +0000 https://randomnerdtutorials.com/?p=101925#comment-1119387 In reply to Birol.

Hello everyone,

I’m facing a WiFi reconnection issue with my ESP32-WROOM board.
When my ESP32 goes out of range of the WiFi router, it correctly detects the disconnection. However, when I bring it back into the WiFi range, it does not reconnect automatically, even though my reconnection logic is running in the loop.

]]>
By: Birol https://randomnerdtutorials.com/solved-reconnect-esp32-to-wifi/#comment-948410 Thu, 15 Aug 2024 18:33:16 +0000 https://randomnerdtutorials.com/?p=101925#comment-948410 Hello
I switched to FirebaseClient. I think I’ll be able to use error checking.
if (aResult.isError()) {
Firebase.printf(“Error task: %s, msg: %s, code: %d\n”, aResult.uid().c_str(), aResult.error().message().c_str(), aResult. error().code());
Serial.println(“Error received!!!!!!”);
delay(10000);
//ESP.restart();
//WiFi.reconnect();
//FirebaseApp.getRefreshToken();
}

]]>
By: Birol https://randomnerdtutorials.com/solved-reconnect-esp32-to-wifi/#comment-947224 Sat, 10 Aug 2024 13:21:56 +0000 https://randomnerdtutorials.com/?p=101925#comment-947224 Hi Sara
Thank you very much for your useful teachings.
You were directed to this tutorial for the Firebase timeout error.
I applied the Wifireconnect plugin, but I still get the timeout error.
Is there a way to try again when I get a timeout error in Firebase?
Thanks

]]>
By: Ion Nicu https://randomnerdtutorials.com/solved-reconnect-esp32-to-wifi/#comment-869356 Wed, 01 Nov 2023 14:11:29 +0000 https://randomnerdtutorials.com/?p=101925#comment-869356 Specifically, only if I select the Arduino Uno board.

]]>
By: Ion Nicu https://randomnerdtutorials.com/solved-reconnect-esp32-to-wifi/#comment-869355 Wed, 01 Nov 2023 14:08:31 +0000 https://randomnerdtutorials.com/?p=101925#comment-869355 Both codes work. But after compiling, loading and resetting, my ESP connects to wifi only if I simply change the board to arduino IDE 2.board is ESP-WROOM32.Ai idea why this happens?

]]>
By: Guy https://randomnerdtutorials.com/solved-reconnect-esp32-to-wifi/#comment-861819 Thu, 21 Sep 2023 20:38:31 +0000 https://randomnerdtutorials.com/?p=101925#comment-861819 In reply to Guy.

Hi,
Just noticed that in my sketch, I used both wm.setwifiautoreconnect(true) and WiFi.reconnect() simultaniously. This was the issue. Using only WiFi.reconnect is working fine with WiFiManager.h
Thanks

]]>
By: Guy https://randomnerdtutorials.com/solved-reconnect-esp32-to-wifi/#comment-861715 Thu, 21 Sep 2023 08:24:58 +0000 https://randomnerdtutorials.com/?p=101925#comment-861715 Hi,
I am using WiFiManager.h on an ESP32.
Would the sketch ( WiFi.disconnect(); WiFi.reconnect(); ) also work to reconnect, or is there any other way to reconnect ? I tried using wm.setWifiAutoreconnect (true) but this seems not to work.
Thanks.

]]>
By: Udo https://randomnerdtutorials.com/solved-reconnect-esp32-to-wifi/#comment-845417 Wed, 05 Jul 2023 22:21:45 +0000 https://randomnerdtutorials.com/?p=101925#comment-845417 In reply to Larry.

I have the same problem with the same error on VSCode. Do you have a solution?

Thanks, Udo

]]>
By: Larry https://randomnerdtutorials.com/solved-reconnect-esp32-to-wifi/#comment-838711 Sun, 04 Jun 2023 11:56:56 +0000 https://randomnerdtutorials.com/?p=101925#comment-838711 In reply to Larry.

I finally solved the issue with not compiling on the arduino.ide. I deleted the arduino.ide and reinstalled it. The sketch worked without any issues. I still cannot get it to compile on vscode/platformio. I will continue to try and solve that problem. I think it may have something to do with the way the functions are not declared in the sketch.

Larry

]]>
By: Larry https://randomnerdtutorials.com/solved-reconnect-esp32-to-wifi/#comment-838063 Tue, 30 May 2023 17:02:30 +0000 https://randomnerdtutorials.com/?p=101925#comment-838063 Hi Everyone,

I have a problem with the raw sketch, When I try and compile it in the Arduino IDE or
In vscode it will not compile. It gives me the following error:

src\main.cpp: In function ‘void WiFiStationDisconnected(system_event_id_t, system_event_info_t)’:
src\main.cpp:29:23: error: ‘union system_event_info_t’ has no member named ‘wifi_sta_disconnected’ Serial.println(info.wifi_sta_disconnected.reason);
^
In file included from C:\Users\lfree.platformio\packages\framework-arduinoespressif32\libraries\WiFi\src/WiFi.h:31:0,
from src\main.cpp:11:
src\main.cpp: In function ‘void setup()’:
C:\Users\lfree.platformio\packages\framework-arduinoespressif32\libraries\WiFi\src/WiFiType.h:35:22: error: ‘ARDUINO_EVENT_WIFI_STA_CONNECTED’ is not a member of ‘system_event_id_t’
#define WiFiEvent_t system_event_id_t
^
src\main.cpp:42:38: note: in expansion of macro ‘WiFiEvent_t’
WiFi.onEvent(WiFiStationConnected, WiFiEvent_t::ARDUINO_EVENT_WIFI_STA_CONNECTED);
^
C:\Users\lfree.platformio\packages\framework-arduinoespressif32\libraries\WiFi\src/WiFiType.h:35:22: error: ‘ARDUINO_EVENT_WIFI_STA_GOT_IP’ is not a member of ‘system_event_id_t’
#define WiFiEvent_t system_event_id_t
^
src\main.cpp:43:27: note: in expansion of macro ‘WiFiEvent_t’
WiFi.onEvent(WiFiGotIP, WiFiEvent_t::ARDUINO_EVENT_WIFI_STA_GOT_IP);
^
C:\Users\lfree.platformio\packages\framework-arduinoespressif32\libraries\WiFi\src/WiFiType.h:35:22: error: ‘ARDUINO_EVENT_WIFI_STA_DISCONNECTED’ is not a member of ‘system_event_id_t’
#define WiFiEvent_t system_event_id_t
^
src\main.cpp:44:41: note: in expansion of macro ‘WiFiEvent_t’
WiFi.onEvent(WiFiStationDisconnected, WiFiEvent_t::ARDUINO_EVENT_WIFI_STA_DISCONNECTED);
^
*** [.pio\build\esp32doit-devkit-v1\src\main.cpp.o] Error 1
=================================== [FAILED] Took 3.26 seconds ===================================

I have tried everything I can think of, but no luck. I hope someone can help
Thank you.

Larry

]]>