diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 24ecec7..bea3174 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -16,7 +16,7 @@ Please ensure to specify the following: * Arduino IDE version (e.g. 1.8.19) or Platform.io version * Board Type (e.g. ESP32S3_DEV, ESP32S2_DEV, ESP32C3_DEV) -* Board Core Version (e.g. ESP32 core v2.0.5) +* Board Core Version (e.g. ESP32 core v2.0.6) * Contextual information (e.g. what you were trying to achieve) * Simplest possible steps to reproduce * Anything that might be relevant in your opinion, such as: @@ -32,7 +32,7 @@ Please be educated, civilized and constructive. Disrespective posts against [Git ``` Arduino IDE version: 1.8.19 ESP32S3_DEV board -ESP32 core v2.0.5 +ESP32 core v2.0.6 OS: Ubuntu 20.04 LTS Linux xy-Inspiron-3593 5.15.0-56-generic #62~20.04.1-Ubuntu SMP Tue Nov 22 21:24:20 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux diff --git a/Images/ESP32S2_DEV.png b/Images/ESP32S2_DEV.png new file mode 100644 index 0000000..b73e4d0 Binary files /dev/null and b/Images/ESP32S2_DEV.png differ diff --git a/Images/ESP32_C3_DevKitC_02.png b/Images/ESP32_C3_DevKitC_02.png new file mode 100644 index 0000000..1189334 Binary files /dev/null and b/Images/ESP32_C3_DevKitC_02.png differ diff --git a/changelog.md b/changelog.md index c12fdab..b7dd967 100644 --- a/changelog.md +++ b/changelog.md @@ -16,6 +16,7 @@ ## Table of contents * [Changelog](#changelog) + * [Releases v1.1.0](#releases-v110) * [Releases v1.0.0](#releases-v100) @@ -25,6 +26,10 @@ ## Changelog +#### Releases v1.1.0 + +1. Add support to `ESP32_S2/C3` boards using `LwIP ENC28J60 Ethernet` + #### Releases v1.0.0 1. Initial coding to port [ESPAsync_WiFiManager](https://github.com/khoih-prog/ESPAsync_WiFiManager) to ESP32_S3 boards using `LwIP ENC28J60 Ethernet`. diff --git a/examples/Async_ConfigOnDoubleReset/Async_ConfigOnDoubleReset.ino b/examples/Async_ConfigOnDoubleReset/Async_ConfigOnDoubleReset.ino index 3109ba8..ef015c6 100644 --- a/examples/Async_ConfigOnDoubleReset/Async_ConfigOnDoubleReset.ino +++ b/examples/Async_ConfigOnDoubleReset/Async_ConfigOnDoubleReset.ino @@ -69,10 +69,11 @@ byte mac[][NUMBER_OF_MAC] = ////////////////////////////////////////////////////////// +// For ESP32-S3 // Optional values to override default settings // Don't change unless you know what you're doing //#define ETH_SPI_HOST SPI3_HOST -//#define SPI_CLOCK_MHZ 25 +//#define SPI_CLOCK_MHZ 8 // Must connect INT to GPIOxx or not working //#define INT_GPIO 4 @@ -82,6 +83,20 @@ byte mac[][NUMBER_OF_MAC] = //#define SCK_GPIO 12 //#define CS_GPIO 10 +// For ESP32_C3 +// Optional values to override default settings +// Don't change unless you know what you're doing +//#define ETH_SPI_HOST SPI2_HOST +//#define SPI_CLOCK_MHZ 8 + +// Must connect INT to GPIOxx or not working +//#define INT_GPIO 10 + +//#define MISO_GPIO 5 +//#define MOSI_GPIO 6 +//#define SCK_GPIO 4 +//#define CS_GPIO 7 + ////////////////////////////////////////////////////////// #include @@ -471,6 +486,7 @@ void saveConfigData() void beginEthernet() { LOGWARN(F("Default SPI pinout:")); + LOGWARN1(F("SPI_HOST:"), ETH_SPI_HOST); LOGWARN1(F("MOSI:"), MOSI_GPIO); LOGWARN1(F("MISO:"), MISO_GPIO); LOGWARN1(F("SCK:"), SCK_GPIO); @@ -490,8 +506,8 @@ void beginEthernet() //bool begin(int MISO_GPIO, int MOSI_GPIO, int SCLK_GPIO, int CS_GPIO, int INT_GPIO, int SPI_CLOCK_MHZ, // int SPI_HOST, uint8_t *ENC28J60_Mac = ENC28J60_Default_Mac); - //ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, SPI_HOST ); - ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, SPI_HOST, mac[index] ); + //ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, ETH_SPI_HOST ); + ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, ETH_SPI_HOST, mac[index] ); } void initEthernet() @@ -589,14 +605,11 @@ void setup() AsyncESP32_SC_ENC_manager.setCORSHeader("Your Access-Control-Allow-Origin"); #endif - bool configDataLoaded = false; - if (loadConfigData()) { - configDataLoaded = true; - - AsyncESP32_SC_ENC_manager.setConfigPortalTimeout( - 120); //If no access point name has been previously entered disable timeout. + //If no access point name has been previously entered disable timeout. + AsyncESP32_SC_ENC_manager.setConfigPortalTimeout(120); + Serial.println(F("Got stored Credentials. Timeout 120s for Config Portal")); #if USE_ESP_ETH_MANAGER_NTP diff --git a/examples/Async_ConfigOnDoubleReset_TZ/Async_ConfigOnDoubleReset_TZ.ino b/examples/Async_ConfigOnDoubleReset_TZ/Async_ConfigOnDoubleReset_TZ.ino index 1786faf..5d1cc42 100644 --- a/examples/Async_ConfigOnDoubleReset_TZ/Async_ConfigOnDoubleReset_TZ.ino +++ b/examples/Async_ConfigOnDoubleReset_TZ/Async_ConfigOnDoubleReset_TZ.ino @@ -69,10 +69,11 @@ byte mac[][NUMBER_OF_MAC] = ////////////////////////////////////////////////////////// +// For ESP32-S3 // Optional values to override default settings // Don't change unless you know what you're doing //#define ETH_SPI_HOST SPI3_HOST -//#define SPI_CLOCK_MHZ 25 +//#define SPI_CLOCK_MHZ 8 // Must connect INT to GPIOxx or not working //#define INT_GPIO 4 @@ -82,6 +83,20 @@ byte mac[][NUMBER_OF_MAC] = //#define SCK_GPIO 12 //#define CS_GPIO 10 +// For ESP32_C3 +// Optional values to override default settings +// Don't change unless you know what you're doing +//#define ETH_SPI_HOST SPI2_HOST +//#define SPI_CLOCK_MHZ 8 + +// Must connect INT to GPIOxx or not working +//#define INT_GPIO 10 + +//#define MISO_GPIO 5 +//#define MOSI_GPIO 6 +//#define SCK_GPIO 4 +//#define CS_GPIO 7 + ////////////////////////////////////////////////////////// #include @@ -494,6 +509,7 @@ void saveConfigData() void beginEthernet() { LOGWARN(F("Default SPI pinout:")); + LOGWARN1(F("SPI_HOST:"), ETH_SPI_HOST); LOGWARN1(F("MOSI:"), MOSI_GPIO); LOGWARN1(F("MISO:"), MISO_GPIO); LOGWARN1(F("SCK:"), SCK_GPIO); @@ -513,8 +529,8 @@ void beginEthernet() //bool begin(int MISO_GPIO, int MOSI_GPIO, int SCLK_GPIO, int CS_GPIO, int INT_GPIO, int SPI_CLOCK_MHZ, // int SPI_HOST, uint8_t *ENC28J60_Mac = ENC28J60_Default_Mac); - //ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, SPI_HOST ); - ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, SPI_HOST, mac[index] ); + //ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, ETH_SPI_HOST ); + ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, ETH_SPI_HOST, mac[index] ); } ////////////////////////////////////////////////////////////// @@ -625,14 +641,11 @@ void setup() AsyncESP32_SC_ENC_manager.setCORSHeader("Your Access-Control-Allow-Origin"); #endif - bool configDataLoaded = false; - if (loadConfigData()) { - configDataLoaded = true; - //If no access point name has been previously entered disable timeout. AsyncESP32_SC_ENC_manager.setConfigPortalTimeout(120); + Serial.println(F("Got stored Credentials. Timeout 120s for Config Portal")); #if USE_ESP_ETH_MANAGER_NTP diff --git a/examples/Async_ConfigOnSwitch/Async_ConfigOnSwitch.ino b/examples/Async_ConfigOnSwitch/Async_ConfigOnSwitch.ino index c20b35a..2c086b1 100644 --- a/examples/Async_ConfigOnSwitch/Async_ConfigOnSwitch.ino +++ b/examples/Async_ConfigOnSwitch/Async_ConfigOnSwitch.ino @@ -67,10 +67,11 @@ byte mac[][NUMBER_OF_MAC] = ////////////////////////////////////////////////////////// +// For ESP32-S3 // Optional values to override default settings // Don't change unless you know what you're doing //#define ETH_SPI_HOST SPI3_HOST -//#define SPI_CLOCK_MHZ 25 +//#define SPI_CLOCK_MHZ 8 // Must connect INT to GPIOxx or not working //#define INT_GPIO 4 @@ -80,6 +81,20 @@ byte mac[][NUMBER_OF_MAC] = //#define SCK_GPIO 12 //#define CS_GPIO 10 +// For ESP32_C3 +// Optional values to override default settings +// Don't change unless you know what you're doing +//#define ETH_SPI_HOST SPI2_HOST +//#define SPI_CLOCK_MHZ 8 + +// Must connect INT to GPIOxx or not working +//#define INT_GPIO 10 + +//#define MISO_GPIO 5 +//#define MOSI_GPIO 6 +//#define SCK_GPIO 4 +//#define CS_GPIO 7 + ////////////////////////////////////////////////////////// //For ESP32, To use ESP32 Dev Module, QIO, Flash 4MB/80MHz, Upload 921600 @@ -554,6 +569,7 @@ void saveConfigData() void beginEthernet() { LOGWARN(F("Default SPI pinout:")); + LOGWARN1(F("SPI_HOST:"), ETH_SPI_HOST); LOGWARN1(F("MOSI:"), MOSI_GPIO); LOGWARN1(F("MISO:"), MISO_GPIO); LOGWARN1(F("SCK:"), SCK_GPIO); @@ -573,8 +589,8 @@ void beginEthernet() //bool begin(int MISO_GPIO, int MOSI_GPIO, int SCLK_GPIO, int CS_GPIO, int INT_GPIO, int SPI_CLOCK_MHZ, // int SPI_HOST, uint8_t *ENC28J60_Mac = ENC28J60_Default_Mac); - //ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, SPI_HOST ); - ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, SPI_HOST, mac[index] ); + //ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, ETH_SPI_HOST ); + ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, ETH_SPI_HOST, mac[index] ); } ////////////////////////////////////////////////////////////// @@ -688,14 +704,11 @@ void setup() AsyncESP32_SC_ENC_manager.setCORSHeader("Your Access-Control-Allow-Origin"); #endif - bool configDataLoaded = false; - if (loadConfigData()) { - configDataLoaded = true; - //If no access point name has been previously entered disable timeout. AsyncESP32_SC_ENC_manager.setConfigPortalTimeout(120); + Serial.println(F("Got stored Credentials. Timeout 120s for Config Portal")); #if USE_ESP_ETH_MANAGER_NTP @@ -841,8 +854,9 @@ void loop() if (loadConfigData()) { - AsyncESP32_SC_ENC_manager.setConfigPortalTimeout( - 120); //If no access point name has been previously entered disable timeout. + //If no access point name has been previously entered disable timeout. + AsyncESP32_SC_ENC_manager.setConfigPortalTimeout(120); + Serial.println(F("Got stored Credentials. Timeout 120s for Config Portal")); } else diff --git a/examples/Async_ConfigOnSwitchFS/Async_ConfigOnSwitchFS.ino b/examples/Async_ConfigOnSwitchFS/Async_ConfigOnSwitchFS.ino index cfc9b68..f642a17 100644 --- a/examples/Async_ConfigOnSwitchFS/Async_ConfigOnSwitchFS.ino +++ b/examples/Async_ConfigOnSwitchFS/Async_ConfigOnSwitchFS.ino @@ -80,10 +80,11 @@ byte mac[][NUMBER_OF_MAC] = ////////////////////////////////////////////////////////// +// For ESP32-S3 // Optional values to override default settings // Don't change unless you know what you're doing //#define ETH_SPI_HOST SPI3_HOST -//#define SPI_CLOCK_MHZ 25 +//#define SPI_CLOCK_MHZ 8 // Must connect INT to GPIOxx or not working //#define INT_GPIO 4 @@ -93,6 +94,20 @@ byte mac[][NUMBER_OF_MAC] = //#define SCK_GPIO 12 //#define CS_GPIO 10 +// For ESP32_C3 +// Optional values to override default settings +// Don't change unless you know what you're doing +//#define ETH_SPI_HOST SPI2_HOST +//#define SPI_CLOCK_MHZ 8 + +// Must connect INT to GPIOxx or not working +//#define INT_GPIO 10 + +//#define MISO_GPIO 5 +//#define MOSI_GPIO 6 +//#define SCK_GPIO 4 +//#define CS_GPIO 7 + ////////////////////////////////////////////////////////// #include @@ -714,6 +729,7 @@ bool writeConfigFile() void beginEthernet() { LOGWARN(F("Default SPI pinout:")); + LOGWARN1(F("SPI_HOST:"), ETH_SPI_HOST); LOGWARN1(F("MOSI:"), MOSI_GPIO); LOGWARN1(F("MISO:"), MISO_GPIO); LOGWARN1(F("SCK:"), SCK_GPIO); @@ -733,8 +749,8 @@ void beginEthernet() //bool begin(int MISO_GPIO, int MOSI_GPIO, int SCLK_GPIO, int CS_GPIO, int INT_GPIO, int SPI_CLOCK_MHZ, // int SPI_HOST, uint8_t *ENC28J60_Mac = ENC28J60_Default_Mac); - //ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, SPI_HOST ); - ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, SPI_HOST, mac[index] ); + //ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, ETH_SPI_HOST ); + ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, ETH_SPI_HOST, mac[index] ); } ////////////////////////////////////////////////////////////// @@ -856,14 +872,11 @@ void setup() AsyncESP32_SC_ENC_manager.setCORSHeader("Your Access-Control-Allow-Origin"); #endif - bool configDataLoaded = false; - if (loadConfigData()) { - configDataLoaded = true; - //If no access point name has been previously entered disable timeout. AsyncESP32_SC_ENC_manager.setConfigPortalTimeout(120); + Serial.println(F("Got stored Credentials. Timeout 120s for Config Portal")); #if USE_ESP_ETH_MANAGER_NTP @@ -992,9 +1005,10 @@ void loop() if (loadConfigData()) { - AsyncESP32_SC_ENC_manager.setConfigPortalTimeout( - 120); //If no access point name has been previously entered disable timeout. - Serial.println(F("Got stored Credentials. Timeout 120s for Config Portal")); + //If no access point name has been previously entered disable timeout. + AsyncESP32_SC_ENC_manager.setConfigPortalTimeout(120); + + Serial.println(F("Got stored Credentials. Timeout 120s for Config Portal")); } else { diff --git a/examples/Async_ConfigPortalParamsOnSwitch/Async_ConfigPortalParamsOnSwitch.ino b/examples/Async_ConfigPortalParamsOnSwitch/Async_ConfigPortalParamsOnSwitch.ino index 8b28fe0..f23dac7 100644 --- a/examples/Async_ConfigPortalParamsOnSwitch/Async_ConfigPortalParamsOnSwitch.ino +++ b/examples/Async_ConfigPortalParamsOnSwitch/Async_ConfigPortalParamsOnSwitch.ino @@ -68,10 +68,11 @@ byte mac[][NUMBER_OF_MAC] = ////////////////////////////////////////////////////////// +// For ESP32-S3 // Optional values to override default settings // Don't change unless you know what you're doing //#define ETH_SPI_HOST SPI3_HOST -//#define SPI_CLOCK_MHZ 25 +//#define SPI_CLOCK_MHZ 8 // Must connect INT to GPIOxx or not working //#define INT_GPIO 4 @@ -81,6 +82,20 @@ byte mac[][NUMBER_OF_MAC] = //#define SCK_GPIO 12 //#define CS_GPIO 10 +// For ESP32_C3 +// Optional values to override default settings +// Don't change unless you know what you're doing +//#define ETH_SPI_HOST SPI2_HOST +//#define SPI_CLOCK_MHZ 8 + +// Must connect INT to GPIOxx or not working +//#define INT_GPIO 10 + +//#define MISO_GPIO 5 +//#define MOSI_GPIO 6 +//#define SCK_GPIO 4 +//#define CS_GPIO 7 + ////////////////////////////////////////////////////////// #include @@ -649,6 +664,7 @@ bool writeConfigFile() void beginEthernet() { LOGWARN(F("Default SPI pinout:")); + LOGWARN1(F("SPI_HOST:"), ETH_SPI_HOST); LOGWARN1(F("MOSI:"), MOSI_GPIO); LOGWARN1(F("MISO:"), MISO_GPIO); LOGWARN1(F("SCK:"), SCK_GPIO); @@ -668,8 +684,8 @@ void beginEthernet() //bool begin(int MISO_GPIO, int MOSI_GPIO, int SCLK_GPIO, int CS_GPIO, int INT_GPIO, int SPI_CLOCK_MHZ, // int SPI_HOST, uint8_t *ENC28J60_Mac = ENC28J60_Default_Mac); - //ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, SPI_HOST ); - ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, SPI_HOST, mac[index] ); + //ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, ETH_SPI_HOST ); + ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, ETH_SPI_HOST, mac[index] ); } ////////////////////////////////////////////////////////////// @@ -787,14 +803,11 @@ void setup() AsyncESP32_SC_ENC_manager.setCORSHeader("Your Access-Control-Allow-Origin"); #endif - bool configDataLoaded = false; - if (loadConfigData()) { - configDataLoaded = true; - //If no access point name has been previously entered disable timeout. AsyncESP32_SC_ENC_manager.setConfigPortalTimeout(120); + Serial.println(F("Got stored Credentials. Timeout 120s for Config Portal")); #if USE_ESP_ETH_MANAGER_NTP @@ -923,8 +936,9 @@ void loop() if (loadConfigData()) { - AsyncESP32_SC_ENC_manager.setConfigPortalTimeout( - 120); //If no access point name has been previously entered disable timeout. + //If no access point name has been previously entered disable timeout. + AsyncESP32_SC_ENC_manager.setConfigPortalTimeout(120); + Serial.println(F("Got stored Credentials. Timeout 120s for Config Portal")); } else diff --git a/examples/Async_ESP32_FSWebServer/Async_ESP32_FSWebServer.ino b/examples/Async_ESP32_FSWebServer/Async_ESP32_FSWebServer.ino index e8574db..a5ad450 100644 --- a/examples/Async_ESP32_FSWebServer/Async_ESP32_FSWebServer.ino +++ b/examples/Async_ESP32_FSWebServer/Async_ESP32_FSWebServer.ino @@ -71,10 +71,11 @@ byte mac[][NUMBER_OF_MAC] = ////////////////////////////////////////////////////////// +// For ESP32-S3 // Optional values to override default settings // Don't change unless you know what you're doing //#define ETH_SPI_HOST SPI3_HOST -//#define SPI_CLOCK_MHZ 25 +//#define SPI_CLOCK_MHZ 8 // Must connect INT to GPIOxx or not working //#define INT_GPIO 4 @@ -84,6 +85,20 @@ byte mac[][NUMBER_OF_MAC] = //#define SCK_GPIO 12 //#define CS_GPIO 10 +// For ESP32_C3 +// Optional values to override default settings +// Don't change unless you know what you're doing +//#define ETH_SPI_HOST SPI2_HOST +//#define SPI_CLOCK_MHZ 8 + +// Must connect INT to GPIOxx or not working +//#define INT_GPIO 10 + +//#define MISO_GPIO 5 +//#define MOSI_GPIO 6 +//#define SCK_GPIO 4 +//#define CS_GPIO 7 + ////////////////////////////////////////////////////////// #include @@ -513,6 +528,7 @@ void saveConfigData() void beginEthernet() { LOGWARN(F("Default SPI pinout:")); + LOGWARN1(F("SPI_HOST:"), ETH_SPI_HOST); LOGWARN1(F("MOSI:"), MOSI_GPIO); LOGWARN1(F("MISO:"), MISO_GPIO); LOGWARN1(F("SCK:"), SCK_GPIO); @@ -532,8 +548,8 @@ void beginEthernet() //bool begin(int MISO_GPIO, int MOSI_GPIO, int SCLK_GPIO, int CS_GPIO, int INT_GPIO, int SPI_CLOCK_MHZ, // int SPI_HOST, uint8_t *ENC28J60_Mac = ENC28J60_Default_Mac); - //ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, SPI_HOST ); - ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, SPI_HOST, mac[index] ); + //ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, ETH_SPI_HOST ); + ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, ETH_SPI_HOST, mac[index] ); } ////////////////////////////////////////////////////////////// diff --git a/examples/Async_ESP32_FSWebServer_DRD/Async_ESP32_FSWebServer_DRD.ino b/examples/Async_ESP32_FSWebServer_DRD/Async_ESP32_FSWebServer_DRD.ino index c058648..cba343f 100644 --- a/examples/Async_ESP32_FSWebServer_DRD/Async_ESP32_FSWebServer_DRD.ino +++ b/examples/Async_ESP32_FSWebServer_DRD/Async_ESP32_FSWebServer_DRD.ino @@ -71,10 +71,11 @@ byte mac[][NUMBER_OF_MAC] = ////////////////////////////////////////////////////////// +// For ESP32-S3 // Optional values to override default settings // Don't change unless you know what you're doing //#define ETH_SPI_HOST SPI3_HOST -//#define SPI_CLOCK_MHZ 25 +//#define SPI_CLOCK_MHZ 8 // Must connect INT to GPIOxx or not working //#define INT_GPIO 4 @@ -84,6 +85,20 @@ byte mac[][NUMBER_OF_MAC] = //#define SCK_GPIO 12 //#define CS_GPIO 10 +// For ESP32_C3 +// Optional values to override default settings +// Don't change unless you know what you're doing +//#define ETH_SPI_HOST SPI2_HOST +//#define SPI_CLOCK_MHZ 8 + +// Must connect INT to GPIOxx or not working +//#define INT_GPIO 10 + +//#define MISO_GPIO 5 +//#define MOSI_GPIO 6 +//#define SCK_GPIO 4 +//#define CS_GPIO 7 + ////////////////////////////////////////////////////////// #include @@ -545,6 +560,7 @@ void saveConfigData() void beginEthernet() { LOGWARN(F("Default SPI pinout:")); + LOGWARN1(F("SPI_HOST:"), ETH_SPI_HOST); LOGWARN1(F("MOSI:"), MOSI_GPIO); LOGWARN1(F("MISO:"), MISO_GPIO); LOGWARN1(F("SCK:"), SCK_GPIO); @@ -564,8 +580,8 @@ void beginEthernet() //bool begin(int MISO_GPIO, int MOSI_GPIO, int SCLK_GPIO, int CS_GPIO, int INT_GPIO, int SPI_CLOCK_MHZ, // int SPI_HOST, uint8_t *ENC28J60_Mac = ENC28J60_Default_Mac); - //ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, SPI_HOST ); - ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, SPI_HOST, mac[index] ); + //ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, ETH_SPI_HOST ); + ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, ETH_SPI_HOST, mac[index] ); } ////////////////////////////////////////////////////////////// @@ -695,6 +711,7 @@ void setup() { //If no access point name has been previously entered disable timeout. AsyncESP32_SC_ENC_manager.setConfigPortalTimeout(120); + Serial.println(F("Got stored Credentials. Timeout 120s for Config Portal")); #if USE_ESP_ETH_MANAGER_NTP diff --git a/library.json b/library.json index dd601f4..64a06b2 100644 --- a/library.json +++ b/library.json @@ -1,6 +1,6 @@ { "name": "AsyncESP32_SC_ENC_Manager", - "version": "1.0.0", + "version": "1.1.0", "keywords": "ethernet, Credentials-Manager, esp32, esp32-s2, esp32-s3, esp32-c3, lwip, enc28j60, lwip-enc28j60, lwip-ethernet, AsyncWebServer, Async-Credentials-Manager, Async, Communication, Credentials, Config-Portal, DoubleReset, littlefs, spiffs, dns-server, iot, eeprom", "description": "ESP32_S2/S3/C3 + LwIP ENC28J60 Connection and Credentials Manager using AsyncWebServer, with enhanced GUI and fallback Web ConfigPortal. This Library is used for configuring ESP32_S2/S3/C3 + LwIP ENC28J60 Credentials Manager at runtime. You can also specify static DNS servers, personalized HostName, static or DHCP IP. With configurable CORS Header and auto-Timezone features. Now using AsyncDNSServer instead of DNSServer and correct ESP32 chipIP", "authors": @@ -38,7 +38,7 @@ { "owner": "khoih-prog", "name": "WebServer_ESP32_SC_ENC", - "version": ">=1.5.1", + "version": ">=1.2.0", "platforms": ["espressif32"] }, { diff --git a/library.properties b/library.properties index 12085b1..88d9679 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=AsyncESP32_SC_ENC_Manager -version=1.0.0 +version=1.1.0 author=Khoi Hoang maintainer=Khoi Hoang license=MIT diff --git a/platformio/platformio.ini b/platformio/platformio.ini index 567b875..bb72b8a 100644 --- a/platformio/platformio.ini +++ b/platformio/platformio.ini @@ -45,7 +45,7 @@ lib_deps = ; https://github.com/khoih-prog/ESPAsyncTCP ; AsyncTCP@>=1.1.1 ; ESP_DoubleResetDetector@>=1.3.2 -; WebServer_ESP32_SC_ENC@>=1.0.0 +; WebServer_ESP32_SC_ENC@>=1.2.0 ; PlatformIO 5.x ; me-no-dev/ESP Async WebServer@>=1.2.3 @@ -54,7 +54,7 @@ lib_deps = https://github.com/khoih-prog/ESPAsyncTCP me-no-dev/AsyncTCP@>=1.1.1 khoih-prog/ESP_DoubleResetDetector@>=1.3.2 - khoih-prog/WebServer_ESP32_SC_ENC@>=1.0.0 + khoih-prog/WebServer_ESP32_SC_ENC@>=1.2.0 ; ============================================================ build_flags = diff --git a/src/AsyncESP32_SC_ENC_Manager.h b/src/AsyncESP32_SC_ENC_Manager.h index 8cc247d..6e31500 100644 --- a/src/AsyncESP32_SC_ENC_Manager.h +++ b/src/AsyncESP32_SC_ENC_Manager.h @@ -14,11 +14,12 @@ Built by Khoi Hoang https://github.com/khoih-prog/AsyncESP32_SC_ENC_Manager Licensed under MIT license - Version: 1.0.0 + Version: 1.1.0 Version Modified By Date Comments ------- ----------- ---------- ----------- 1.0.0 K Hoang 14/12/2022 Initial coding for ESP32_S3 + LwIP ENC28J60 + 1.1.0 K Hoang 23/12/2022 Add support to ESP32_S2/C3_W5500 (ESP32_S2/C3 + LwIP ENC28J60) *****************************************************************************************************************************/ #pragma once diff --git a/src/AsyncESP32_SC_ENC_Manager.hpp b/src/AsyncESP32_SC_ENC_Manager.hpp index 90e07d3..ea883a4 100644 --- a/src/AsyncESP32_SC_ENC_Manager.hpp +++ b/src/AsyncESP32_SC_ENC_Manager.hpp @@ -14,11 +14,12 @@ Built by Khoi Hoang https://github.com/khoih-prog/AsyncESP32_SC_ENC_Manager Licensed under MIT license - Version: 1.0.0 + Version: 1.1.0 Version Modified By Date Comments ------- ----------- ---------- ----------- 1.0.0 K Hoang 14/12/2022 Initial coding for ESP32_S3 + LwIP ENC28J60 + 1.1.0 K Hoang 23/12/2022 Add support to ESP32_S2/C3_W5500 (ESP32_S2/C3 + LwIP ENC28J60) *****************************************************************************************************************************/ #pragma once @@ -37,8 +38,8 @@ #endif #define USING_ESP32_S2 true - - #error ESP32_S2 not supported yet + +////////////////////////////////////////// #elif ( ARDUINO_ESP32C3_DEV ) #if (_ESPASYNC_ETH_MGR_LOGLEVEL_ > 3) @@ -54,7 +55,7 @@ #define USING_ESP32_C3 true - #error ESP32_C3 not supported yet +////////////////////////////////////////// #elif ( defined(ARDUINO_ESP32S3_DEV) || defined(ARDUINO_ESP32_S3_BOX) || defined(ARDUINO_TINYS3) || \ defined(ARDUINO_PROS3) || defined(ARDUINO_FEATHERS3) ) @@ -71,13 +72,13 @@ //////////////////////////////////////////////////// -#define ASYNC_ESP32_SC_ENC_MANAGER_VERSION "AsyncESP32_SC_ENC_Manager v1.0.0" +#define ASYNC_ESP32_SC_ENC_MANAGER_VERSION "AsyncESP32_SC_ENC_Manager v1.1.0" #define ASYNC_ESP32_SC_ENC_MANAGER_VERSION_MAJOR 1 -#define ASYNC_ESP32_SC_ENC_MANAGER_VERSION_MINOR 0 +#define ASYNC_ESP32_SC_ENC_MANAGER_VERSION_MINOR 1 #define ASYNC_ESP32_SC_ENC_MANAGER_VERSION_PATCH 0 -#define ASYNC_ESP32_SC_ENC_MANAGER_VERSION_INT 1000000 +#define ASYNC_ESP32_SC_ENC_MANAGER_VERSION_INT 1001000 //////////////////////////////////////////////////// diff --git a/src/AsyncESP32_SC_ENC_Manager_Debug.h b/src/AsyncESP32_SC_ENC_Manager_Debug.h index 2290303..3aa3901 100644 --- a/src/AsyncESP32_SC_ENC_Manager_Debug.h +++ b/src/AsyncESP32_SC_ENC_Manager_Debug.h @@ -14,11 +14,12 @@ Built by Khoi Hoang https://github.com/khoih-prog/AsyncESP32_SC_ENC_Manager Licensed under MIT license - Version: 1.0.0 + Version: 1.1.0 Version Modified By Date Comments ------- ----------- ---------- ----------- 1.0.0 K Hoang 14/12/2022 Initial coding for ESP32_S3 + LwIP ENC28J60 + 1.1.0 K Hoang 23/12/2022 Add support to ESP32_S2/C3_W5500 (ESP32_S2/C3 + LwIP ENC28J60) *****************************************************************************************************************************/ #pragma once diff --git a/src/AsyncESP32_SC_ENC_Manager_Impl.h b/src/AsyncESP32_SC_ENC_Manager_Impl.h index 0287518..b277bf2 100644 --- a/src/AsyncESP32_SC_ENC_Manager_Impl.h +++ b/src/AsyncESP32_SC_ENC_Manager_Impl.h @@ -14,11 +14,12 @@ Built by Khoi Hoang https://github.com/khoih-prog/AsyncESP32_SC_ENC_Manager Licensed under MIT license - Version: 1.0.0 + Version: 1.1.0 Version Modified By Date Comments ------- ----------- ---------- ----------- 1.0.0 K Hoang 14/12/2022 Initial coding for ESP32_S3 + LwIP ENC28J60 + 1.1.0 K Hoang 23/12/2022 Add support to ESP32_S2/C3_W5500 (ESP32_S2/C3 + LwIP ENC28J60) *****************************************************************************************************************************/ #pragma once @@ -375,16 +376,12 @@ bool AsyncESP32_SC_ENC_Manager::startConfigPortal() setupConfigPortal(); - bool TimedOut = true; - LOGINFO("startConfigPortal : Enter loop"); while (true) { if (connect) { - TimedOut = false; - if (_shouldBreakAfterConfig) { //flag set to exit after config after trying to connect @@ -403,8 +400,6 @@ bool AsyncESP32_SC_ENC_Manager::startConfigPortal() if (stopConfigPortal) { - TimedOut = false; - LOGERROR("stopConfigPortal"); stopConfigPortal = false;