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

Commit

Permalink
v1.1.0 for ESP32_S2/C3
Browse files Browse the repository at this point in the history
#### Releases v1.1.0

1. Add support to `ESP32_S2/C3` boards using `LwIP ENC28J60 Ethernet`
  • Loading branch information
khoih-prog authored Dec 24, 2022
1 parent 309af87 commit 63f09a8
Show file tree
Hide file tree
Showing 18 changed files with 177 additions and 73 deletions.
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down
Binary file added Images/ESP32S2_DEV.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Images/ESP32_C3_DevKitC_02.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
## Table of contents

* [Changelog](#changelog)
* [Releases v1.1.0](#releases-v110)
* [Releases v1.0.0](#releases-v100)


Expand All @@ -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`.
Expand Down
31 changes: 22 additions & 9 deletions examples/Async_ConfigOnDoubleReset/Async_ConfigOnDoubleReset.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 <FS.h>
Expand Down Expand Up @@ -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);
Expand All @@ -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()
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 <FS.h>
Expand Down Expand Up @@ -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);
Expand All @@ -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] );
}

//////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -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
Expand Down
32 changes: 23 additions & 9 deletions examples/Async_ConfigOnSwitch/Async_ConfigOnSwitch.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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);
Expand All @@ -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] );
}

//////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
34 changes: 24 additions & 10 deletions examples/Async_ConfigOnSwitchFS/Async_ConfigOnSwitchFS.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 <FS.h>
Expand Down Expand Up @@ -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);
Expand All @@ -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] );
}

//////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
{
Expand Down
Loading

0 comments on commit 63f09a8

Please sign in to comment.