# Issue with WiFi.macAddress() and WiFi.softAPmacAddress() on ESP32 with Arduino Core v3.2.0

**URL:** <https://forum.arduino.cc/t/issue-with-wifi-macaddress-and-wifi-softapmacaddress-on-esp32-with-arduino-core-v3-2-0/1374071>\
**Category:** Programming\
**Created:** [April 16, 2025, 5:34pm UTC](https://forum.arduino.cc/t/issue-with-wifi-macaddress-and-wifi-softapmacaddress-on-esp32-with-arduino-core-v3-2-0/1374071 "2025-04-16T17:34:31Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![sandeepkumar\_konkumutti](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/sandeepkumar_konkumutti/32/1211716_2.png) [@sandeepkumar\_konkumutti](https://forum.arduino.cc/u/sandeepkumar_konkumutti)\
**Post date:** [April 16, 2025, 5:34pm UTC](https://forum.arduino.cc/t/issue-with-wifi-macaddress-and-wifi-softapmacaddress-on-esp32-with-arduino-core-v3-2-0/1374071/1 "2025-04-16T17:34:32Z")

</div>

Hi everyone,

I’m using the WiFi.macAddress() and WiFi.softAPmacAddress() APIs to retrieve the MAC addresses on ESP8266 and ESP32.

On the ESP8266, both APIs work correctly and return the expected MAC addresses.

On the ESP32, these APIs work fine when using the Arduino core version v1.0.6, but after updating to v3.2.0, both functions return all zeros (e.g., 00:00:00:00:00:00).

Has anyone else experienced this issue on ESP32 with Arduino core v3.2.0? Is this a known bug or is there a workaround?

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![sterretje](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/sterretje/32/391294_2.png) [@sterretje](https://forum.arduino.cc/u/sterretje)\
**Post date:** [April 16, 2025, 5:51pm UTC](https://forum.arduino.cc/t/issue-with-wifi-macaddress-and-wifi-softapmacaddress-on-esp32-with-arduino-core-v3-2-0/1374071/2 "2025-04-16T17:51:17Z")

</div>

Topic moved. Please do not post in "Uncategorized"; see the sticky topics in [Uncategorized - Arduino Forum](https://forum.arduino.cc/c/development-tools/uncategorized/184).

---

<div class="post-metadata">

**Author:** ![sonofcy](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/sonofcy/32/1283617_2.png) [@sonofcy](https://forum.arduino.cc/u/sonofcy)\
**Post date:** [April 16, 2025, 8:27pm UTC](https://forum.arduino.cc/t/issue-with-wifi-macaddress-and-wifi-softapmacaddress-on-esp32-with-arduino-core-v3-2-0/1374071/3 "2025-04-16T20:27:46Z")

</div>

Have you checked the Migration doc? There are a few issues with the implementation of Board 3.x

---

<div class="post-metadata">

**Author:** ![gfvalvo](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/gfvalvo/32/1013044_2.png) [@gfvalvo](https://forum.arduino.cc/u/gfvalvo)\
**Post date:** [April 16, 2025, 8:56pm UTC](https://forum.arduino.cc/t/issue-with-wifi-macaddress-and-wifi-softapmacaddress-on-esp32-with-arduino-core-v3-2-0/1374071/4 "2025-04-16T20:56:50Z")

</div>

> [@sandeepkumar\_konkumutti](#):
>
> return all zeros (e.g., 00:00:00:00:00:00).

It's failing the first `if()` statement of this function in `NetworkInterface.cpp`. Unfortunately, I don't know what those checks are or how to fix them. You can report it as an issue on the [GitHub Page](https://github.com/espressif/arduino-esp32).

```arduino
uint8_t *NetworkInterface::macAddress(uint8_t *mac) const {
  if (!mac || _esp_netif == NULL || _interface_id == ESP_NETIF_ID_PPP) {
    return NULL;
  }
  esp_err_t err = esp_netif_get_mac(_esp_netif, mac);
  if (err != ESP_OK) {
    log_e("Failed to get netif mac: 0x%04x %s", err, esp_err_to_name(err));
    return NULL;
  }
  return mac;
}

```

---

<div class="post-metadata">

**Author:** ![ptillisch](https://avatars.discourse-cdn.com/v4/letter/p/ad7895/32.png) [@ptillisch](https://forum.arduino.cc/u/ptillisch)\
**Post date:** [April 16, 2025, 11:51pm UTC](https://forum.arduino.cc/t/issue-with-wifi-macaddress-and-wifi-softapmacaddress-on-esp32-with-arduino-core-v3-2-0/1374071/5 "2025-04-16T23:51:16Z")

</div>

Hi @sandeepkumar_konkumutti. I think it is explained here:

[https://github.com/espressif/arduino-esp32/issues/9509#issuecomment-2054171612](https://github.com/espressif/arduino-esp32/issues/9509#issuecomment-2054171612)

> since the network refactoring, macAdress comes from the interface and you are asking for it before you have started that interface. Network.macAddress gives you the base MAC of the ESP chip.

[https://github.com/espressif/arduino-esp32/issues/9509#issuecomment-2054178644](https://github.com/espressif/arduino-esp32/issues/9509#issuecomment-2054178644)

> By far the best way is to use the new network interfaces:
> 
> ```cpp
> // Get the base MAC of the ESP chip (works always)
> Network.macAddress(mac);
> 
> // Get the MAC address of WiFi STA (must first start interface)
> WiFi.STA.begin();
> WiFi.STA.macAddress(mac);
> 
> // Get the MAC address of WiFi AP (must first start interface)
> WiFi.AP.begin();
> WiFi.AP.macAddress(mac);
> 
> // Get the MAC address of ETH (must first start interface)
> ETH.begin();
> ETH.macAddress(mac);
> 
> ```

So this means it was an intentional breaking change, not a bug. Unfortunately the developers were not kind enough to document the change.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [October 13, 2025, 11:51pm UTC](https://forum.arduino.cc/t/issue-with-wifi-macaddress-and-wifi-softapmacaddress-on-esp32-with-arduino-core-v3-2-0/1374071/6 "2025-10-13T23:51:18Z")

</div>

Closed on October 13, 2025, 11:51pm UTC

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
