ESP32 mac address

hemant.chaudhari
Posts: 16
Joined: Wed Jun 13, 2018 11:48 am

ESP32 mac address

Postby hemant.chaudhari » Wed Jun 13, 2018 11:58 am

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.

ESP_Angus
Posts: 2344
Joined: Sun May 08, 2016 4:11 am

Re: ESP32 mac address

Postby ESP_Angus » Thu Jun 14, 2018 4:45 am

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?

hemant.chaudhari
Posts: 16
Joined: Wed Jun 13, 2018 11:48 am

Re: ESP32 mac address

Postby hemant.chaudhari » Thu Jun 14, 2018 12:05 pm

Thanks for your suggestion.

I am now getting the default mac address.

Who is online

Users browsing this forum: No registered users and 96 guests