I need to have an ID of an ESP8266. Until now, I just add one in EEPROM. But wonder if I can use UID from the ESP8266 himself. By reading a bunch of articles over the internet, I found some data that is a little bit confusing.
First of all, according to this: https://bbs.espressif.com/viewtopic.php?t=1303
It looks like ID is just the last part of the MAC address. Also, it is not unique as in the time to come, there could be more chips with the same ID. Which is weird.
The second thing...
With:
Serial.println(WiFi.macAddress());
I get something (say) like this:
A8:48:FA:EF:FD:00
With:
Serial.printf("chip id:\t%08X\n",ESP.getChipId());
I get something like this:
chip id: 00EFFD00
But with this:
Serial.println(ESP.getChipId());
I get some 8 numbers that do not match with the MAC address.
What if I want to use this ID? Say I want to put it into a String (here comes the shi... string storm). I can not just make it like this:
String espID = ESP.getChipId(), HEX;
Use of capitals for hex values is a convention, not a requirement
Bear in mind that hex is a method of displaying data to make it easier for humans to read and that the underlying data is held as a series of bits in bytes unless the hex data is actually held as characters, in which case you can't do maths or comparisons with it as you can with raw data