Left here for archival purposes.
User avatar
By jarkman
#49277 I'm trying to change the AP mac address, but wifi.ap.setmac always fails for me

Demo code:

wifi.setmode(wifi.SOFTAP)
cfg={}
cfg.ssid="ESP_STATION"
cfg.pwd="the_ESP8266_WIFI_password"
wifi.ap.config(cfg)
ap_mac = wifi.ap.getmac()

newmac=ap_mac
print(newmac)
wifi.ap.setmac(newmac)

Sample output:
1A-FE-34-15-40-5B
> wifi.ap.setmac(newmac)
stdin:1: wrong arg type

I've only been doing Lua for an hour at this point, am I making a silly Lua error, or is this a problem with setmac() just not working ?

Thanks!
Richard