You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • 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);
    });
    
About

Avatar for Gordon @Gordon started