Esp32S3 : Question concerning Wifi AP connection

ThomasESP32
Posts: 209
Joined: Thu Jul 14, 2022 5:15 am

Esp32S3 : Question concerning Wifi AP connection

Postby ThomasESP32 » Tue Jun 27, 2023 8:12 am

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

nikkio
Posts: 3
Joined: Mon Jun 26, 2023 11:13 am

Re: Esp32S3 : Question concerning Wifi AP connection

Postby nikkio » Wed Jun 28, 2023 8:21 am

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...

MicroController
Posts: 1552
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

Re: Esp32S3 : Question concerning Wifi AP connection

Postby MicroController » Thu Jun 29, 2023 1:44 am

You can use the WIFI_EVENT_AP_STACONNECTED and WIFI_EVENT_AP_STADISCONNECTED events.

Who is online

Users browsing this forum: Majestic-12 [Bot] and 413 guests