Comments on: Get ESP32/ESP8266 MAC Address and Change It (Arduino IDE) https://randomnerdtutorials.com/get-change-esp32-esp8266-mac-address-arduino/ Learn ESP8266, ESP32, Arduino, and Raspberry Pi Mon, 09 Feb 2026 11:55:15 +0000 hourly 1 https://wordpress.org/?v=6.8.5 By: Sara Santos https://randomnerdtutorials.com/get-change-esp32-esp8266-mac-address-arduino/#comment-1160630 Mon, 09 Feb 2026 11:55:15 +0000 https://randomnerdtutorials.com/?p=93413#comment-1160630 In reply to Paul Richardson.

Thanks for sharing.
Regards,
Sara

]]>
By: Paul Richardson https://randomnerdtutorials.com/get-change-esp32-esp8266-mac-address-arduino/#comment-1160479 Mon, 09 Feb 2026 00:02:25 +0000 https://randomnerdtutorials.com/?p=93413#comment-1160479 Seems overly complex, you might be able to try this which actually works for me on ESP32 C3:

auto stringhexcode = Network.macAddress();
Serial.println(“Uppercase MAC address=”);
stringhexcode.toUpperCase();
Serial.println(stringhexcode);

]]>
By: Sara Santos https://randomnerdtutorials.com/get-change-esp32-esp8266-mac-address-arduino/#comment-1094155 Sun, 07 Sep 2025 14:59:26 +0000 https://randomnerdtutorials.com/?p=93413#comment-1094155 In reply to Laurent.

Do you have the latest version of the ESP32 core installed?
Go to Tools > Boards > Boards Manager > Searvh for ESP32 and check the version you have installed.

Regards,
Sara

]]>
By: Laurent https://randomnerdtutorials.com/get-change-esp32-esp8266-mac-address-arduino/#comment-1093979 Sun, 07 Sep 2025 02:06:29 +0000 https://randomnerdtutorials.com/?p=93413#comment-1093979 In reply to Sara Santos.

Hi Sara, thanks for answer to this old topic.
Using Wemos Lolin32 (board with embeded display
I tried with other ESP32 board, same.

Laurent

]]>
By: Sara Santos https://randomnerdtutorials.com/get-change-esp32-esp8266-mac-address-arduino/#comment-1093112 Thu, 04 Sep 2025 17:09:09 +0000 https://randomnerdtutorials.com/?p=93413#comment-1093112 In reply to Laurent.

Hi.
I just tried compiling the code and it is working as expected.

Which board are you selecting in Tools > Board?

Regards,
Sara

]]>
By: Laurent https://randomnerdtutorials.com/get-change-esp32-esp8266-mac-address-arduino/#comment-1093081 Thu, 04 Sep 2025 15:05:45 +0000 https://randomnerdtutorials.com/?p=93413#comment-1093081 Hi Sara,
even if it is an old article, I do not understand why I cannot compile the ” get MAC address”. Always got same error:
error: ‘class WiFiClass’ has no member named ‘STA’
WiFi.STA.begin();
^~~
I jut copy and paste of your code. tried to change to another ESP32 board, same. Strange as always, your example are working well, thanks for that.
Looking to some other example, I found that one which works also:

#include “WiFi.h”

void setup() {
// Initialize serial communication at 115200 baud rate
Serial.begin(115200);
delay(1000); // Optional delay for stability

// Set Wi-Fi to station mode and disconnect from any access point
WiFi.mode(WIFI_STA);
WiFi.disconnect();
delay(100); // Short delay to ensure Wi-Fi is in station mode

// Print the MAC address of the ESP32
Serial.println(“ESP32 MAC Address: “);
Serial.println(WiFi.macAddress());
}

void loop() {
// Empty loop
}

]]>
By: Martin Boere https://randomnerdtutorials.com/get-change-esp32-esp8266-mac-address-arduino/#comment-972250 Tue, 15 Oct 2024 13:54:38 +0000 https://randomnerdtutorials.com/?p=93413#comment-972250 Hi Sara,

I think you do great Work

I have the Arduino Nano ESP32 for witch I tried to get the MAC Address, It didn’t work with your code so after several tries I changed It a bit.

Now It works and I’m able to get the MAC Address of my Board, below you can find the changes in the Code (Look for Changed).

#include <WiFi.h>
#include <esp_wifi.h>

void readMacAddress(){
uint8_t baseMac[6];
esp_err_t ret = esp_wifi_get_mac(WIFI_IF_STA, baseMac);
if (ret == ESP_OK) {
Serial.printf(“%02x:%02x:%02x:%02x:%02x:%02x\n”,
baseMac[0], baseMac[1], baseMac[2],
baseMac[3], baseMac[4], baseMac[5]);
} else {
Serial.println(“Failed to read MAC address”);
}
}

void setup(){
Serial.begin(9600);

WiFi.mode(WIFI_STA);
//WiFi.STA.begin();
WiFi.begin();   //I got an error on WiFi.STA.begin(); so I changed that to WiFi.begin();
delay(1000);    //Changed
Serial.print(“[DEFAULT] ESP32 Board MAC Address: “);
delay(1000);    //Changed
readMacAddress();
}

void loop(){

}

Best regards,

Martin

]]>
By: David Strickland https://randomnerdtutorials.com/get-change-esp32-esp8266-mac-address-arduino/#comment-921500 Tue, 04 Jun 2024 15:24:39 +0000 https://randomnerdtutorials.com/?p=93413#comment-921500 The code to get MAC address does not work. This works:-
#include <WiFi.h>

void setup(){
Serial.begin(115200);
Serial.print(“\Default ESP32 MAC Address: “);
Serial.println(Network.macAddress());
}

void loop(){
}

me_no_dev expressif / arduino esp32 github comment April 14

]]>
By: Shahryar https://randomnerdtutorials.com/get-change-esp32-esp8266-mac-address-arduino/#comment-913491 Tue, 07 May 2024 18:33:40 +0000 https://randomnerdtutorials.com/?p=93413#comment-913491 In reply to Sara Santos.

Sorry for bothering @Sara santos
I’m implementing ESP-NOW for my project.
I want to send 4 analog inputs simultaneously to slave board, does ESP32 master is capable of transmitting this rate of data? According to the 250Mb/s limitation.

Best wishes

]]>
By: Shahryar https://randomnerdtutorials.com/get-change-esp32-esp8266-mac-address-arduino/#comment-913161 Mon, 06 May 2024 13:12:18 +0000 https://randomnerdtutorials.com/?p=93413#comment-913161 ]]> Tnx sara
I did it and worked. 👌🏻

]]>