Board: ESP32 Wrover-B DEV KIT V4
Hello !
I'm having difficulties finding a way to know when a client has connected to the ESP when it is in STA Mode.
Code: Select all
#include <WiFi.h>
void setup() {
WiFi.begin(ssid, password);
delay(500);
int k = 0;
while (WiFi.status() != WL_CONNECTED && k<20) {
k++;
delay(1000);
Serial.println((String)"Attempt " + k + " - Connecting to WiFi..");
}
if(WiFi.status() == WL_CONNECTED) {
String IP = WiFi.localIP().toString();
Serial.println((String)"Connected to " + ssid + " with IP addres: " + IP);
}
}
I found WiFi.softAPgetStationNum(); for AP Mode, but I couldn't find a similar function for STA Mode.
Thank you !