ESP32 MAC Address Is Different After Reset
DodaTech
Updated 2026-06-26
1 min read
In this tutorial, you'll learn about ESP32 MAC Address Is Different After Reset. We cover key concepts, practical examples, and best practices.
The Problem
ESP32 MAC address changes after reset or is different from the label on the module.
Quick Fix
Wrong
Serial.println(WiFi.macAddress());
MAC: 7C:9E:BD:45:12:78
(after reset)
MAC: 7C:9E:BD:45:12:79
Right
#include <WiFi.h>
#include <esp_mac.h>
void setup() {
uint8_t mac[6];
esp_efuse_mac_get_default(mac);
Serial.printf("Base MAC: %02X:%02X:%02X:%02X:%02X:%02X
",
mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
WiFi.mode(WIFI_STA);
Serial.printf("Station MAC: %s
", WiFi.macAddress().c_str());
}
Base MAC: 7C:9E:BD:45:12:78
Station MAC: 7C:9E:BD:45:12:78
Prevention
Use esp_efuse_mac_get_default() to read the factory MAC. Always use the base MAC for device identity. Station and SoftAP MACs differ by +1 and +2 from base. Custom MAC addresses must be set before WiFi.mode(). Burn custom MACs to efuse for persistence.
DodaTech engineers apply these same patterns when building Doda Browser's networking stack, DodaZIP's firmware packaging pipeline, and Durga Antivirus Pro's sensor communication layer.
FAQ
Built by the developers of DodaTech
Doda Browser, DodaZIP & Durga Antivirus Pro