chip_id for ESP32

dmitryga
Posts: 29
Joined: Sat Jan 14, 2017 8:36 pm

chip_id for ESP32

Postby dmitryga » Sat Jan 14, 2017 8:43 pm

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 :(

ESP_igrr
Posts: 2071
Joined: Tue Dec 01, 2015 8:37 am

Re: chip_id for ESP32

Postby ESP_igrr » Sun Jan 15, 2017 1:45 am

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.

dmitryga
Posts: 29
Joined: Sat Jan 14, 2017 8:36 pm

Re: chip_id for ESP32

Postby dmitryga » Sun Jan 15, 2017 10:56 am

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.

ESP_igrr
Posts: 2071
Joined: Tue Dec 01, 2015 8:37 am

Re: chip_id for ESP32

Postby ESP_igrr » Sun Jan 15, 2017 11:24 am

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).

markevens
Posts: 38
Joined: Sat Aug 01, 2020 6:31 am

Re: chip_id for ESP32

Postby markevens » Fri Jul 15, 2022 10:41 am

Could it be possible that 2 esp32 has the same mac addresses by default?

ESP_Sprite
Posts: 9727
Joined: Thu Nov 26, 2015 4:08 am

Re: chip_id for ESP32

Postby ESP_Sprite » Fri Jul 15, 2022 1:41 pm

That should never happen out of the factory.

Rikard
Posts: 1
Joined: Thu Jan 04, 2024 4:08 pm

Re: chip_id for ESP32

Postby Rikard » Thu Jan 04, 2024 4:11 pm

WIFI.macaddress() works for me, 6 bytes are returned with unique ID.

Who is online

Users browsing this forum: No registered users and 131 guests