Page 1 of 1

Esp32S3 : Question concerning Wifi AP connection

Posted: Tue Jun 27, 2023 8:12 am
by ThomasESP32
Good morning,

I am working with an Esp32s3 and I manage to use the Wifi in AP Mode (So that one can connect to it in order to
flash the firmware using OTA).

Everything is ok, when I start the Wifi in AP Mode, I can see the Access Point under Windows and I can connect to it
in order to flash the firmware.

Now, I would like the Wifi to be closed/stopped automatically if there is no connection to the access point.
I have created the functions that can be used in order to close/stop the Wifi but I don't know if it is possible
to detect connections to the access point.

Do you know if it is possible and how ?
Best regards,

Thomas TRUILHE

Re: Esp32S3 : Question concerning Wifi AP connection

Posted: Wed Jun 28, 2023 8:21 am
by nikkio
If I understand correctly, you start softAP only at setup?
If so, I suggest to check after a while:

Code: Select all

 if (WiFi.softAPgetStationNum() = 0) {
 WiFi.softAPdisconnect();
 }
(?)
I'm not an expert, just starting to play around...

Re: Esp32S3 : Question concerning Wifi AP connection

Posted: Thu Jun 29, 2023 1:44 am
by MicroController
You can use the WIFI_EVENT_AP_STACONNECTED and WIFI_EVENT_AP_STADISCONNECTED events.