jueves, 18 de julio de 2024

Get the MAC address of the ESP32

 By using the following code you can obtain the MAC address of the ESP32. It is advisable to use a delay to prevent the obtained MAC address from being 00:00:00:00:00:00.

#include <WiFi.h>

 void setup(){

    Serial.begin(115200);

    WiFi.mode(WIFI_STA);

    delay(500);

    Serial.print("\nDefault ESP32 MAC Address: ");

    Serial.println(WiFi.macAddress());

}

 

void loop(){

  // Do Nothing

}



Result without using delay:



Result using delay:



No hay comentarios:

Publicar un comentario