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

Commit 500492e

Browse files
authored
v1.8.1 to fix ESP32 chipID
### Releases v1.8.1 1. Fix chipID and add getChipID(), getChipOUI() for `ESP32` and `WT32_ETH01`
1 parent 1b264d8 commit 500492e

18 files changed

+143
-43
lines changed

README.md

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -251,9 +251,9 @@ This [**Ethernet_Manager** library](https://github.com/khoih-prog/Ethernet_Manag
251251
- [`Adafruit's LittleFS/InternalFS`](www.adafruit.com) for nRF52
252252
16. [`EthernetWebServer library v2.2.2+`](https://github.com/khoih-prog/EthernetWebServer). To install. check [![arduino-library-badge](https://www.ardu-badge.com/badge/EthernetWebServer.svg?)](https://www.ardu-badge.com/EthernetWebServer).
253253
17. [`WebServer_WT32_ETH01 library v1.5.0+`](https://github.com/khoih-prog/WebServer_WT32_ETH01) for WT32_ETH01 boards. To install. check [![arduino-library-badge](https://www.ardu-badge.com/badge/WebServer_WT32_ETH01.svg?)](https://www.ardu-badge.com/WebServer_WT32_ETH01).
254-
18. [`ESP_DoubleResetDetector library v1.3.1+`](https://github.com/khoih-prog/ESP_DoubleResetDetector) for ESP32 and ESP8266. To install. check [![arduino-library-badge](https://www.ardu-badge.com/badge/ESP_DoubleResetDetector.svg?)](https://www.ardu-badge.com/ESP_DoubleResetDetector).
254+
18. [`ESP_DoubleResetDetector library v1.3.2+`](https://github.com/khoih-prog/ESP_DoubleResetDetector) for ESP32 and ESP8266. To install. check [![arduino-library-badge](https://www.ardu-badge.com/badge/ESP_DoubleResetDetector.svg?)](https://www.ardu-badge.com/ESP_DoubleResetDetector).
255255
19. [`DoubleResetDetector_Generic library v1.8.1+`](https://github.com/khoih-prog/DoubleResetDetector_Generic) for other boards (not ESP32 or ESP8266). To install. check [![arduino-library-badge](https://www.ardu-badge.com/badge/DoubleResetDetector_Generic.svg?)](https://www.ardu-badge.com/DoubleResetDetector_Generic).
256-
20. [`LittleFS_esp32 v1.0.6+`](https://github.com/lorol/LITTLEFS) for ESP32-based boards using LittleFS with ESP32 core v1.0.5-. To install, check [![arduino-library-badge](https://www.ardu-badge.com/badge/LittleFS_esp32.svg?)](https://www.ardu-badge.com/LittleFS_esp32). **Notice**: This [`LittleFS_esp32 library`](https://github.com/lorol/LITTLEFS) has been integrated to Arduino [ESP32 core v1.0.6+](https://github.com/espressif/arduino-esp32/tree/master/libraries/LITTLEFS) and you don't need to install it if using ESP32 core v1.0.6+
256+
20. [`LittleFS_esp32 v1.0.6+`](https://github.com/lorol/LITTLEFS) for ESP32-based boards using LittleFS with ESP32 core **v1.0.5-**. To install, check [![arduino-library-badge](https://www.ardu-badge.com/badge/LittleFS_esp32.svg?)](https://www.ardu-badge.com/LittleFS_esp32). **Notice**: This [`LittleFS_esp32 library`](https://github.com/lorol/LITTLEFS) has been integrated to Arduino [ESP32 core v1.0.6+](https://github.com/espressif/arduino-esp32/tree/master/libraries/LITTLEFS) and **you don't need to install it if using ESP32 core v1.0.6+**
257257

258258
---
259259

@@ -1440,7 +1440,7 @@ This is the terminal output of an Adafruit NRF52840_FEATHER board with W5500 Eth
14401440
```
14411441
Start Ethernet_nRF52 on NRF52840_FEATHER
14421442
Ethernet Shield type W5x00 using Ethernet_Generic Library
1443-
Ethernet_Manager v1.8.0
1443+
Ethernet_Manager v1.8.1
14441444
DoubleResetDetector_Generic v1.8.1
14451445
[EWS] =========== USE_ETHERNET_GENERIC ===========
14461446
[EWS] Default SPI pinout:
@@ -1532,7 +1532,7 @@ Pubs Topics = old-mqtt-PubTopic
15321532
```cpp
15331533
Start Ethernet_nRF52 on NRF52840_FEATHER
15341534
Ethernet Shield type : W5x00 using Ethernet_Generic Library
1535-
Ethernet_Manager v1.8.0
1535+
Ethernet_Manager v1.8.1
15361536
DoubleResetDetector_Generic v1.8.1
15371537
[EWS] =========== USE_ETHERNET_GENERIC ===========
15381538
[EWS] Default SPI pinout:
@@ -1715,7 +1715,7 @@ This is the terminal output of an SeeedStudio SAMD21 SEEED_XIAO_M0 board with W5
17151715
```
17161716
Start Ethernet_SAMD on SEEED_XIAO_M0
17171717
Ethernet Shield type : W5x00 using Ethernet Library
1718-
Ethernet_Manager v1.8.0
1718+
Ethernet_Manager v1.8.1
17191719
DoubleResetDetector_Generic v1.8.1
17201720
Flag read = 0xffffffff
17211721
No doubleResetDetected
@@ -1792,7 +1792,7 @@ This is the terminal output of an Arduino SAM DUE board with W5100 Ethernet shie
17921792
```
17931793
Start Ethernet_SAM_DUE on SAM DUE
17941794
Ethernet Shield type : W5x00 using Ethernet_Generic Library
1795-
Ethernet_Manager v1.8.0
1795+
Ethernet_Manager v1.8.1
17961796
DoubleResetDetector_Generic v1.8.1
17971797
Flag read = 0xd0d01234
17981798
doubleResetDetected
@@ -1878,8 +1878,8 @@ If no valid config data are stored in EEPROM, it will switch to `Configuration M
18781878
```
18791879
Start MQTT_ThingStream_Ethernet_Generic using LittleFS on ESP8266_NODEMCU
18801880
Ethernet Shield type : W5x00 using Ethernet_Generic Library
1881-
Ethernet_Manager v1.8.0
1882-
ESP_DoubleResetDetector v1.3.1
1881+
Ethernet_Manager v1.8.1
1882+
ESP_DoubleResetDetector v1.3.2
18831883
=========================
18841884
Currently Used SPI pinout:
18851885
MOSI:13
@@ -1926,8 +1926,8 @@ Enter your credentials (Blynk Servers/Tokens and Port). If you prefer static IP,
19261926
```
19271927
Start MQTT_ThingStream_Ethernet_Generic using LittleFS on ESP8266_NODEMCU
19281928
Ethernet Shield type : W5x00 using Ethernet_Generic Library
1929-
Ethernet_Manager v1.8.0
1930-
ESP_DoubleResetDetector v1.3.1
1929+
Ethernet_Manager v1.8.1
1930+
ESP_DoubleResetDetector v1.3.2
19311931
=========================
19321932
Currently Used SPI pinout:
19331933
MOSI:13
@@ -1986,7 +1986,7 @@ This is the terminal output of NRF52840_FEATHER board with ENC28J60 using Ethern
19861986
```
19871987
Start MQTT_ThingStream_Ethernet_Generic on NRF52840_FEATHER
19881988
Ethernet Shield type : ENC28J60 using EthernetENC Library
1989-
Ethernet_Manager v1.8.0
1989+
Ethernet_Manager v1.8.1
19901990
DoubleResetDetector_Generic v1.8.1
19911991
LittleFS Flag read = 0xd0d01234
19921992
Flag read = 0xd0d01234
@@ -2024,7 +2024,7 @@ esp32-sniffer/12345678/ble
20242024
```
20252025
Start MQTT_ThingStream_Ethernet_Generic on NRF52840_FEATHER
20262026
Ethernet Shield type : ENC28J60 using EthernetENC Library
2027-
Ethernet_Manager v1.8.0
2027+
Ethernet_Manager v1.8.1
20282028
DoubleResetDetector_Generic v1.8.1
20292029
LittleFS Flag read = 0xd0d04321
20302030
Flag read = 0xd0d04321
@@ -2081,7 +2081,7 @@ This is the terminal output of RASPBERRY_PI_PICO board with W5x00 using Ethernet
20812081
```
20822082
Start MQTT_ThingStream_Ethernet_RP2040 on RASPBERRY_PI_PICO
20832083
Ethernet Shield type : W5x00 using Ethernet_Generic Library
2084-
Ethernet_Manager v1.8.0
2084+
Ethernet_Manager v1.8.1
20852085
DoubleResetDetector_Generic v1.8.1
20862086
[EWS] =========== USE_ETHERNET_GENERIC ===========
20872087
[EWS] Default SPI pinout:
@@ -2138,7 +2138,7 @@ esp32-sniffer/12345678/ble
21382138
```
21392139
Start MQTT_ThingStream_Ethernet_RP2040 on RASPBERRY_PI_PICO
21402140
Ethernet Shield type : W5x00 using Ethernet_Generic Library
2141-
Ethernet_Manager v1.8.0
2141+
Ethernet_Manager v1.8.1
21422142
DoubleResetDetector_Generic v1.8.1
21432143
[EWS] =========== USE_ETHERNET_GENERIC ===========
21442144
[EWS] Default SPI pinout:
@@ -2211,7 +2211,7 @@ This is the terminal output of an MBED RASPBERRY_PI_PICO board with W5500 Ethern
22112211
```
22122212
Start Ethernet_RP2040 on MBED RASPBERRY_PI_PICO
22132213
Ethernet Shield type : W5x00 using Ethernet_Generic Library
2214-
Ethernet_Manager v1.8.0
2214+
Ethernet_Manager v1.8.1
22152215
DoubleResetDetector_Generic v1.8.1
22162216
[[EWS] =========== USE_ETHERNET_GENERIC ===========
22172217
[EWS] Default SPI pinout:
@@ -2284,7 +2284,7 @@ HHHH[ETM] h:Updating LittleFS: /fs/etm_config.dat
22842284
```
22852285
Start Ethernet_RP2040 on MBED RASPBERRY_PI_PICO
22862286
Ethernet Shield type : W5x00 using Ethernet_Generic Library
2287-
Ethernet_Manager v1.8.0
2287+
Ethernet_Manager v1.8.1
22882288
DoubleResetDetector_Generic v1.8.1
22892289
[EWS] =========== USE_ETHERNET_GENERIC ===========
22902290
[EWS] Default SPI pinout:
@@ -2354,8 +2354,8 @@ This is the terminal output of WT32-ETH01 board with LAN8720 Ethernet, running c
23542354
Start MQTT_ThingStream_Ethernet_WT32_ETH01 on WT32-ETH01
23552355
Ethernet Shield type : ETH_PHY_LAN8720
23562356
WebServer_WT32_ETH01 v1.5.0
2357-
Ethernet_Manager v1.8.0
2358-
ESP_DoubleResetDetector v1.3.1
2357+
Ethernet_Manager v1.8.1
2358+
ESP_DoubleResetDetector v1.3.2
23592359
[ETM] Set CustomsStyle to : <style>div,input{padding:5px;font-size:1em;}input{width:95%;}body{text-align: center;}button{background-color:blue;color:white;line-height:2.4rem;font-size:1.2rem;width:100%;}fieldset{border-radius:0.3rem;margin:0px;}</style>
23602360
[ETM] Set CustomsHeadElement to : <style>html{filter: invert(10%);}</style>
23612361
[ETM] Set CORS Header to : Your Access-Control-Allow-Origin
@@ -2436,7 +2436,7 @@ This is the terminal output of Teensy 4.1 board with built-in Ethernet, using QN
24362436

24372437
```
24382438
Starting QNEthernet_Teensy on TEENSY 4.1 using QNEthernet
2439-
Ethernet_Manager v1.8.0
2439+
Ethernet_Manager v1.8.1
24402440
DoubleResetDetector_Generic v1.8.1
24412441
[EWS] =========== USE_QN_ETHERNET ===========
24422442
QNEthernet using static IP
@@ -2559,6 +2559,8 @@ Default Credentials and dynamic parameters
25592559
37. Fix `macAddress` bug. Check [Unable so set MAC Address #2](https://github.com/khoih-prog/Ethernet_Manager/issues/2)
25602560
38. Permit setting `macAddress` for supporting Ethernet shields W5x00 and ENC28J60
25612561
39. Add functions relating to `macAddress`
2562+
40. Fix chipID and add getChipID(), getChipOUI() for `ESP32` and `WT32_ETH01`
2563+
25622564

25632565
---
25642566
---

changelog.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414

1515
* [Changelog](#changelog)
16+
* [Releases v1.8.1](#releases-v181)
1617
* [Releases v1.8.0](#releases-v180)
1718
* [Releases v1.7.2](#releases-v172)
1819
* [Releases v1.7.1](#releases-v171)
@@ -33,6 +34,10 @@
3334

3435
## Changelog
3536

37+
### Releases v1.8.1
38+
39+
1. Fix chipID and add getChipID(), getChipOUI() for `ESP32` and `WT32_ETH01`
40+
3641
### Releases v1.8.0
3742

3843
1. Fix `macAddress` bug. Check [Unable so set MAC Address #2](https://github.com/khoih-prog/Ethernet_Manager/issues/2)

keywords.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,14 @@ setCORSHeader KEYWORD2
2626
getCORSHeader KEYWORD2
2727
link_status KEYWORD2
2828

29+
#######################################
30+
31+
getChipID KEYWORD2
32+
getChipOUI KEYWORD2
33+
34+
ESP_getChipId KEYWORD2
35+
ESP_getChipOUI KEYWORD2
36+
2937
#######################################
3038
# Literals (LITERAL1)
3139
#######################################

library.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "Ethernet_Manager",
3-
"version": "1.8.0",
3+
"version": "1.8.1",
44
"keywords": "communication, ethernet, esp8266, esp32, esp32-s2, esp32-c3, QNEthernet, rp2040, nano-rp2040-connect, W5x00, lan8720, SAM-DUE, SAMD, STM32, nRF52, Credentials, config-portal, WT32-ETH01, Double-Reset, MQTT, rpi-pico, ENC28J60, SAMD51, DynamicParameters, dynamic-params, customs-header, Manager",
55
"description": "Simple Ethernet Manager for Teensy, SAM DUE, SAMD, nRF52, ESP32 (including ESP32-S2/C3), ESP8266, RP2040-based Nano_RP2040_Connect, RASPBERRY_PI_PICO, etc. boards. Config data saved in ESP LittleFS, SPIFFS or EEPROM, nRF52 LittleFS, EEPROM, DueFlashStorage or SAMD FlashStorage. For configuring/auto(re)connecting Ethernet W5x00, ENC28J60 and NativeEthernet/QNEthernet at runtime. Use much less memory compared to full-fledge WiFiManager. Config Portal (CP) will be auto-adjusted to match the number of dynamic custom parameters. Optional default Credentials to be autoloaded into CP to use or change instead of manually input. Credentials are saved in LittleFS, (emulated-)EEPROM, FlashStorage_SAMD or DueFlashStorage. New powerful-yet-simple-to-use feature to enable adding dynamic parameters from sketch and input using the same CP. DoubleDetectDetector as well as Virtual Switches feature permits entering CP as requested. Configurable HTML Headers, Customs Style, Head Elements, CORS Header",
66
"authors":
@@ -33,7 +33,7 @@
3333
{
3434
"owner": "khoih-prog",
3535
"name": "ESP_DoubleResetDetector",
36-
"version": ">=1.3.1",
36+
"version": ">=1.3.2",
3737
"platforms": ["espressif8266", "espressif32"]
3838
},
3939
{

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=Ethernet_Manager
2-
version=1.8.0
2+
version=1.8.1
33
author=Khoi Hoang
44
license=MIT
55
maintainer=Khoi Hoang <khoih.prog@gmail.com>

platformio/platformio.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ lib_deps =
4747
; PlatformIO 4.x
4848
; EthernetWebServer@>=2.2.2
4949
; Ethernet_Generic>=2.5.2
50-
; ESP_DoubleResetDetector@>=1.3.1
50+
; ESP_DoubleResetDetector@>=1.3.2
5151
; DoubleResetDetector_Generic@>=1.8.1
5252
; Functional-Vlpp@>=1.0.2
5353
; FlashStorage_SAMD@>=1.3.2
@@ -56,7 +56,7 @@ lib_deps =
5656
; PlatformIO 5.x
5757
khoih-prog/EthernetWebServer@>=2.2.2
5858
khoih-prog/Ethernet_Generic@~2.5.2
59-
khoih-prog/ESP_DoubleResetDetector@>=1.3.1
59+
khoih-prog/ESP_DoubleResetDetector@>=1.3.2
6060
khoih-prog/DoubleResetDetector_Generic@>=1.8.1
6161
khoih-prog/Functional-Vlpp@>=1.0.2
6262
khoih-prog/FlashStorage_SAMD@>=1.3.2

src/Adapters/Ethernet_DUE_Manager.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/Ethernet_Manager
1010
Licensed under MIT license
1111
12-
Version: 1.8.0
12+
Version: 1.8.1
1313
1414
Version Modified By Date Comments
1515
------- ----------- ---------- -----------
@@ -27,6 +27,7 @@
2727
1.7.1 K Hoang 26/01/2022 Update to be compatible with new FlashStorage libraries.
2828
1.7.2 K Hoang 10/04/2022 Use Ethernet_Generic library as default. Support SPI1/SPI2 for RP2040/ESP32
2929
1.8.0 K Hoang 07/09/2022 Fix macAddress bug. Add functions relating to macAddress
30+
1.8.1 K Hoang 09/09/2022 Fix chipID and add getChipOUI() for ESP32
3031
*****************************************************************************************************************************/
3132

3233
#pragma once

src/Adapters/Ethernet_ESP32_Manager.h

Lines changed: 41 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,10 @@
66
to enable easy configuration/reconfiguration of Credentials and autoconnect/autoreconnect of Ethernet.
77
AVR Mega is not supported.
88
9-
Built by Khoi Hoang https://github.com/khoih-prog/Ether
10-
net_Manager
9+
Built by Khoi Hoang https://github.com/khoih-prog/Ethernet_Manager
1110
Licensed under MIT license
1211
13-
Version: 1.8.0
12+
Version: 1.8.1
1413
1514
Version Modified By Date Comments
1615
------- ----------- ---------- -----------
@@ -28,6 +27,7 @@ net_Manager
2827
1.7.1 K Hoang 26/01/2022 Update to be compatible with new FlashStorage libraries.
2928
1.7.2 K Hoang 10/04/2022 Use Ethernet_Generic library as default. Support SPI1/SPI2 for RP2040/ESP32
3029
1.8.0 K Hoang 07/09/2022 Fix macAddress bug. Add functions relating to macAddress
30+
1.8.1 K Hoang 09/09/2022 Fix chipID and add getChipOUI() for ESP32
3131
*****************************************************************************************************************************/
3232

3333
#pragma once
@@ -135,7 +135,16 @@ DoubleResetDetector* drd;
135135
///////// NEW for DRD /////////////
136136

137137
#include <esp_wifi.h>
138-
#define ESP_getChipId() ((uint32_t)ESP.getEfuseMac())
138+
139+
static uint32_t getChipID();
140+
static uint32_t getChipOUI();
141+
142+
#if defined(ESP_getChipId)
143+
#undef ESP_getChipId
144+
#endif
145+
146+
#define ESP_getChipId() getChipID()
147+
#define ESP_getChipOUI() getChipOUI()
139148

140149

141150
//NEW
@@ -224,6 +233,34 @@ const char WM_HTTP_CORS_ALLOW_ALL[] PROGMEM = "*";
224233

225234
//////////////////////////////////////////
226235

236+
static uint32_t getChipID()
237+
{
238+
uint64_t chipId64 = 0;
239+
240+
for (int i = 0; i < 6; i++)
241+
{
242+
chipId64 |= ( ( (uint64_t) ESP.getEfuseMac() >> (40 - (i * 8)) ) & 0xff ) << (i * 8);
243+
}
244+
245+
return (uint32_t) (chipId64 & 0xFFFFFF);
246+
}
247+
248+
//////////////////////////////////////////
249+
250+
static uint32_t getChipOUI()
251+
{
252+
uint64_t chipId64 = 0;
253+
254+
for (int i = 0; i < 6; i++)
255+
{
256+
chipId64 |= ( ( (uint64_t) ESP.getEfuseMac() >> (40 - (i * 8)) ) & 0xff ) << (i * 8);
257+
}
258+
259+
return (uint32_t) (chipId64 >> 24);
260+
}
261+
262+
//////////////////////////////////////////
263+
227264
class Ethernet_Manager
228265
{
229266

src/Adapters/Ethernet_ESP8266_Manager.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/Ethernet_Manager
1010
Licensed under MIT license
1111
12-
Version: 1.8.0
12+
Version: 1.8.1
1313
1414
Version Modified By Date Comments
1515
------- ----------- ---------- -----------
@@ -27,6 +27,7 @@
2727
1.7.1 K Hoang 26/01/2022 Update to be compatible with new FlashStorage libraries.
2828
1.7.2 K Hoang 10/04/2022 Use Ethernet_Generic library as default. Support SPI1/SPI2 for RP2040/ESP32
2929
1.8.0 K Hoang 07/09/2022 Fix macAddress bug. Add functions relating to macAddress
30+
1.8.1 K Hoang 09/09/2022 Fix chipID and add getChipOUI() for ESP32
3031
*****************************************************************************************************************************/
3132

3233
#pragma once

src/Adapters/Ethernet_MBED_RP2040_Manager.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/Ethernet_Manager
1010
Licensed under MIT license
1111
12-
Version: 1.8.0
12+
Version: 1.8.1
1313
1414
Version Modified By Date Comments
1515
------- ----------- ---------- -----------
@@ -27,6 +27,7 @@
2727
1.7.1 K Hoang 26/01/2022 Update to be compatible with new FlashStorage libraries.
2828
1.7.2 K Hoang 10/04/2022 Use Ethernet_Generic library as default. Support SPI1/SPI2 for RP2040/ESP32
2929
1.8.0 K Hoang 07/09/2022 Fix macAddress bug. Add functions relating to macAddress
30+
1.8.1 K Hoang 09/09/2022 Fix chipID and add getChipOUI() for ESP32
3031
*****************************************************************************************************************************/
3132

3233
#pragma once

0 commit comments

Comments
 (0)