Page 1 of 1

chip_id for ESP32

Posted: Sat Jan 14, 2017 8:43 pm
by dmitryga
Hi everybody!

ESP8266 NodeMCU has 2 LUA functions chip_id and flash_id which returns unique (I hope it's unique) identifier of processor chip and flash memory chip. Does ESP32 has similar capabilities? I've searched through esp-idf and did not find anything close enough to these functions :(

Re: chip_id for ESP32

Posted: Sun Jan 15, 2017 1:45 am
by ESP_igrr
Regarding the chip ID, it is basically the chip's MAC address, which can be obtained using esp_efuse_read_mac function.

As for reading the flash chip ID, we don't have this in the ESP-IDF yet. I'll put your feature request on our list.

Re: chip_id for ESP32

Posted: Sun Jan 15, 2017 10:56 am
by dmitryga
Thanks for your quick reply.

Regarding using MAC address as chip id: is it possible to change MAC programmatically or during flashing firmware or MAC is unchangeable? I ask this cause I'm developing device which should be uniquely identified and end user should not be able to change device's identifier.

Re: chip_id for ESP32

Posted: Sun Jan 15, 2017 11:24 am
by ESP_igrr
MAC address can be changed once by programming a customer-defined address into efuses. If you want to make sure that device users can not change MAC address, you need to write-protect these efuses (check the technical reference manual and espefuse.py tool help for details).

Re: chip_id for ESP32

Posted: Fri Jul 15, 2022 10:41 am
by markevens
Could it be possible that 2 esp32 has the same mac addresses by default?

Re: chip_id for ESP32

Posted: Fri Jul 15, 2022 1:41 pm
by ESP_Sprite
That should never happen out of the factory.

Re: chip_id for ESP32

Posted: Thu Jan 04, 2024 4:11 pm
by Rikard
WIFI.macaddress() works for me, 6 bytes are returned with unique ID.