Chat freely about anything...

User avatar
By andre_teprom
#69697 I'm aware of the Arduino function macAddress() available at the <ESP8266WiFi.h> library, however I was more interested to get the MAC address of the remote device which were just connected to my Webserver.

Is it possible ?
User avatar
By martinayotte
#69701
Code: Select allvoid showClients()
{
  struct station_info *stat_info;
  stat_info = wifi_softap_get_station_info();
  uint8_t client_count = wifi_softap_get_station_num();
  String str = "Number of clients = ";
  str += String(client_count);
  str += "\r\nList of clients : \r\n";
  int i = 1;
  while (stat_info != NULL) {
    str += "Station #";
    str += String(i);
    str += " : ";
    str += String(stat_info->bssid[0], HEX);
    str += ":";
    str += String(stat_info->bssid[1], HEX);
    str += ":";
    str += String(stat_info->bssid[2], HEX);
    str += ":";
    str += String(stat_info->bssid[3], HEX);
    str += ":";
    str += String(stat_info->bssid[4], HEX);
    str += ":";
    str += String(stat_info->bssid[5], HEX);
    str += "\r\n";
    i++;
    stat_info = STAILQ_NEXT(stat_info, next);
//    stat_info = stat_info->next;
    }
  Serial.println(str);
}
User avatar
By andre_teprom
#70046 @philbowles
@Martin


Hi,
Thank you for the replies, both answered exactly the question, which is: Yes, Either client and server are located within the same local subnet ( 192.168.x. ). I apologize for the late reply, but I have not received notification from the forum system.

Back to the code, what library would be required to include?



Thanks in advance,