WiFiClient provides this functions :
IPAddress remoteIP();
IPAddress localIP();
But as I know this functions used when you establish client connection to remote .
If I use this functions from server is it possible to get actual client IP ? If no how can I establish that ?
WiFiClient client = server.available();
if (client) {
if (client.connected()) {
Serial.println("Client Connected IP test:");
IPAddress ip1 = client.localIP();
IPAddress ip2 = client.remoteIP();
Serial.println(ip1);
Serial.println(ip2);
}
client.stop();
}
Result :
Client Connected IP test:
192.168.4.1 <--- this is the IP of the access point server ( this esp ).
192.168.4.2 <--- is this the actual IP of the connected client (other esp) ?