# [SOLVED] Unique (MAC) identification of a nodemcu

Is there a way to identify different nodemcu devices.
Suppose i have many nodemcu devices, how to i uniquely identify each of them?

With a label maker or marker pen? But seriously, there can be many ways via code, and of course with Blynk, each will have a unique Auth token.

Basicly you need to explain the context in which you need them identified.

1 Like

can you tellme any other ways via code other than with the auth token?

Again, totally depends on the context of the situation.

A visual way would be to have a simple flash code for an LED

@suhanichandrag Google has the answer to all your general ESP questions but here’s some code for you to study:

``````/* MACaddress.ino for  https://community.blynk.cc/t/unique-identification-of-a-nodemcu/15915/3

is decimal 102046272361091     decimal blocks 92 207 127 208 146 131

MACdecimal = MAC_array * pow(256,5);                  = 101155069755392
MACdecimal = MACdecimal + MAC_array * pow(256,4);     =    889058230272   total 102044127985664
MACdecimal = MACdecimal + MAC_array * pow(256,3);     =      2130706432   total 102046258692096
MACdecimal = MACdecimal + MAC_array * pow(256,2);     =        13631488   total 102046272323584
MACdecimal = MACdecimal + MAC_array * pow(256,1);     =           37376   total 102046272360960
MACdecimal = MACdecimal + MAC_array;                  =             131   total 102046272361091
*/

#include <ESP8266WiFi.h>

uint8_t MAC_array;
char MAC_char;
unsigned long long MACdecimal;

void setup() {
Serial.begin(115200);
Serial.println("\n");

Serial.print("ESP MAC in decimal blocks: ");
for (int i = 0; i < sizeof(MAC_array); ++i){
Serial.print(MAC_array[i]);
Serial.print("  ");
}
Serial.println();

Serial.print("ESP MAC is: ");
for (int i = 0; i < sizeof(MAC_array); ++i){
MACdecimal = MACdecimal + MAC_array[i] * pow(256,(5 - i));
if(i < sizeof(MAC_array) - 1)
{
sprintf(MAC_char,"%s%02x:",MAC_char,MAC_array[i]);
}
else
{
sprintf(MAC_char,"%s%02x",MAC_char,MAC_array[i]);
}
}

Serial.println(MAC_char);

/* obtain your decimal MAC from https://www.vultr.com/tools/mac-converter
and enter the EUI-48 integer value in the if statement below */
if(MACdecimal == 102046272361091L)  // test by changing the last 91L to 92L
{
Serial.println("MAC matches");
}
else{
Serial.println("MAC does not match");
}
}

void loop() {

}
``````

Serial Monitor

``````ESP MAC in decimal blocks: 92  207  127  208  146  131
ESP MAC is: 5c:cf:7f:d0:92:83
MAC matches
``````
2 Likes

Thankyou! It helps