Page 1 of 1

ESP32 mac address

Posted: Wed Jun 13, 2018 11:58 am
by hemant.chaudhari
Hello team, I am trying to print base mac address of my esp32.when I got connected to the wifi I get following log on terminal
wifi: mode : sta (30:ae:a4:6b:e9:98)

but when I try to print it using following functions
esp_err_t esp_wifi_get_mac
esp_err_t esp_efuse_mac_get_custom(uint8_t *mac)

then I got (04:27:40:3F:23:00) as my mac address.If I want to get (30:ae:a4:6b:e9:98) as my mac address ,what should I have have to do?

Thanks in advance.

Re: ESP32 mac address

Posted: Thu Jun 14, 2018 4:45 am
by ESP_Angus
Hi hemant,

esp_efuse_mac_get_custom() will read a custom base MAC address which was written to BLK3 of efuse. If you haven't written a custom MAC address, then it won't return anything meaningful. See here for information about setting a custom MAC address.

esp_wifi_get_mac() and esp_efuse_mac_get_default() should both be able to return a default MAC address with an Espressif OUI (like 30:ae:a4). Are you checking the result code from these functions? Can you please post the full code you are using to call them?

Re: ESP32 mac address

Posted: Thu Jun 14, 2018 12:05 pm
by hemant.chaudhari
Thanks for your suggestion.

I am now getting the default mac address.