ESP32 MAC address does not match AP MAC address

autodog
Posts: 9
Joined: Sat Sep 21, 2019 5:41 am

ESP32 MAC address does not match AP MAC address

Postby autodog » Wed Dec 14, 2022 4:32 am

Greetings,

We are using the ESP32-WROVER-B with esp-idf v3.3.6 and have noticed an issue we can't explain:

When we read the MAC address from the ESP32 WiFi interface in STA mode using the esp_wifi_get_mac() function, the value returned does not match the MAC address reported by the AP point it is connected to.

When the ESP32 STA connects to a 3rd party AP, the AP reports the ESP32 MAC address to be 30:AE:A4:CB:66:98
Multiple different AP vendors return the same value. Using esptoo.py read_mac also returns this same value.

When calling the esp_wifi_get_mac() function in firmware, it returns a STA MAC address of A8:D1:FB:3F:F8:D0

Example Code:
  1. // Get MAC address and display as 6-byte hex value
  2. uint8_t mac[6];
  3. char macAddr[13];
  4. esp_wifi_get_mac(WIFI_IF_STA, mac);
  5. snprintf(macAddr, sizeof(macAddr),
  6.           "%02X%02X%02X%02X%02X%02X", mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
  7. printf("MAC address: %s", macAddr);
Any ideas if this is expected behavior or are we doing something funny here?

Thanks!
-AD
Last edited by autodog on Wed Dec 14, 2022 9:39 pm, edited 1 time in total.

ESP_igrr
Posts: 2071
Joined: Tue Dec 01, 2015 8:37 am

Re: ESP32 MAC address does not match AP MAC address

Postby ESP_igrr » Wed Dec 14, 2022 8:25 pm

Are you seeing this behavior with the wifi station example from IDF, or only with your application?

Since IDF v3.3.6 is EoL, I would also suggest trying the same with one of the newer IDF releases. If you still get the same issue, please report it at https://github.com/espressif/esp-idf/issues and we will investigate it.

Who is online

Users browsing this forum: Bing [Bot] and 59 guests