This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
en:iot-open:practical:hardware:sut:esp32:iot_1 [2024/03/26 18:10] – [Result validation] pczekalski | en:iot-open:practical:hardware:sut:esp32:iot_1 [2024/03/26 18:21] (current) – [Result validation] pczekalski | ||
---|---|---|---|
Line 42: | Line 42: | ||
==== Result validation ==== | ==== Result validation ==== | ||
Using another node should change the MAC read. Book another device and discover its MAC. | Using another node should change the MAC read. Book another device and discover its MAC. | ||
+ | |||
+ | ===== FAQ ===== | ||
+ | **Can I change MAC?**: Actually, yes, you can. It is not advised, however, because you may accidentally generate an overlapping address that will collide with another device in the same network. You must first explicitly configure the ESP32 chip to work as an AP (Access Point, Server) or STA (WiFi Client) to do it. Sample stub code (for STA) may look as follows: | ||
+ | <code c> | ||
+ | #include < | ||
+ | #include < | ||
+ | |||
+ | uint8_t newMAC[] = {0xDE, 0xAD, 0xBE, 0xEF, 0xCA, 0xFE}; //Array of bytes with new MAC | ||
+ | void setup() | ||
+ | { | ||
+ | WiFi.mode(WIFI_STA); | ||
+ | esp_wifi_set_mac(WIFI_IF_STA, | ||
+ | } | ||
+ | </ | ||
<WRAP noprint> | <WRAP noprint> |