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.
ESP32 mac address
Re: ESP32 mac address
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?
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?
-
- Posts: 16
- Joined: Wed Jun 13, 2018 11:48 am
Re: ESP32 mac address
Thanks for your suggestion.
I am now getting the default mac address.
I am now getting the default mac address.
Who is online
Users browsing this forum: No registered users and 102 guests