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

Commit

Permalink
v1.8.1 to fix ESP32 chipID
Browse files Browse the repository at this point in the history
### Releases v1.8.1

1. Fix chipID and add getChipID(), getChipOUI() for `ESP32` and `WT32_ETH01`
  • Loading branch information
khoih-prog committed Sep 10, 2022
1 parent 1b264d8 commit 500492e
Show file tree
Hide file tree
Showing 18 changed files with 143 additions and 43 deletions.
40 changes: 21 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -251,9 +251,9 @@ This [**Ethernet_Manager** library](https://github.com/khoih-prog/Ethernet_Manag
- [`Adafruit's LittleFS/InternalFS`](www.adafruit.com) for nRF52
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).
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).
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).
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).
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).
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+
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+**

---

Expand Down Expand Up @@ -1440,7 +1440,7 @@ This is the terminal output of an Adafruit NRF52840_FEATHER board with W5500 Eth
```
Start Ethernet_nRF52 on NRF52840_FEATHER
Ethernet Shield type W5x00 using Ethernet_Generic Library
Ethernet_Manager v1.8.0
Ethernet_Manager v1.8.1
DoubleResetDetector_Generic v1.8.1
[EWS] =========== USE_ETHERNET_GENERIC ===========
[EWS] Default SPI pinout:
Expand Down Expand Up @@ -1532,7 +1532,7 @@ Pubs Topics = old-mqtt-PubTopic
```cpp
Start Ethernet_nRF52 on NRF52840_FEATHER
Ethernet Shield type : W5x00 using Ethernet_Generic Library
Ethernet_Manager v1.8.0
Ethernet_Manager v1.8.1
DoubleResetDetector_Generic v1.8.1
[EWS] =========== USE_ETHERNET_GENERIC ===========
[EWS] Default SPI pinout:
Expand Down Expand Up @@ -1715,7 +1715,7 @@ This is the terminal output of an SeeedStudio SAMD21 SEEED_XIAO_M0 board with W5
```
Start Ethernet_SAMD on SEEED_XIAO_M0
Ethernet Shield type : W5x00 using Ethernet Library
Ethernet_Manager v1.8.0
Ethernet_Manager v1.8.1
DoubleResetDetector_Generic v1.8.1
Flag read = 0xffffffff
No doubleResetDetected
Expand Down Expand Up @@ -1792,7 +1792,7 @@ This is the terminal output of an Arduino SAM DUE board with W5100 Ethernet shie
```
Start Ethernet_SAM_DUE on SAM DUE
Ethernet Shield type : W5x00 using Ethernet_Generic Library
Ethernet_Manager v1.8.0
Ethernet_Manager v1.8.1
DoubleResetDetector_Generic v1.8.1
Flag read = 0xd0d01234
doubleResetDetected
Expand Down Expand Up @@ -1878,8 +1878,8 @@ If no valid config data are stored in EEPROM, it will switch to `Configuration M
```
Start MQTT_ThingStream_Ethernet_Generic using LittleFS on ESP8266_NODEMCU
Ethernet Shield type : W5x00 using Ethernet_Generic Library
Ethernet_Manager v1.8.0
ESP_DoubleResetDetector v1.3.1
Ethernet_Manager v1.8.1
ESP_DoubleResetDetector v1.3.2
=========================
Currently Used SPI pinout:
MOSI:13
Expand Down Expand Up @@ -1926,8 +1926,8 @@ Enter your credentials (Blynk Servers/Tokens and Port). If you prefer static IP,
```
Start MQTT_ThingStream_Ethernet_Generic using LittleFS on ESP8266_NODEMCU
Ethernet Shield type : W5x00 using Ethernet_Generic Library
Ethernet_Manager v1.8.0
ESP_DoubleResetDetector v1.3.1
Ethernet_Manager v1.8.1
ESP_DoubleResetDetector v1.3.2
=========================
Currently Used SPI pinout:
MOSI:13
Expand Down Expand Up @@ -1986,7 +1986,7 @@ This is the terminal output of NRF52840_FEATHER board with ENC28J60 using Ethern
```
Start MQTT_ThingStream_Ethernet_Generic on NRF52840_FEATHER
Ethernet Shield type : ENC28J60 using EthernetENC Library
Ethernet_Manager v1.8.0
Ethernet_Manager v1.8.1
DoubleResetDetector_Generic v1.8.1
LittleFS Flag read = 0xd0d01234
Flag read = 0xd0d01234
Expand Down Expand Up @@ -2024,7 +2024,7 @@ esp32-sniffer/12345678/ble
```
Start MQTT_ThingStream_Ethernet_Generic on NRF52840_FEATHER
Ethernet Shield type : ENC28J60 using EthernetENC Library
Ethernet_Manager v1.8.0
Ethernet_Manager v1.8.1
DoubleResetDetector_Generic v1.8.1
LittleFS Flag read = 0xd0d04321
Flag read = 0xd0d04321
Expand Down Expand Up @@ -2081,7 +2081,7 @@ This is the terminal output of RASPBERRY_PI_PICO board with W5x00 using Ethernet
```
Start MQTT_ThingStream_Ethernet_RP2040 on RASPBERRY_PI_PICO
Ethernet Shield type : W5x00 using Ethernet_Generic Library
Ethernet_Manager v1.8.0
Ethernet_Manager v1.8.1
DoubleResetDetector_Generic v1.8.1
[EWS] =========== USE_ETHERNET_GENERIC ===========
[EWS] Default SPI pinout:
Expand Down Expand Up @@ -2138,7 +2138,7 @@ esp32-sniffer/12345678/ble
```
Start MQTT_ThingStream_Ethernet_RP2040 on RASPBERRY_PI_PICO
Ethernet Shield type : W5x00 using Ethernet_Generic Library
Ethernet_Manager v1.8.0
Ethernet_Manager v1.8.1
DoubleResetDetector_Generic v1.8.1
[EWS] =========== USE_ETHERNET_GENERIC ===========
[EWS] Default SPI pinout:
Expand Down Expand Up @@ -2211,7 +2211,7 @@ This is the terminal output of an MBED RASPBERRY_PI_PICO board with W5500 Ethern
```
Start Ethernet_RP2040 on MBED RASPBERRY_PI_PICO
Ethernet Shield type : W5x00 using Ethernet_Generic Library
Ethernet_Manager v1.8.0
Ethernet_Manager v1.8.1
DoubleResetDetector_Generic v1.8.1
[[EWS] =========== USE_ETHERNET_GENERIC ===========
[EWS] Default SPI pinout:
Expand Down Expand Up @@ -2284,7 +2284,7 @@ HHHH[ETM] h:Updating LittleFS: /fs/etm_config.dat
```
Start Ethernet_RP2040 on MBED RASPBERRY_PI_PICO
Ethernet Shield type : W5x00 using Ethernet_Generic Library
Ethernet_Manager v1.8.0
Ethernet_Manager v1.8.1
DoubleResetDetector_Generic v1.8.1
[EWS] =========== USE_ETHERNET_GENERIC ===========
[EWS] Default SPI pinout:
Expand Down Expand Up @@ -2354,8 +2354,8 @@ This is the terminal output of WT32-ETH01 board with LAN8720 Ethernet, running c
Start MQTT_ThingStream_Ethernet_WT32_ETH01 on WT32-ETH01
Ethernet Shield type : ETH_PHY_LAN8720
WebServer_WT32_ETH01 v1.5.0
Ethernet_Manager v1.8.0
ESP_DoubleResetDetector v1.3.1
Ethernet_Manager v1.8.1
ESP_DoubleResetDetector v1.3.2
[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>
[ETM] Set CustomsHeadElement to : <style>html{filter: invert(10%);}</style>
[ETM] Set CORS Header to : Your Access-Control-Allow-Origin
Expand Down Expand Up @@ -2436,7 +2436,7 @@ This is the terminal output of Teensy 4.1 board with built-in Ethernet, using QN

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


---
---
Expand Down
5 changes: 5 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@


* [Changelog](#changelog)
* [Releases v1.8.1](#releases-v181)
* [Releases v1.8.0](#releases-v180)
* [Releases v1.7.2](#releases-v172)
* [Releases v1.7.1](#releases-v171)
Expand All @@ -33,6 +34,10 @@

## Changelog

### Releases v1.8.1

1. Fix chipID and add getChipID(), getChipOUI() for `ESP32` and `WT32_ETH01`

### Releases v1.8.0

1. Fix `macAddress` bug. Check [Unable so set MAC Address #2](https://github.com/khoih-prog/Ethernet_Manager/issues/2)
Expand Down
8 changes: 8 additions & 0 deletions keywords.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@ setCORSHeader KEYWORD2
getCORSHeader KEYWORD2
link_status KEYWORD2

#######################################

getChipID KEYWORD2
getChipOUI KEYWORD2

ESP_getChipId KEYWORD2
ESP_getChipOUI KEYWORD2

#######################################
# Literals (LITERAL1)
#######################################
Expand Down
4 changes: 2 additions & 2 deletions library.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Ethernet_Manager",
"version": "1.8.0",
"version": "1.8.1",
"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",
"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",
"authors":
Expand Down Expand Up @@ -33,7 +33,7 @@
{
"owner": "khoih-prog",
"name": "ESP_DoubleResetDetector",
"version": ">=1.3.1",
"version": ">=1.3.2",
"platforms": ["espressif8266", "espressif32"]
},
{
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=Ethernet_Manager
version=1.8.0
version=1.8.1
author=Khoi Hoang
license=MIT
maintainer=Khoi Hoang <khoih.prog@gmail.com>
Expand Down
4 changes: 2 additions & 2 deletions platformio/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ lib_deps =
; PlatformIO 4.x
; EthernetWebServer@>=2.2.2
; Ethernet_Generic>=2.5.2
; ESP_DoubleResetDetector@>=1.3.1
; ESP_DoubleResetDetector@>=1.3.2
; DoubleResetDetector_Generic@>=1.8.1
; Functional-Vlpp@>=1.0.2
; FlashStorage_SAMD@>=1.3.2
Expand All @@ -56,7 +56,7 @@ lib_deps =
; PlatformIO 5.x
khoih-prog/EthernetWebServer@>=2.2.2
khoih-prog/Ethernet_Generic@~2.5.2
khoih-prog/ESP_DoubleResetDetector@>=1.3.1
khoih-prog/ESP_DoubleResetDetector@>=1.3.2
khoih-prog/DoubleResetDetector_Generic@>=1.8.1
khoih-prog/Functional-Vlpp@>=1.0.2
khoih-prog/FlashStorage_SAMD@>=1.3.2
Expand Down
3 changes: 2 additions & 1 deletion src/Adapters/Ethernet_DUE_Manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
Built by Khoi Hoang https://github.com/khoih-prog/Ethernet_Manager
Licensed under MIT license
Version: 1.8.0
Version: 1.8.1
Version Modified By Date Comments
------- ----------- ---------- -----------
Expand All @@ -27,6 +27,7 @@
1.7.1 K Hoang 26/01/2022 Update to be compatible with new FlashStorage libraries.
1.7.2 K Hoang 10/04/2022 Use Ethernet_Generic library as default. Support SPI1/SPI2 for RP2040/ESP32
1.8.0 K Hoang 07/09/2022 Fix macAddress bug. Add functions relating to macAddress
1.8.1 K Hoang 09/09/2022 Fix chipID and add getChipOUI() for ESP32
*****************************************************************************************************************************/

#pragma once
Expand Down
45 changes: 41 additions & 4 deletions src/Adapters/Ethernet_ESP32_Manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@
to enable easy configuration/reconfiguration of Credentials and autoconnect/autoreconnect of Ethernet.
AVR Mega is not supported.
Built by Khoi Hoang https://github.com/khoih-prog/Ether
net_Manager
Built by Khoi Hoang https://github.com/khoih-prog/Ethernet_Manager
Licensed under MIT license
Version: 1.8.0
Version: 1.8.1
Version Modified By Date Comments
------- ----------- ---------- -----------
Expand All @@ -28,6 +27,7 @@ net_Manager
1.7.1 K Hoang 26/01/2022 Update to be compatible with new FlashStorage libraries.
1.7.2 K Hoang 10/04/2022 Use Ethernet_Generic library as default. Support SPI1/SPI2 for RP2040/ESP32
1.8.0 K Hoang 07/09/2022 Fix macAddress bug. Add functions relating to macAddress
1.8.1 K Hoang 09/09/2022 Fix chipID and add getChipOUI() for ESP32
*****************************************************************************************************************************/

#pragma once
Expand Down Expand Up @@ -135,7 +135,16 @@ DoubleResetDetector* drd;
///////// NEW for DRD /////////////

#include <esp_wifi.h>
#define ESP_getChipId() ((uint32_t)ESP.getEfuseMac())

static uint32_t getChipID();
static uint32_t getChipOUI();

#if defined(ESP_getChipId)
#undef ESP_getChipId
#endif

#define ESP_getChipId() getChipID()
#define ESP_getChipOUI() getChipOUI()


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

//////////////////////////////////////////

static uint32_t getChipID()
{
uint64_t chipId64 = 0;

for (int i = 0; i < 6; i++)
{
chipId64 |= ( ( (uint64_t) ESP.getEfuseMac() >> (40 - (i * 8)) ) & 0xff ) << (i * 8);
}

return (uint32_t) (chipId64 & 0xFFFFFF);
}

//////////////////////////////////////////

static uint32_t getChipOUI()
{
uint64_t chipId64 = 0;

for (int i = 0; i < 6; i++)
{
chipId64 |= ( ( (uint64_t) ESP.getEfuseMac() >> (40 - (i * 8)) ) & 0xff ) << (i * 8);
}

return (uint32_t) (chipId64 >> 24);
}

//////////////////////////////////////////

class Ethernet_Manager
{

Expand Down
3 changes: 2 additions & 1 deletion src/Adapters/Ethernet_ESP8266_Manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
Built by Khoi Hoang https://github.com/khoih-prog/Ethernet_Manager
Licensed under MIT license
Version: 1.8.0
Version: 1.8.1
Version Modified By Date Comments
------- ----------- ---------- -----------
Expand All @@ -27,6 +27,7 @@
1.7.1 K Hoang 26/01/2022 Update to be compatible with new FlashStorage libraries.
1.7.2 K Hoang 10/04/2022 Use Ethernet_Generic library as default. Support SPI1/SPI2 for RP2040/ESP32
1.8.0 K Hoang 07/09/2022 Fix macAddress bug. Add functions relating to macAddress
1.8.1 K Hoang 09/09/2022 Fix chipID and add getChipOUI() for ESP32
*****************************************************************************************************************************/

#pragma once
Expand Down
3 changes: 2 additions & 1 deletion src/Adapters/Ethernet_MBED_RP2040_Manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
Built by Khoi Hoang https://github.com/khoih-prog/Ethernet_Manager
Licensed under MIT license
Version: 1.8.0
Version: 1.8.1
Version Modified By Date Comments
------- ----------- ---------- -----------
Expand All @@ -27,6 +27,7 @@
1.7.1 K Hoang 26/01/2022 Update to be compatible with new FlashStorage libraries.
1.7.2 K Hoang 10/04/2022 Use Ethernet_Generic library as default. Support SPI1/SPI2 for RP2040/ESP32
1.8.0 K Hoang 07/09/2022 Fix macAddress bug. Add functions relating to macAddress
1.8.1 K Hoang 09/09/2022 Fix chipID and add getChipOUI() for ESP32
*****************************************************************************************************************************/

#pragma once
Expand Down
3 changes: 2 additions & 1 deletion src/Adapters/Ethernet_NRF52_Manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
Built by Khoi Hoang https://github.com/khoih-prog/Ethernet_Manager
Licensed under MIT license
Version: 1.8.0
Version: 1.8.1
Version Modified By Date Comments
------- ----------- ---------- -----------
Expand All @@ -27,6 +27,7 @@
1.7.1 K Hoang 26/01/2022 Update to be compatible with new FlashStorage libraries.
1.7.2 K Hoang 10/04/2022 Use Ethernet_Generic library as default. Support SPI1/SPI2 for RP2040/ESP32
1.8.0 K Hoang 07/09/2022 Fix macAddress bug. Add functions relating to macAddress
1.8.1 K Hoang 09/09/2022 Fix chipID and add getChipOUI() for ESP32
*****************************************************************************************************************************/

#pragma once
Expand Down
3 changes: 2 additions & 1 deletion src/Adapters/Ethernet_RP2040_Manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
Built by Khoi Hoang https://github.com/khoih-prog/Ethernet_Manager
Licensed under MIT license
Version: 1.8.0
Version: 1.8.1
Version Modified By Date Comments
------- ----------- ---------- -----------
Expand All @@ -27,6 +27,7 @@
1.7.1 K Hoang 26/01/2022 Update to be compatible with new FlashStorage libraries.
1.7.2 K Hoang 10/04/2022 Use Ethernet_Generic library as default. Support SPI1/SPI2 for RP2040/ESP32
1.8.0 K Hoang 07/09/2022 Fix macAddress bug. Add functions relating to macAddress
1.8.1 K Hoang 09/09/2022 Fix chipID and add getChipOUI() for ESP32
*****************************************************************************************************************************/

#pragma once
Expand Down
Loading

0 comments on commit 500492e

Please sign in to comment.