Search code examples
wifiesp8266mac-addressnodemcu

nodemcu unable to retrieve's AP's MAC (BSSID)


My nodemcu lua app needs to retrieve the MAC Address (BSSID) of the Access Point the nodemcu dev kit is connected to. It is able to retrieve the SSID, but the BSSID field is 'nil'.

> x=wifi.sta.getapinfo()
> y=wifi.sta.getapindex()
> print(x[y].ssid)
MySSID
>print(x[y].bssid)
nil

What needs to be done to retrieve the MAC Address? Or is it not supported?


Solution

  • So, the answer now is that this was added to the NodeMCU dev branch on July 8th: https://github.com/nodemcu/nodemcu-firmware/pull/2026

    Should be on master in the not so distant future.