Page 1 of 1

how to reconnect to wifi with esp32 after power loss or router restart

Posted: Sun Jan 01, 2023 11:52 pm
by Alexandre2001
I found that every time I power down my ESP32 board and power it back up, it can't automatically reconnect to the router or access point configured in the sketch.
Thus, I find myself having to start uploading the sketch to the board each time I want to use the embedded server after the power has been cut off. Which is not at all practical if it is a major project.
A,d suddenly, I take the same opportunity to ask what to do to solve the same problem, but this time in the case where it is the access point or the router that we restart.

Please answer me.

Re: how to reconnect to wifi with esp32 after power loss or router restart

Posted: Mon Jan 02, 2023 2:32 pm
by bidrohini
You can check this if already have not: https://randomnerdtutorials.com/solved- ... 2-to-wifi/

Re: how to reconnect to wifi with esp32 after power loss or router restart

Posted: Tue Jan 03, 2023 2:39 am
by mbratch
It seems odd that downloading the sketch executes your wifi initialization differently than when you power cycle your device. Perhaps you could share your setup code.

Re: how to reconnect to wifi with esp32 after power loss or router restart

Posted: Thu Jan 05, 2023 9:04 am
by Alexandre2001
bidrohini wrote:
Mon Jan 02, 2023 2:32 pm
You can check this if already have not: https://randomnerdtutorials.com/solved- ... 2-to-wifi/
Thank you very much for the intervention, when I implemented WiFi event handling, the problem did not occur anymore.
Cordially
Alex