Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question about output of ESP.getChipId()? #921

Closed
EnvironmentMonitor opened this issue Oct 22, 2015 · 7 comments
Closed

Question about output of ESP.getChipId()? #921

EnvironmentMonitor opened this issue Oct 22, 2015 · 7 comments

Comments

@EnvironmentMonitor
Copy link

Hi,
when this is run it returns the last three portions of the mac address is this correct?

Serial.printf(" ESP8266 Chip id = %08X\n", ESP.getChipId());

Using ver. 1.6.5-1160-gef26c5f

Thanks....

@igrr
Copy link
Member

igrr commented Oct 22, 2015

This is correct. By default, ESP sets its MAC address as a concatenation of
3 fixed bytes and 3 unique bytes burned into chip (which are read by
getChipId function).

On Thu, Oct 22, 2015, 18:16 Environmental Logging Equipment OPEN SOURCE <
notifications@github.com> wrote:

Hi,
when this is run it returns the last three portions of the mac address is
this correct?

Serial.printf(" ESP8266 Chip id = %08X\n", ESP.getChipId());

Using ver. 1.6.5-1160-gef26c5f

Thanks....


Reply to this email directly or view it on GitHub
#921.

@EnvironmentMonitor
Copy link
Author

Many thanks, I was trying to see if a version number could be returned,
maybe determine from that the -01,07 etc.

Thanks again......

On Thu, Oct 22, 2015 at 4:30 PM, Ivan Grokhotkov notifications@github.com
wrote:

This is correct. By default, ESP sets its MAC address as a concatenation of
3 fixed bytes and 3 unique bytes burned into chip (which are read by
getChipId function).

On Thu, Oct 22, 2015, 18:16 Environmental Logging Equipment OPEN SOURCE <
notifications@github.com> wrote:

Hi,
when this is run it returns the last three portions of the mac address is
this correct?

Serial.printf(" ESP8266 Chip id = %08X\n", ESP.getChipId());

Using ver. 1.6.5-1160-gef26c5f

Thanks....


Reply to this email directly or view it on GitHub
#921.


Reply to this email directly or view it on GitHub
#921 (comment).

@romelemperado
Copy link

romelemperado commented Aug 6, 2018

Hi @igrr

ESP.getChipId()
returns not related to the MAC ID of my NodMCU

My mac is: 84:F*:E*:52:F1:6C but it returns ESP5435756

@Pablo2048
Copy link

Probably it returns 5435756(DEC) -> toHEX == 52F16C - it is MAC address without OUI (https://en.wikipedia.org/wiki/MAC_address).

@duncan-a
Copy link

duncan-a commented Aug 6, 2018 via email

@majenkotech
Copy link
Contributor

majenkotech commented Aug 13, 2018

The first three bytes are the OUI and are allocated to Espressif by IEEE. They currently have 23 allocated:

18-FE-34   (hex)                Espressif Inc.
24-0A-C4   (hex)                Espressif Inc.
24-B2-DE   (hex)                Espressif Inc.
2C-3A-E8   (hex)                Espressif Inc.
30-AE-A4   (hex)                Espressif Inc.
3C-71-BF   (hex)                Espressif Inc.
54-5A-A6   (hex)                Espressif Inc.
5C-CF-7F   (hex)                Espressif Inc.
60-01-94   (hex)                Espressif Inc.
68-C6-3A   (hex)                Espressif Inc.
84-0D-8E   (hex)                Espressif Inc.
84-F3-EB   (hex)                Espressif Inc.  <-- recognise it?
90-97-D5   (hex)                Espressif Inc.
A0-20-A6   (hex)                Espressif Inc.
A4-7B-9D   (hex)                Espressif Inc.
AC-D0-74   (hex)                Espressif Inc.
B4-E6-2D   (hex)                Espressif Inc.
BC-DD-C2   (hex)                Espressif Inc.
C4-4F-33   (hex)                Espressif Inc.
CC-50-E3   (hex)                Espressif Inc.
D8-A0-1D   (hex)                Espressif Inc.
DC-4F-22   (hex)                Espressif Inc.
EC-FA-BC   (hex)                Espressif Inc.

Given that the last three digits are supposedly "unique", that gives 256256256*28 possible MAC addresses Espressif have available to them currently. That's 469,762,048 possible MAC addresses. These are across their entire range of products, of course, and some may be only used internally for testing, but it's already a large number. As they run out they can request another allocation from IEEE.

It's up to them if they do make them globally unique, though. Ideally, they should.

In general it's accepted that the last three bytes aren't unique, but the MAC address is. You have to take the entirety of the MAC address to have it unique, not just the last three bytes. Especially since 16777216 is far far below the number of chips Espressif have sold.

The full list of OUI allocations is available from http://standards-oui.ieee.org/oui.txt

@YoNevelt
Copy link

I've got an ESP-WROVER-B (16MB flash) and this function gives me the MAC backwards by 2 digits:

  • MAC: 40:F5:20:xx:xx:xx
  • ChipID: xx:xx:xx:20:F5:40

By the way, I've seen a comment here, the Espressif Inc. has extended the registered MAC list :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants