ESP8266 Developer Zone The Official ESP8266 Forum 2016-11-19T13:12:42+08:00 https://bbs.espressif.com:443/feed.php?f=15&t=3102 2016-11-19T13:12:42+08:00 2016-11-19T13:12:42+08:00 https://bbs.espressif.com:443/viewtopic.php?t=3102&p=10584#p10584 <![CDATA[Re: How to get Access Point MAC adress]]>
You can access the MAC address of any AP the moment the ESP8266 connects to it by registering a WiFi event callback:
void wifi_set_event_handler_cb(wifi_event_handler_cb_t cb);

The function could be of the form:

Code:

void wifi_handle_event_cb(System_Event_t *evt) {
os_printf("event %x\n", evt->event);
switch (evt->event)
{
case EVENT_STAMODE_CONNECTED:
os_printf("connect to ssid %s, channel %d\n", evt->event_info.connected.ssid, evt->event_info.connected.channel);
os_printf("AP MAC address is  %s\n", evt->event_info.connected.bssid);
break;

case ....
....
}


The line
os_printf("AP MAC address is %s\n", evt->event_info.connected.bssid);
will get you the MAC of the currently connected AP in station mode.

Statistics: Posted by Guest — Sat Nov 19, 2016 1:12 pm


]]>
2016-11-17T18:23:42+08:00 2016-11-17T18:23:42+08:00 https://bbs.espressif.com:443/viewtopic.php?t=3102&p=10569#p10569 <![CDATA[How to get Access Point MAC adress]]>
My ESP is in station mode, I can get the RSSI of few APs in my school but I can't get the MAC adress of this APs.
Is there anyone who knows how to get theses informations ?

Thank you!

Statistics: Posted by GEOLOCWIFI — Thu Nov 17, 2016 6:23 pm


]]>