Do you mean when running Espruino on the ESP8266 itself, or when running on an Espruino board connected to the ESP8266?
If it's on the Espruino board I'm not sure there's a function, but you can add one with a simple bit of code. Something like:
wifi.getMAC = function(callback) { var mac; at.cmdReg("AT+CIFSR\r\n", 1000, "+CIFSR", function(d) { if (d.indexOf("STAMAC")>=0) mac=JSON.parse(d.slice(d.indexOf(',')+1)); }, function(d) { if (d!="OK") callback("CIFSR failed: "+d); else callback(null, mac); }); } // wifi.getMAC(function(err,mac) { console.log(mac); });
@Gordon started
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Do you mean when running Espruino on the ESP8266 itself, or when running on an Espruino board connected to the ESP8266?
If it's on the Espruino board I'm not sure there's a function, but you can add one with a simple bit of code. Something like: