running Espruino on ESP8266, like esptool.py does:
esptool.py --port /dev/cu.usbserial --baud 115200 read_mac
Connecting... MAC: 18:fe:34:05:99:c9
inside esptool.py
// OTP ROM addresses ESP_OTP_MAC0 = 0x3ff00050 ESP_OTP_MAC1 = 0x3ff00054 def read_mac(self): mac0 = self.read_reg(self.ESP_OTP_MAC0) mac1 = self.read_reg(self.ESP_OTP_MAC1) if ((mac1 >> 16) & 0xff) == 0: oui = (0x18, 0xfe, 0x34) elif ((mac1 >> 16) & 0xff) == 1: oui = (0xac, 0xd0, 0x74) else: raise FatalError("Unknown OUI") return oui + ((mac1 >> 8) & 0xff, mac1 & 0xff, (mac0 >> 24) & 0xff)
@MaBe 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.
running Espruino on ESP8266, like esptool.py does:
esptool.py --port /dev/cu.usbserial --baud 115200 read_mac
Connecting...
MAC: 18:fe:34:05:99:c9
inside esptool.py