How to get ESP-32 Chip ID using SDK?
How to get ESP-32 Chip ID using SDK?
I want to get ESP-32's Chip ID.
How to get ESP-32 Chip ID using SDK?
How to get ESP-32 Chip ID using SDK?
Re: How to get ESP-32 Chip ID using SDK?
The chip ID is essentially its MAC address. You can use esp_efuse_read_mac function declared in esp_system.h
Re: How to get ESP-32 Chip ID using SDK?
I use this code:
But the chipid always is 3FFCC82C with different ESP32 IC, why?
Code: Select all
uint8_t chipid[6];
esp_efuse_read_mac(chipid);
Serial.printf("%X\n",chipid);
Re: How to get ESP-32 Chip ID using SDK?
The MAC address is an array of bytes not a single integer, so when you printf in this way you're printing the address of the array in RAM.
Try something like
Try something like
Code: Select all
Serial.printf("%02x:%02x:%02x:%02x:%02x:%02x\n",chipid[0], chipid[1], chipid[2], chipid[3], chipid[4], chipid[5]);
Re: How to get ESP-32 Chip ID using SDK?
Thank you.
Re: How to get ESP-32 Chip ID using SDK?
Hello,
As esp_efuse_read_mac is deprecated but esp_efuse_mac_get_default returns 0 what to use to get the unique id for the chip?
EDIT: sorry, esp_efuse_mac_get_default doesn't return 0,my fault. What's the difference between this function and esptool's chip_id which has some additional chars?
As esp_efuse_read_mac is deprecated but esp_efuse_mac_get_default returns 0 what to use to get the unique id for the chip?
EDIT: sorry, esp_efuse_mac_get_default doesn't return 0,my fault. What's the difference between this function and esptool's chip_id which has some additional chars?
Re: How to get ESP-32 Chip ID using SDK?
The esptool.py chip_id function is printing the MAC address CRC byte in the highest byte of the output, and losing the lowest byte of the MAC entirely. This is a bug, probably the chip_id function should do nothing on ESP32 (or alias to read_mac).
Re: How to get ESP-32 Chip ID using SDK?
Thanks, Angus. I will use only the MAC as unique id.
Re: How to get ESP-32 Chip ID using SDK?
Update to this, in v2.4.0 (currently in development on the master branch), "esptool.py chip_id" will alias to read_mac for ESP32.
(chip_id on ESP8266 is still the 3 least significant bytes of the MAC, so it's still possible to have an equivalent 24-bit "ID" on ESP32 if you need one. But better to use the full MAC if you can, as the lower 24-bits may collide.)
(chip_id on ESP8266 is still the 3 least significant bytes of the MAC, so it's still possible to have an equivalent 24-bit "ID" on ESP32 if you need one. But better to use the full MAC if you can, as the lower 24-bits may collide.)
Re: How to get ESP-32 Chip ID using SDK?
hello,
I had a query regarding MAC Address ,
1.is MAC Address configurable? as i read in the documentation esp_base_mac_addr_set () can be used to set custom base address.
2.which API to use to get UID of the chip.
I had a query regarding MAC Address ,
1.is MAC Address configurable? as i read in the documentation esp_base_mac_addr_set () can be used to set custom base address.
2.which API to use to get UID of the chip.
Who is online
Users browsing this forum: Baidu [Spider], Google [Bot] and 90 guests