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

Avatar for MaBe @MaBe started