Menu Close

NodeMCU on Arduino IDE – Getting MAC address

This tutorial of Robo India explains how to get MAC address of NodeMCU using Aruduino IDE.

1. Introduction:

The MAC (or Machine Access Control) address is a unique value associated with a network adapter. So, MAC addresses are hardware addresses that uniquely identify a network adapter. MAC address is best thought of as kind of serial number assigned to every network adapter. No two devices shouldhave the same MAC address.

MAC address works at the Data Link Control Layer of the OSI Model.

MAC addresses are most often assigned by the manufacturer of a network interface controller (NIC).

It may also be known as an Ethernet Hardware Address (EHA), Hardware Address or Physical Address.

2. Code the NodeMCU with the following code.

Following code may be downloaded from here

// Tutorial by Robo India
// Gettings MAC address of NodeMCU.

#include <ESP8266WiFi.h>
 
void setup(){ 
   Serial.begin(115200);
   delay(500); 
   Serial.println();
   Serial.print("MAC: ");
   Serial.println(WiFi.macAddress());
 
}
 
void loop(){ 
}

3. Output

After uploading the code open serial monitor and you will find MAC of your NodeMCU.

If you have any query please write us at support@roboindia.com

Thanks and Regards
Content Development Team 
Robo India
https://roboindia.com


Leave a Reply