Hey again. I have my ESP32-Cam module running in AP mode. To see if a station connects I use the red onboard LED and the code
digitalWrite(LED_RED, (WiFi.softAPgetStationNum())?LOW:HIGH); // lo drives the led...
This line runs in the loop. (For this test the only one). Effect: As soon as my station connects the LED turns on within ms. Fine. BUT, if I switch off (power off!) the station again the LED keeps lit for more then a minute ![]()
Why WiFi.softAPgetStationNum() has such a delay on dedecting the loss of the station? Do I need a kind of listener...?
Tnx 4 your ideas.
If powering off instead of disconnecting, it takes a bit for the AP to determine you are not there. At least that is how most APs work.
Ok, good to know. My idea was to use this funktion to detect the loss of communication as a rersult of too much distance between the ESP32s.
Seems I have to try a little harder, maybe evaluting the RSSI and then call a clean disconnect.