Chat freely about anything...

User avatar
By J.Silva
#74807 Hello,

I need to find out the mac address of the router with the ESP8266 :shock:

I have the IP with this command:
Code: Select allSerial.println(WiFi.gatewayIP());


I also used a function to check all the devices connected to the ESP8266

Code: Select allvoid client_status() {
 
  unsigned char number_client;
  struct station_info *stat_info;
 
  struct ip_addr *IPaddress;
  IPAddress address;
  int i=1;
 
  number_client= wifi_softap_get_station_num();
  stat_info = wifi_softap_get_station_info();
 
  Serial.print(" Total Connected Clients are = ");
  Serial.println(number_client);
 
    while (stat_info != NULL) {
   
      IPaddress = &stat_info->ip;
      address = IPaddress->addr;
     
      Serial.print("client= ");
     
      Serial.print(i);
      Serial.print(" IP adress is = ");
      Serial.print((address));
      Serial.print(" with MAC adress is = ");
     
      Serial.print(stat_info->bssid[0],HEX);Serial.print(" ");
      Serial.print(stat_info->bssid[1],HEX);Serial.print(" ");
      Serial.print(stat_info->bssid[2],HEX);Serial.print(" ");
      Serial.print(stat_info->bssid[3],HEX);Serial.print(" ");
      Serial.print(stat_info->bssid[4],HEX);Serial.print(" ");
      Serial.print(stat_info->bssid[5],HEX);Serial.print(" ");
     
      stat_info = STAILQ_NEXT(stat_info, next);
      i++;
      Serial.println();
    }
   
  delay(500);
}


but I didn't manage to get the mac address of the router

is there any way?