iotappstory / ESP-Library

Software Distribution and Management Over the Air
GNU Lesser General Public License v2.1
124 stars 35 forks source link

ESP.getEfuseMac() doesn't return a useable value for ChipId on ESP32 #193

Open arcticlinux opened 2 years ago

arcticlinux commented 2 years ago

from config.h

#define ESP_GETCHIPID (uint32_t)ESP.getEfuseMac()

Due to the way the value is returned on ESP32, you basically end up getting the first three digits of the Mac address the way it's used in the examples chipId.substring(chipId.length()-3), and for me that meant that I was getting the exact same value on two different boards.

Here is some updated example code: https://github.com/cweinhofer/arduino-esp32/blob/master/libraries/ESP32/examples/ChipID/GetChipID/GetChipID.ino

Issues that mentioned the problem, and provided the example code. https://github.com/espressif/arduino-esp32/issues/3859 https://github.com/espressif/arduino-esp32/pull/4070

I can provide a pull request in the near future.