Skip to content
This repository was archived by the owner on Feb 4, 2023. It is now read-only.

Commit 7349768

Browse files
authored
v1.9.0 to fix ESP32 chipID, etc.
### Release v1.9.0 1. Fix ESP32 chipID. Check [Help for storing variables in memory (non-volatile) #87](khoih-prog/ESP_WiFiManager#87 (comment)) 2. Add ESP32 getChipID() and getChipOUI() functions 3. Remove dependency on `LittleFS_esp32` library to prevent PIO error when using new ESP32 core v1.0.6+ 4. Remove unavailable items from depends field of `library.properties`, such as `ESP Async WebServer`,`ESP AsyncTCP` and `AsyncTCP`.
1 parent fc0c305 commit 7349768

File tree

2 files changed

+57
-7
lines changed

2 files changed

+57
-7
lines changed

src/ESPAsync_WiFiManager_Lite.h

Lines changed: 55 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
Built by Khoi Hoang https://github.com/khoih-prog/ESPAsync_WiFiManager_Lite
1010
Licensed under MIT license
1111
12-
Version: 1.8.2
12+
Version: 1.9.0
1313
1414
Version Modified By Date Comments
1515
------- ----------- ---------- -----------
@@ -25,6 +25,7 @@
2525
1.8.0 K Hoang 10/02/2022 Add support to new ESP32-S3
2626
1.8.1 K Hoang 11/02/2022 Add LittleFS support to ESP32-C3. Use core LittleFS instead of Lorol's LITTLEFS for v2.0.0+
2727
1.8.2 K Hoang 21/02/2022 Optional Board_Name in Menu. Optimize code by using passing by reference
28+
1.9.0 K Hoang 09/09/2022 Fix ESP32 chipID and add getChipOUI()
2829
*****************************************************************************************************************************/
2930

3031
#pragma once
@@ -55,13 +56,13 @@
5556
#endif
5657

5758
#ifndef ESP_ASYNC_WIFI_MANAGER_LITE_VERSION
58-
#define ESP_ASYNC_WIFI_MANAGER_LITE_VERSION "ESPAsync_WiFiManager_Lite v1.8.2"
59+
#define ESP_ASYNC_WIFI_MANAGER_LITE_VERSION "ESPAsync_WiFiManager_Lite v1.9.0"
5960

6061
#define ESP_ASYNC_WIFI_MANAGER_LITE_VERSION_MAJOR 1
61-
#define ESP_ASYNC_WIFI_MANAGER_LITE_VERSION_MINOR 8
62-
#define ESP_ASYNC_WIFI_MANAGER_LITE_VERSION_PATCH 2
62+
#define ESP_ASYNC_WIFI_MANAGER_LITE_VERSION_MINOR 9
63+
#define ESP_ASYNC_WIFI_MANAGER_LITE_VERSION_PATCH 0
6364

64-
#define ESP_ASYNC_WIFI_MANAGER_LITE_VERSION_INT 1008002
65+
#define ESP_ASYNC_WIFI_MANAGER_LITE_VERSION_INT 1009000
6566
#endif
6667

6768
#ifdef ESP8266
@@ -178,11 +179,27 @@
178179
}
179180

180181
#define ESP_getChipId() (ESP.getChipId())
182+
181183
#else //ESP32
184+
182185
#include <esp_wifi.h>
183-
#define ESP_getChipId() ((uint32_t)ESP.getEfuseMac())
186+
187+
uint32_t getChipID();
188+
uint32_t getChipOUI();
189+
190+
#if defined(ESP_getChipId)
191+
#undef ESP_getChipId
192+
#endif
193+
194+
#if defined(ESP_getChipOUI)
195+
#undef ESP_getChipOUI
196+
#endif
197+
198+
#define ESP_getChipId() getChipID()
199+
#define ESP_getChipOUI() getChipOUI()
184200
#endif
185201

202+
186203
#include <ESPAsync_WiFiManager_Lite_Debug.h>
187204

188205
//////////////////////////////////////////////
@@ -464,6 +481,38 @@ const char WM_HTTP_CORS_ALLOW_ALL[] PROGMEM = "*";
464481

465482
//////////////////////////////////////////
466483

484+
#if (ESP32)
485+
486+
uint32_t getChipID()
487+
{
488+
uint64_t chipId64 = 0;
489+
490+
for (int i = 0; i < 6; i++)
491+
{
492+
chipId64 |= ( ( (uint64_t) ESP.getEfuseMac() >> (40 - (i * 8)) ) & 0xff ) << (i * 8);
493+
}
494+
495+
return (uint32_t) (chipId64 & 0xFFFFFF);
496+
}
497+
498+
//////////////////////////////////////////
499+
500+
uint32_t getChipOUI()
501+
{
502+
uint64_t chipId64 = 0;
503+
504+
for (int i = 0; i < 6; i++)
505+
{
506+
chipId64 |= ( ( (uint64_t) ESP.getEfuseMac() >> (40 - (i * 8)) ) & 0xff ) << (i * 8);
507+
}
508+
509+
return (uint32_t) (chipId64 >> 24);
510+
}
511+
512+
#endif
513+
514+
//////////////////////////////////////////
515+
467516
String IPAddressToString(const IPAddress& _address)
468517
{
469518
String str = String(_address[0]);

src/ESPAsync_WiFiManager_Lite_Debug.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
Built by Khoi Hoang https://github.com/khoih-prog/ESPAsync_WiFiManager_Lite
1010
Licensed under MIT license
1111
12-
Version: 1.8.2
12+
Version: 1.9.0
1313
1414
Version Modified By Date Comments
1515
------- ----------- ---------- -----------
@@ -25,6 +25,7 @@
2525
1.8.0 K Hoang 10/02/2022 Add support to new ESP32-S3
2626
1.8.1 K Hoang 11/02/2022 Add LittleFS support to ESP32-C3. Use core LittleFS instead of Lorol's LITTLEFS for v2.0.0+
2727
1.8.2 K Hoang 21/02/2022 Optional Board_Name in Menu. Optimize code by using passing by reference
28+
1.9.0 K Hoang 09/09/2022 Fix ESP32 chipID and add getChipOUI()
2829
*****************************************************************************************************************************/
2930

3031
#ifndef ESPAsync_WiFiManager_Lite_Debug_h

0 commit comments

Comments
 (0)