-->
Page 1 of 1

ESP8266 to get RSSI value of connected clients

PostPosted: Thu Sep 21, 2017 1:50 am
by Vishnu
Hi Team,
I have ESP8266 module. and i have configured it as AP[Access Point]. Now to that AP my phones[say Client] are connected. So can i get details of RSSI , MAC ID of the connected clients from ESP8266 wifi module?

Re: ESP8266 to get RSSI value of connected clients

PostPosted: Thu Sep 21, 2017 1:41 pm
by martinayotte
You can enumerate connected clients with the following code for their MAC address, but you won't be able to show their RSSI, since this is only found on client side.
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);


Make sure you have this SDK include :

Code: Select allextern "C" {
#include "user_interface.h"
}