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

Alexandre2001
Posts: 5
Joined: Sun Jan 01, 2023 10:33 pm

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

Postby Alexandre2001 » Sun Jan 01, 2023 11:52 pm

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.

bidrohini
Posts: 202
Joined: Thu Oct 27, 2022 12:55 pm

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

Postby bidrohini » Mon Jan 02, 2023 2:32 pm

You can check this if already have not: https://randomnerdtutorials.com/solved- ... 2-to-wifi/

User avatar
mbratch
Posts: 303
Joined: Fri Jun 11, 2021 1:51 pm

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

Postby mbratch » Tue Jan 03, 2023 2:39 am

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.

Alexandre2001
Posts: 5
Joined: Sun Jan 01, 2023 10:33 pm

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

Postby Alexandre2001 » Thu Jan 05, 2023 9:04 am

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

Who is online

Users browsing this forum: jdbaptista, jhlee1 and 102 guests