Page 1 of 1

Disconnect and reconnect ESP32 to hotspot.

Posted: Tue Jan 15, 2019 5:37 pm
by filipESP
Hi.
I want to disconnect wifi when it is idle for long time and reconnect when I set any GPIO to high level.
Reconnect work when I put esp_connect_wifi into event_handler in SYSTEM_EVENT_STA_DISCONNECTED case, but doesn't work when I call esp_connect_wifi in other function.
How to make it working?

Re: Disconnect and reconnect ESP32 to hotspot.

Posted: Wed Jan 16, 2019 12:53 pm
by filipESP
I resolved my issue by using esp_wifi_stop() and esp_wifi_start().
I also used the flag to notify the event_handler that it can call esp_wifi_connect ( in SYSTEM_EVENT_STA_DISCONNECTED case ) when I will want to connect to Hotspot.

Re: Disconnect and reconnect ESP32 to hotspot.

Posted: Wed Jan 16, 2019 5:09 pm
by Ritesh
So, is there any issue now to reconnect with hot-spot?

Re: Disconnect and reconnect ESP32 to hotspot.

Posted: Wed Jan 16, 2019 6:02 pm
by filipESP
It's done. :)

Re: Disconnect and reconnect ESP32 to hotspot.

Posted: Thu Jan 17, 2019 8:02 am
by Ritesh
filipESP wrote:
Wed Jan 16, 2019 6:02 pm
It's done. :)
Great. Good Job. Let me know if any issue into future for ESP32