Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By Phil colbert
#42734 This code nearly works for me.....

If theres only one station connected then stat_info comes back as null...

If theres more than one it comes back with the info, any ideas ?


###########

Total connected_client are = 2
client= 1 ip address is = 192.168.4.2 with mac adress is = 106675E0DB9

############

Total connected_client are = 3
client= 1 ip address is = 192.168.4.2 with mac adress is = 106675E0DB9
client= 2 ip address is = 192.168.4.3 with mac adress is = 024D272BC71

##############

Thanks

Phi..
User avatar
By martinayotte
#42755 Are you sure that you didn't introduce a bug in the code ?
Because the following code work fine for me with only 1 client connected :

Code: Select all  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);
    }
  Serial.println(str);