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

Commit c918dbf

Browse files
authored
v1.1.0 for ESP32_S2/C3 & LwIP Ethernet
### Releases v1.1.0 1. Add support to `ESP32S2/C3` boards using `LwIP W5500 or ENC28J60 Ethernet`
1 parent a479947 commit c918dbf

File tree

17 files changed

+372
-141
lines changed

17 files changed

+372
-141
lines changed

README.md

Lines changed: 99 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
* [3. ESP32 WiFi uses ADC2 for WiFi functions](#3-esp32-wifi-uses-adc2-for-wifi-functions)
3939
* [HOWTO Setting up the Async DNS Server](#howto-setting-up-the-async-dns-server)
4040
* [How to connect W5500 or ENC28J60 to ESP32](#How-to-connect-W5500-or-ENC28J60-to-ESP32)
41-
* [How to connect W5500 or ENC28J60 to ESP32_S3](#How-to-connect-W5500-or-ENC28J60-to-ESP32_S3)
41+
* [How to connect W5500 or ENC28J60 to ESP32_S2/S3/C3](#How-to-connect-W5500-or-ENC28J60-to-ESP32_S2S3C3)
4242
* [Examples](#examples)
4343
* [1. For ESP32_W5500](#1-For-ESP32_W5500)
4444
* [ 1. AsyncCaptivePortalAdvanced_ESP32_W5500](examples/ESP32_W5500/AsyncCaptivePortalAdvanced_ESP32_W5500)
@@ -86,9 +86,13 @@ to apply the better and faster **asynchronous** feature of the **powerful** [Asy
8686

8787
#### Currently supported Boards
8888

89-
1. **ESP32/S3 boards** using `LwIP W5500 or ENC28J60 Ethernet`
90-
89+
1. **ESP32 boards**
90+
2. **ESP32_S3-based boards (ESP32S3_DEV, ESP32_S3_BOX, UM TINYS3, UM PROS3, UM FEATHERS3, etc.)**
91+
3. **ESP32-S2 (ESP32-S2 Saola, AI-Thinker ESP-12K, etc.)**
92+
4. **ESP32-C3 (ARDUINO_ESP32C3_DEV, etc.)**
9193

94+
using `LwIP W5500 or ENC28J60 Ethernet`
95+
9296
---
9397

9498
#### ESP32S3_DEV
@@ -97,6 +101,21 @@ to apply the better and faster **asynchronous** feature of the **powerful** [Asy
97101
<img src="https://github.com/khoih-prog/AsyncDNSServer_ESP32_Ethernet/raw/main/Images/ESP32S3_DEV.png">
98102
</p>
99103

104+
105+
#### ESP32S2_DEV
106+
107+
<p align="center">
108+
<img src="https://github.com/khoih-prog/AsyncDNSServer_ESP32_Ethernet/raw/main/Images/ESP32S2_DEV.png">
109+
</p>
110+
111+
112+
#### ESP32C3_DEV
113+
114+
<p align="center">
115+
<img src="https://github.com/khoih-prog/AsyncDNSServer_ESP32_Ethernet/raw/main/Images/ESP32_C3_DevKitC_02.png">
116+
</p>
117+
118+
100119
---
101120

102121
##### W5500
@@ -127,10 +146,7 @@ to apply the better and faster **asynchronous** feature of the **powerful** [Asy
127146

128147
### To-be Supported Boards
129148

130-
#### 1. ESP32S2/C3 using LwIP ENC28J60 or W5500
131-
132-
1. **ESP32-S2 (ESP32-S2 Saola, AI-Thinker ESP-12K, etc.)**
133-
2. **ESP32-C3 (ARDUINO_ESP32C3_DEV, etc.)**
149+
#### 1. New ESP32 using LwIP W5500 or ENC28J60 Ethernet
134150

135151

136152

@@ -151,9 +167,9 @@ to apply the better and faster **asynchronous** feature of the **powerful** [Asy
151167

152168
### For ESP32_S2/S3/C3
153169

154-
7. [`WebServer_ESP32_SC_W5500 library 1.0.1+`](https://github.com/khoih-prog/WebServer_ESP32_SC_W5500) for `ESP32_S2/S3/C3` using W5500. To install, check [![arduino-library-badge](https://www.ardu-badge.com/badge/WebServer_ESP32_SC_W5500.svg?)](https://www.ardu-badge.com/WebServer_ESP32_SC_W5500)
155-
8. [`WebServer_ESP32_SC_ENC library 1.0.0+`](https://github.com/khoih-prog/WebServer_ESP32_SC_ENC) for `ESP32_S2/S3/C3` using ENC28J60. To install, check [![arduino-library-badge](https://www.ardu-badge.com/badge/WebServer_ESP32_SC_ENC.svg?)](https://www.ardu-badge.com/WebServer_ESP32_SC_ENC)
156-
9. [`AsyncUDP_ESP32_SC_Ethernet library 2.0.0+`](https://github.com/khoih-prog/AsyncUDP_ESP32_SC_Ethernet) for `ESP32_S2/S3/C3` using W5500 or ENC28J60. To install, check [![arduino-library-badge](https://www.ardu-badge.com/badge/AsyncUDP_ESP32_SC_Ethernet.svg?)](https://www.ardu-badge.com/AsyncUDP_ESP32_SC_Ethernet)
170+
7. [`WebServer_ESP32_SC_W5500 library 1.2.0+`](https://github.com/khoih-prog/WebServer_ESP32_SC_W5500) for `ESP32_S2/S3/C3` using W5500. To install, check [![arduino-library-badge](https://www.ardu-badge.com/badge/WebServer_ESP32_SC_W5500.svg?)](https://www.ardu-badge.com/WebServer_ESP32_SC_W5500)
171+
8. [`WebServer_ESP32_SC_ENC library 1.2.0+`](https://github.com/khoih-prog/WebServer_ESP32_SC_ENC) for `ESP32_S2/S3/C3` using ENC28J60. To install, check [![arduino-library-badge](https://www.ardu-badge.com/badge/WebServer_ESP32_SC_ENC.svg?)](https://www.ardu-badge.com/WebServer_ESP32_SC_ENC)
172+
9. [`AsyncUDP_ESP32_SC_Ethernet library 2.1.0+`](https://github.com/khoih-prog/AsyncUDP_ESP32_SC_Ethernet) for `ESP32_S2/S3/C3` using W5500 or ENC28J60. To install, check [![arduino-library-badge](https://www.ardu-badge.com/badge/AsyncUDP_ESP32_SC_Ethernet.svg?)](https://www.ardu-badge.com/AsyncUDP_ESP32_SC_Ethernet)
157173

158174
---
159175
---
@@ -350,24 +366,8 @@ You can change the `INT` pin to another one. Default is `GPIO4`
350366
---
351367
---
352368

353-
### How to connect W5500 or ENC28J60 to ESP32_S3
369+
### How to connect W5500 or ENC28J60 to ESP32_S2/S3/C3
354370

355-
You can change the `INT` pin to another one. Default is `GPIO4`
356-
357-
```cpp
358-
// Must connect INT to GPIOxx or not working
359-
#define INT_GPIO 4
360-
```
361-
362-
---
363-
364-
#### ESP32S3_DEV
365-
366-
<p align="center">
367-
<img src="https://github.com/khoih-prog/AsyncDNSServer_ESP32_Ethernet/raw/main/Images/ESP32S3_DEV.png">
368-
</p>
369-
370-
---
371371

372372
##### W5500
373373

@@ -392,7 +392,21 @@ You can change the `INT` pin to another one. Default is `GPIO4`
392392
<img src="https://github.com/khoih-prog/AsyncDNSServer_ESP32_Ethernet/raw/main/Images/ENC28J60.png">
393393
</p>
394394

395-
395+
---
396+
397+
#### ESP32S3_DEV
398+
399+
<p align="center">
400+
<img src="https://github.com/khoih-prog/AsyncDNSServer_ESP32_Ethernet/raw/main/Images/ESP32S3_DEV.png">
401+
</p>
402+
403+
You can change the `INT` pin to another one. Default is `GPIO4`
404+
405+
```cpp
406+
// Must connect INT to GPIOxx or not working
407+
#define INT_GPIO 4
408+
```
409+
396410
---
397411

398412
|W5500 or ENC28J60|<--->|ESP32_S3|
@@ -406,6 +420,61 @@ You can change the `INT` pin to another one. Default is `GPIO4`
406420
|GND|<--->|GND|
407421
|3.3V|<--->|3.3V|
408422

423+
---
424+
425+
#### ESP32S2_DEV
426+
427+
428+
<p align="center">
429+
<img src="https://github.com/khoih-prog/AsyncDNSServer_ESP32_Ethernet/raw/main/Images/ESP32S2_DEV.png">
430+
</p>
431+
432+
433+
You can change the `INT` pin to another one. Default is `GPIO4`
434+
435+
```cpp
436+
// Must connect INT to GPIOxx or not working
437+
#define INT_GPIO 4
438+
```
439+
440+
|W5500 or ENC28J60|<--->|ESP32_S2|
441+
|:-:|:-:|:-:|
442+
|MOSI|<--->|GPIO35|
443+
|MISO|<--->|GPIO37|
444+
|SCK|<--->|GPIO36|
445+
|SS|<--->|GPIO34|
446+
|INT|<--->|GPIO4|
447+
|RST|<--->|RST|
448+
|GND|<--->|GND|
449+
|3.3V|<--->|3.3V|
450+
451+
452+
---
453+
454+
#### ESP32C3_DEV
455+
456+
<p align="center">
457+
<img src="https://github.com/khoih-prog/AsyncDNSServer_ESP32_Ethernet/raw/main/Images/ESP32_C3_DevKitC_02.png">
458+
</p>
459+
460+
461+
You can change the `INT` pin to another one. Default is `GPIO4`
462+
463+
```cpp
464+
// Must connect INT to GPIOxx or not working
465+
#define INT_GPIO 10
466+
```
467+
468+
|W5500 or ENC28J60|<--->|ESP32_C3|
469+
|:-:|:-:|:-:|
470+
|MOSI|<--->|GPIO6|
471+
|MISO|<--->|GPIO5|
472+
|SCK|<--->|GPIO4|
473+
|SS|<--->|GPIO7|
474+
|INT|<--->|GPIO10|
475+
|RST|<--->|RST|
476+
|GND|<--->|GND|
477+
|3.3V|<--->|3.3V|
409478

410479

411480
---
@@ -498,14 +567,15 @@ Submit issues to: [AsyncDNSServer_ESP32_Ethernet issues](https://github.com/khoi
498567

499568
1. Fix bug. Add enhancement
500569
2. Add support to more `LwIP Ethernet` shields
501-
3. Add support to `ESP32_S2` and `ESP32_C3`
502570

503571

504572
## DONE
505573

506574
1. Add support to **ESP32/S3-based boards using LwIP W5500 or ENC28J60 Ethernet**
507575
2. Add debugging features
508576
3. Add astyle using `allman` style. Restyle the library
577+
4. Add support to **ESP32_S2/C3-based boards using LwIP W5500 or ENC28J60 Ethernet**
578+
509579

510580
---
511581
---

changelog.md

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
# AsyncUDP_ESP32_SC_Ethernet
1+
# AsyncDNSServer_ESP32_Ethernet Library
22

3-
4-
[![arduino-library-badge](https://www.ardu-badge.com/badge/AsyncUDP_ESP32_SC_Ethernet.svg?)](https://www.ardu-badge.com/AsyncUDP_ESP32_SC_Ethernet)
5-
[![GitHub release](https://img.shields.io/github/release/khoih-prog/AsyncUDP_ESP32_SC_Ethernet.svg)](https://github.com/khoih-prog/AsyncUDP_ESP32_SC_Ethernet/releases)
3+
[![arduino-library-badge](https://www.ardu-badge.com/badge/AsyncDNSServer_ESP32_Ethernet.svg?)](https://www.ardu-badge.com/AsyncDNSServer_ESP32_Ethernet)
4+
[![GitHub release](https://img.shields.io/github/release/khoih-prog/AsyncDNSServer_ESP32_Ethernet.svg)](https://github.com/khoih-prog/AsyncDNSServer_ESP32_Ethernet/releases)
65
[![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](#Contributing)
7-
[![GitHub issues](https://img.shields.io/github/issues/khoih-prog/AsyncUDP_ESP32_SC_Ethernet.svg)](http://github.com/khoih-prog/AsyncUDP_ESP32_SC_Ethernet/issues)
6+
[![GitHub issues](https://img.shields.io/github/issues/khoih-prog/AsyncDNSServer_ESP32_Ethernet.svg)](http://github.com/khoih-prog/AsyncDNSServer_ESP32_Ethernet/issues)
87

98

109
<a href="https://www.buymeacoffee.com/khoihprog6" title="Donate to my libraries using BuyMeACoffee"><img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Donate to my libraries using BuyMeACoffee" style="height: 50px !important;width: 181px !important;" ></a>
@@ -17,21 +16,19 @@
1716
## Table of Contents
1817

1918
* [Changelog](#changelog)
20-
* [Releases v2.1.0](#releases-v210)
21-
* [Initial Releases v2.0.0](#initial-releases-v200)
19+
* [Releases v1.1.0](#releases-v110)
20+
* [Initial Releases v1.0.0](#initial-releases-v100)
2221

2322
---
2423
---
2524

2625
## Changelog
2726

28-
### Releases v2.1.0
27+
### Releases v1.1.0
2928

3029
1. Add support to `ESP32S2/C3` boards using `LwIP W5500 or ENC28J60 Ethernet`
3130

32-
### Initial Releases v2.0.0
33-
34-
1. Initial coding to port [AsyncUDP](https://github.com/espressif/arduino-esp32/tree/master/libraries/AsyncUDP) to ESP32_S3 boards using `LwIP W5500 or ENC28J60 Ethernet`
35-
2. Bump up to v2.0.0 to sync with [AsyncUDP v2.0.0](https://github.com/espressif/arduino-esp32/tree/master/libraries/AsyncUDP)
31+
### Initial Releases v1.0.0
3632

33+
1. Initial coding to support `ESP32/S3` boards using `LwIP W5500 or ENC28J60 Ethernet`
3734

examples/ESP32_SC_ENC/AsyncCaptivePortalAdvanced_ESP32_SC_ENC/AsyncCaptivePortalAdvanced_ESP32_SC_ENC.ino

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@
1818
This is a captive portal because it will redirect any http request to http://192.168.x.x/
1919
*/
2020

21-
#if !( defined(ARDUINO_ESP32S3_DEV) || defined(ARDUINO_ESP32_S3_BOX) || defined(ARDUINO_TINYS3) || \
22-
defined(ARDUINO_PROS3) || defined(ARDUINO_FEATHERS3) )
21+
#if !( defined(ESP32) )
2322
#error This code is designed for (ESP32 + LwIP ENC28J60) to run on ESP32 platform! Please check your Tools->Board setting.
2423
#endif
2524

@@ -69,8 +68,9 @@ IPAddress myDNS(8, 8, 8, 8);
6968

7069
/////////////////////////////////////////////
7170

71+
// For ESP32-S3
7272
// Optional values to override default settings
73-
//#define SPI_HOST SPI2_HOST
73+
//#define ETH_SPI_HOST SPI2_HOST
7474
//#define SPI_CLOCK_MHZ 8
7575

7676
// Must connect INT to GPIOxx or not working
@@ -81,6 +81,20 @@ IPAddress myDNS(8, 8, 8, 8);
8181
//#define SCK_GPIO 12
8282
//#define CS_GPIO 10
8383

84+
// For ESP32_C3
85+
// Optional values to override default settings
86+
// Don't change unless you know what you're doing
87+
//#define ETH_SPI_HOST SPI2_HOST
88+
//#define SPI_CLOCK_MHZ 8
89+
90+
// Must connect INT to GPIOxx or not working
91+
//#define INT_GPIO 10
92+
93+
//#define MISO_GPIO 5
94+
//#define MOSI_GPIO 6
95+
//#define SCK_GPIO 4
96+
//#define CS_GPIO 7
97+
8498
//////////////////////////////////////////////////////////
8599

86100
#include <AsyncDNSServer_ESP32_Ethernet.h>
@@ -226,7 +240,7 @@ void setup()
226240
Serial.setDebugOutput(true);
227241

228242
DNS_LOGWARN(F("Default SPI pinout:"));
229-
DNS_LOGWARN1(F("SPI_HOST:"), SPI_HOST);
243+
DNS_LOGWARN1(F("SPI_HOST:"), ETH_SPI_HOST);
230244
DNS_LOGWARN1(F("MOSI:"), MOSI_GPIO);
231245
DNS_LOGWARN1(F("MISO:"), MISO_GPIO);
232246
DNS_LOGWARN1(F("SCK:"), SCK_GPIO);
@@ -246,8 +260,8 @@ void setup()
246260

247261
//bool begin(int MISO_GPIO, int MOSI_GPIO, int SCLK_GPIO, int CS_GPIO, int INT_GPIO, int SPI_CLOCK_MHZ,
248262
// int SPI_HOST, uint8_t *ENC28J60_Mac = ENC28J60_Default_Mac);
249-
//ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, SPI_HOST );
250-
ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, SPI_HOST, mac[index] );
263+
//ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, ETH_SPI_HOST );
264+
ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, ETH_SPI_HOST, mac[index] );
251265

252266
// Static IP, leave without this line to get IP via DHCP
253267
//bool config(IPAddress local_ip, IPAddress gateway, IPAddress subnet, IPAddress dns1 = 0, IPAddress dns2 = 0);

examples/ESP32_SC_ENC/AsyncCaptivePortal_ESP32_SC_ENC/AsyncCaptivePortal_ESP32_SC_ENC.ino

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,17 +60,32 @@ IPAddress myDNS(8, 8, 8, 8);
6060

6161
/////////////////////////////////////////////
6262

63+
// For ESP32-S3
6364
// Optional values to override default settings
64-
//#define SPI_HOST 1
65+
//#define ETH_SPI_HOST SPI2_HOST
6566
//#define SPI_CLOCK_MHZ 8
6667

6768
// Must connect INT to GPIOxx or not working
6869
//#define INT_GPIO 4
6970

70-
//#define MISO_GPIO 19
71-
//#define MOSI_GPIO 23
72-
//#define SCK_GPIO 18
73-
//#define CS_GPIO 5
71+
//#define MISO_GPIO 13
72+
//#define MOSI_GPIO 11
73+
//#define SCK_GPIO 12
74+
//#define CS_GPIO 10
75+
76+
// For ESP32_C3
77+
// Optional values to override default settings
78+
// Don't change unless you know what you're doing
79+
//#define ETH_SPI_HOST SPI2_HOST
80+
//#define SPI_CLOCK_MHZ 8
81+
82+
// Must connect INT to GPIOxx or not working
83+
//#define INT_GPIO 10
84+
85+
//#define MISO_GPIO 5
86+
//#define MOSI_GPIO 6
87+
//#define SCK_GPIO 4
88+
//#define CS_GPIO 7
7489

7590
//////////////////////////////////////////////////////////
7691

@@ -115,7 +130,7 @@ void setup()
115130
Serial.setDebugOutput(true);
116131

117132
DNS_LOGWARN(F("Default SPI pinout:"));
118-
DNS_LOGWARN1(F("SPI_HOST:"), SPI_HOST);
133+
DNS_LOGWARN1(F("SPI_HOST:"), ETH_SPI_HOST);
119134
DNS_LOGWARN1(F("MOSI:"), MOSI_GPIO);
120135
DNS_LOGWARN1(F("MISO:"), MISO_GPIO);
121136
DNS_LOGWARN1(F("SCK:"), SCK_GPIO);
@@ -135,8 +150,8 @@ void setup()
135150

136151
//bool begin(int MISO_GPIO, int MOSI_GPIO, int SCLK_GPIO, int CS_GPIO, int INT_GPIO, int SPI_CLOCK_MHZ,
137152
// int SPI_HOST, uint8_t *ENC28J60_Mac = ENC28J60_Default_Mac);
138-
//ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, SPI_HOST );
139-
ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, SPI_HOST, mac[index] );
153+
//ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, ETH_SPI_HOST );
154+
ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, ETH_SPI_HOST, mac[index] );
140155

141156
// Static IP, leave without this line to get IP via DHCP
142157
//bool config(IPAddress local_ip, IPAddress gateway, IPAddress subnet, IPAddress dns1 = 0, IPAddress dns2 = 0);

0 commit comments

Comments
 (0)