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

Commit 6ac7a91

Browse files
authored
v1.1.0 for ESP32_C3
#### Releases v1.2.0 1. Add support to ESP32_C3-based boards using `LwIP W5500 Ethernet`
1 parent 92e3dff commit 6ac7a91

18 files changed

+145
-43
lines changed

README.md

+79-7
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
* [Basic Operation](#basic-operations)
3636
* [Advanced Options](#advanced-options)
3737
* [Other Function Calls](#other-function-calls)
38-
* [How to connect W5500 to ESP32_S2/S3](#How-to-connect-W5500-to-ESP32_S2S3)
38+
* [How to connect W5500 to ESP32_S2/S3/C3](#How-to-connect-W5500-to-ESP32_S2S3C3)
3939
* [Examples](#examples)
4040
* [Original Examples](#original-examples)
4141
* [ 1. AdvancedWebServer](examples/AdvancedWebServer)
@@ -63,6 +63,7 @@
6363
* [ 5. WebClient on ESP32S3_DEV with ESP32_S3_W5500](#5-WebClient-on-ESP32S3_DEV-with-ESP32_S3_W5500)
6464
* [ 6. UDPSendReceive on ESP32S3_DEV with ESP32_S3_W5500](#6-UDPSendReceive-on-ESP32S3_DEV-with-ESP32_S3_W5500)
6565
* [ 7. AdvancedWebServer on ESP32S2_DEV with ESP32_S2_W5500](#7-AdvancedWebServer-on-ESP32S2_DEV-with-ESP32_S2_W5500)
66+
* [ 8. AdvancedWebServer on ESP32C3_DEV with ESP32_C3_W5500](#8-AdvancedWebServer-on-ESP32C3_DEV-with-ESP32_C3_W5500)
6667
* [Debug](#debug)
6768
* [Troubleshooting](#troubleshooting)
6869
* [Releases](#releases)
@@ -108,6 +109,14 @@ Please also check these twin libraries
108109
3. [WebServer_ESP32_W5500](https://github.com/khoih-prog/WebServer_ESP32_W5500) for ESP32-boards using `LwIP W5500`
109110
4. [WebServer_ESP32_SC_ENC](https://github.com/khoih-prog/WebServer_ESP32_SC_ENC) for ESP32_S3-boards using `LwIP ENC28J60`
110111

112+
and more complex libraries for ESP32-based using `LwIP Ethernet`
113+
114+
1. [AsyncHTTPRequest_ESP32_Ethernet](https://github.com/khoih-prog/AsyncHTTPRequest_ESP32_Ethernet)
115+
2. [AsyncHTTPSRequest_ESP32_Ethernet](https://github.com/khoih-prog/AsyncHTTPSRequest_ESP32_Ethernet)
116+
3. [AsyncMQTT_ESP32](https://github.com/khoih-prog/AsyncMQTT_ESP32)
117+
4. [HTTPS_Server_Generic](https://github.com/khoih-prog/HTTPS_Server_Generic)
118+
119+
111120
---
112121

113122
#### Currently supported Boards
@@ -116,9 +125,9 @@ This [**WebServer_ESP32_SC_W5500** library](https://github.com/khoih-prog/WebSer
116125

117126
1. **ESP32_S3 boards** using `LwIP W5500 Ethernet`
118127
2. **ESP32_S2 boards** using `LwIP W5500 Ethernet`
128+
3. **ESP32_C3 boards** using `LwIP W5500 Ethernet`
119129

120-
Hopefully the `ESP32_C3-based` boards will be supported in the near future to use `LwIP W5500 or ENC28J60 Ethernet`
121-
130+
---
122131

123132
#### ESP32S2_DEV
124133

@@ -132,6 +141,14 @@ This [**WebServer_ESP32_SC_W5500** library](https://github.com/khoih-prog/WebSer
132141
<img src="https://github.com/khoih-prog/WebServer_ESP32_SC_W5500/raw/main/pics/ESP32S3_DEV.png">
133142
</p>
134143

144+
#### ESP32C3_DEV
145+
146+
<p align="center">
147+
<img src="https://github.com/khoih-prog/WebServer_ESP32_SC_W5500/raw/main/pics/ESP32_C3_DevKitC_02.png">
148+
</p>
149+
150+
---
151+
135152
#### W5500
136153

137154
<p align="center">
@@ -417,7 +434,7 @@ size_t streamFile();
417434
---
418435
---
419436

420-
### How to connect W5500 to ESP32_S2/S3
437+
### How to connect W5500 to ESP32_S2/S3/C3
421438

422439
You can change the `INT` pin to another one. Default is `GPIO4`
423440

@@ -479,6 +496,27 @@ You can change the `INT` pin to another one. Default is `GPIO4`
479496
|GND|<--->|GND|
480497
|3.3V|<--->|3.3V|
481498

499+
---
500+
501+
502+
#### ESP32C3_DEV
503+
504+
<p align="center">
505+
<img src="https://github.com/khoih-prog/WebServer_ESP32_SC_W5500/raw/main/pics/ESP32_C3_DevKitC_02.png">
506+
</p>
507+
508+
509+
|W5500|<--->|ESP32_C3|
510+
|:-:|:-:|:-:|
511+
|MOSI|<--->|GPIO6|
512+
|MISO|<--->|GPIO5|
513+
|SCK|<--->|GPIO4|
514+
|SS|<--->|GPIO7|
515+
|INT|<--->|GPIO10|
516+
|RST|<--->|RST|
517+
|GND|<--->|GND|
518+
|3.3V|<--->|3.3V|
519+
482520

483521
---
484522
---
@@ -803,6 +841,39 @@ HTTP EthernetWebServer is @ IP : 192.168.2.133
803841
...
804842
```
805843
844+
---
845+
846+
847+
#### 8. AdvancedWebServer on ESP32C3_DEV with ESP32_C3_W5500
848+
849+
The following are debug terminal output and screen shot when running example [AdvancedWebServer](examples/AdvancedWebServer) on `ESP32C3_DEV` with `ESP32_C3_W5500`. The `built-in MAC address` is used now instead of user-defined one.
850+
851+
<p align="center">
852+
<img src="https://github.com/khoih-prog/WebServer_ESP32_SC_W5500/raw/main/pics/AdvancedWebServer_ESP32_C3.png">
853+
</p>
854+
855+
856+
```cpp
857+
Start AdvancedWebServer on ESP32C3_DEV with ESP32_C3_W5500
858+
WebServer_ESP32_C3_W5500 v1.2.0 for core v2.0.0+
859+
[EWS] Default SPI pinout:
860+
[EWS] SPI_HOST: 1
861+
[EWS] MOSI: 6
862+
[EWS] MISO: 5
863+
[EWS] SCK: 4
864+
[EWS] CS: 7
865+
[EWS] INT: 10
866+
[EWS] SPI Clock (MHz): 25
867+
[EWS] =========================
868+
Using built-in mac_eth = 7C:DF:A1:BC:BC:53
869+
870+
ETH Started
871+
ETH Connected
872+
ETH MAC: 7C:DF:A1:BC:BC:53, IPv4: 192.168.2.135
873+
FULL_DUPLEX, 100Mbps
874+
HTTP EthernetWebServer is @ IP : 192.168.2.135
875+
...
876+
```
806877

807878
---
808879
---
@@ -838,16 +909,17 @@ Submit issues to: [WebServer_ESP32_SC_W5500 issues](https://github.com/khoih-pro
838909
### TO DO
839910

840911
1. Bug Searching and Killing
841-
2. Add support to **ESP32_C3-based boards** using `LwIP W5500 Ethernet`
842-
3. Add support to **ESP32_S2 and ESP32_C3-based boards** using `LwIP ENC28J60 Ethernet`
912+
843913

844914
### DONE
845915

846916
1. Add support to **ESP32S3-based boards** using `LwIP W5500 Ethernet`
847917
2. Using `SPI_DMA_CH_AUTO` instead of manually selected
848918
3. Add example [multiFileProject](https://github.com/khoih-prog/WebServer_ESP32_SC_W5500/tree/main/examples/multiFileProject)
849919
4. Add support to **ESP32S2-based boards** using `LwIP W5500 Ethernet`
850-
920+
5. Add support to **ESP32_C3-based boards** using `LwIP W5500 Ethernet`
921+
922+
851923
---
852924
---
853925

changelog.md

+5
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616

1717
* [Changelog](#changelog)
18+
* [Releases v1.2.0](#releases-v120)
1819
* [Releases v1.1.0](#releases-v110)
1920
* [Releases v1.0.1](#releases-v101)
2021
* [Releases v1.0.0](#releases-v100)
@@ -24,6 +25,10 @@
2425

2526
## Changelog
2627

28+
#### Releases v1.2.0
29+
30+
1. Add support to ESP32_C3-based boards using `LwIP W5500 Ethernet`
31+
2732
#### Releases v1.1.0
2833

2934
1. Add support to ESP32_S2-based boards using `LwIP W5500 Ethernet`

examples/AdvancedWebServer/AdvancedWebServer.ino

+14
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,20 @@
6262
//#define SCK_GPIO 12
6363
//#define CS_GPIO 10
6464

65+
// For ESP32_C3
66+
// Optional values to override default settings
67+
// Don't change unless you know what you're doing
68+
//#define ETH_SPI_HOST SPI2_HOST
69+
//#define SPI_CLOCK_MHZ 25
70+
71+
// Must connect INT to GPIOxx or not working
72+
//#define INT_GPIO 4
73+
74+
//#define MISO_GPIO 13
75+
//#define MOSI_GPIO 11
76+
//#define SCK_GPIO 12
77+
//#define CS_GPIO 10
78+
6579
//////////////////////////////////////////////////////////
6680

6781
#include <WebServer_ESP32_SC_W5500.h>

library.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"name": "WebServer_ESP32_SC_W5500",
3-
"version": "1.1.0",
3+
"version": "1.2.0",
44
"keywords": "WebServer, Ethernet, MQTT, MQTTS, HTTP, HTTPS, SSL, Arduino, ESP32, ESP32-S3, ESP32-S2, ESP32-C3, W5500, HTTP-Client, WebSocket-Client, MQTT-Client, server, client, websocket, LittleFS, SPIFFS, ThingStream",
5-
"description": "Simple Ethernet WebServer, HTTP/HTTPS Client wrapper library for ESP32_S2, S3 and C3 boards using W5500 with LwIP Ethernet library. The WebServer supports HTTP(S) GET and POST requests, provides argument parsing, handles one client at a time. It provides HTTP(S), MQTT(S) Client and supports WebServer serving from LittleFS/SPIFFS",
5+
"description": "Simple Ethernet WebServer, HTTP/HTTPS Client wrapper library for ESP32S2/S3/C3 boards using LwIP W5500 Ethernet library. The WebServer supports HTTP(S) GET and POST requests, provides argument parsing, handles one client at a time. It provides HTTP(S), MQTT(S) Client, supports WebServer serving from LittleFS/SPIFFS and is the base for many Async-related libraries",
66
"authors":
77
{
88
"name": "Khoi Hoang",

library.properties

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
name=WebServer_ESP32_SC_W5500
2-
version=1.1.0
2+
version=1.2.0
33
author=Khoi Hoang
44
license=GPLv3
55
maintainer=Khoi Hoang <[email protected]>
6-
sentence=Simple Ethernet WebServer, HTTP/HTTPS Client wrapper library for ESP32 boards using W5500 with LwIP Ethernet library.
7-
paragraph=The WebServer supports HTTP(S) GET and POST requests, provides argument parsing, handles one client at a time. It provides HTTP(S), MQTT(S) Client and supports WebServer serving from LittleFS/SPIFFS
6+
sentence=Simple Ethernet WebServer, HTTP/HTTPS Client wrapper library for ESP32S2/S3/C3 boards using LwIP W5500 Ethernet library.
7+
paragraph=The WebServer supports HTTP(S) GET and POST requests, provides argument parsing, handles one client at a time. It provides HTTP(S), MQTT(S) Client, supports WebServer serving from LittleFS/SPIFFS and is the base for many Async-related libraries
88
category=Communication
99
url=https://github.com/khoih-prog/WebServer_ESP32_SC_W5500
1010
architectures=esp32

pics/AdvancedWebServer_ESP32_C3.png

24.1 KB
Loading

pics/ESP32_C3_DevKitC_02.png

205 KB
Loading

src/WebServer_ESP32_SC_W5500.h

+7-6
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,14 @@
99
Built by Khoi Hoang https://github.com/khoih-prog/WebServer_ESP32_SC_W5500
1010
Licensed under GPLv3 license
1111
12-
Version: 1.1.0
12+
Version: 1.2.0
1313
1414
Version Modified By Date Comments
1515
------- ----------- ---------- -----------
1616
1.0.0 K Hoang 13/12/2022 Initial coding for ESP32_S3_W5500 (ESP32_S3 + W5500)
1717
1.0.1 K Hoang 14/12/2022 Using SPI_DMA_CH_AUTO instead of manually selected
18-
1.1.0 K Hoang 19/12/2022 dd support to ESP32_S2_W5500 (ESP32_S2 + W5500)
18+
1.1.0 K Hoang 19/12/2022 Add support to ESP32_S2_W5500 (ESP32_S2 + W5500)
19+
1.2.0 K Hoang 20/12/2022 Add support to ESP32_C3_W5500 (ESP32_C3 + W5500)
1920
*****************************************************************************************************************************/
2021

2122
#pragma once
@@ -32,22 +33,22 @@
3233
#warning Using code for ESP32 core v2.0.0+ in WebServer_ESP32_SC_W5500.h
3334
#endif
3435

35-
#define WEBSERVER_ESP32_SC_W5500_VERSION "WebServer_ESP32_SC_W5500 v1.1.0 for core v2.0.0+"
36+
#define WEBSERVER_ESP32_SC_W5500_VERSION "WebServer_ESP32_SC_W5500 v1.2.0 for core v2.0.0+"
3637
#else
3738
#if (_ETHERNET_WEBSERVER_LOGLEVEL_ > 3)
3839
#warning Using code for ESP32 core v1.0.6- in WebServer_ESP32_SC_W5500.h
3940
#endif
4041

41-
#define WEBSERVER_ESP32_SC_W5500_VERSION "WebServer_ESP32_SC_W5500 v1.1.0 for core v1.0.6-"
42+
#define WEBSERVER_ESP32_SC_W5500_VERSION "WebServer_ESP32_SC_W5500 v1.2.0 for core v1.0.6-"
4243
#endif
4344

4445
//////////////////////////////////////////////////////////////
4546

4647
#define WEBSERVER_ESP32_SC_W5500_VERSION_MAJOR 1
47-
#define WEBSERVER_ESP32_SC_W5500_VERSION_MINOR 1
48+
#define WEBSERVER_ESP32_SC_W5500_VERSION_MINOR 2
4849
#define WEBSERVER_ESP32_SC_W5500_VERSION_PATCH 0
4950

50-
#define WEBSERVER_ESP32_SC_W5500_VERSION_INT 1001000
51+
#define WEBSERVER_ESP32_SC_W5500_VERSION_INT 1002000
5152

5253
/////////////////////////////////////////////////////////////
5354

src/WebServer_ESP32_SC_W5500.hpp

+8-7
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,14 @@
99
Built by Khoi Hoang https://github.com/khoih-prog/WebServer_ESP32_SC_W5500
1010
Licensed under GPLv3 license
1111
12-
Version: 1.1.0
12+
Version: 1.2.0
1313
1414
Version Modified By Date Comments
1515
------- ----------- ---------- -----------
1616
1.0.0 K Hoang 13/12/2022 Initial coding for ESP32_S3_W5500 (ESP32_S3 + W5500)
1717
1.0.1 K Hoang 14/12/2022 Using SPI_DMA_CH_AUTO instead of manually selected
18-
1.1.0 K Hoang 19/12/2022 dd support to ESP32_S2_W5500 (ESP32_S2 + W5500)
18+
1.1.0 K Hoang 19/12/2022 Add support to ESP32_S2_W5500 (ESP32_S2 + W5500)
19+
1.2.0 K Hoang 20/12/2022 Add support to ESP32_C3_W5500 (ESP32_C3 + W5500)
1920
*****************************************************************************************************************************/
2021

2122
#pragma once
@@ -56,7 +57,7 @@
5657
#define SHIELD_TYPE "ESP32_C3_W5500"
5758
#endif
5859

59-
#error ESP32_C3 not supported yet
60+
//#error ESP32_C3 not supported yet
6061

6162
#elif ( defined(ARDUINO_ESP32S3_DEV) || defined(ARDUINO_ESP32_S3_BOX) || defined(ARDUINO_TINYS3) || \
6263
defined(ARDUINO_PROS3) || defined(ARDUINO_FEATHERS3) )
@@ -126,7 +127,7 @@
126127
#elif USING_ESP32_S2
127128

128129
#if !defined(ETH_SPI_HOST)
129-
// Using SPI2 for ESP32_SC, but name is SPI3_HOST
130+
// Using SPI1 for ESP32_SC, but name is SPI2_HOST
130131
#define ETH_SPI_HOST SPI3_HOST
131132
#endif
132133

@@ -161,7 +162,7 @@
161162

162163
#if !defined(ETH_SPI_HOST)
163164
// Using SPI2 for ESP32_SC, but name is SPI3_HOST
164-
#define ETH_SPI_HOST SPI3_HOST
165+
#define ETH_SPI_HOST SPI2_HOST
165166
#endif
166167

167168
#if !defined(SPI_CLOCK_MHZ)
@@ -170,7 +171,7 @@
170171
#endif
171172

172173
#if !defined(INT_GPIO)
173-
#define INT_GPIO 4
174+
#define INT_GPIO 10
174175
#endif
175176

176177
#if !defined(MISO_GPIO)
@@ -182,7 +183,7 @@
182183
#endif
183184

184185
#if !defined(SCK_GPIO)
185-
#define SCK_GPIO
186+
#define SCK_GPIO 4
186187
#endif
187188

188189
#if !defined(CS_GPIO)

src/WebServer_ESP32_SC_W5500_Debug.h

+3-2
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,14 @@
99
Built by Khoi Hoang https://github.com/khoih-prog/WebServer_ESP32_SC_W5500
1010
Licensed under GPLv3 license
1111
12-
Version: 1.1.0
12+
Version: 1.2.0
1313
1414
Version Modified By Date Comments
1515
------- ----------- ---------- -----------
1616
1.0.0 K Hoang 13/12/2022 Initial coding for ESP32_S3_W5500 (ESP32_S3 + W5500)
1717
1.0.1 K Hoang 14/12/2022 Using SPI_DMA_CH_AUTO instead of manually selected
18-
1.1.0 K Hoang 19/12/2022 dd support to ESP32_S2_W5500 (ESP32_S2 + W5500)
18+
1.1.0 K Hoang 19/12/2022 Add support to ESP32_S2_W5500 (ESP32_S2 + W5500)
19+
1.2.0 K Hoang 20/12/2022 Add support to ESP32_C3_W5500 (ESP32_C3 + W5500)
1920
*****************************************************************************************************************************/
2021

2122
#pragma once

src/WebServer_ESP32_SC_W5500_Impl.h

+3-2
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,14 @@
99
Built by Khoi Hoang https://github.com/khoih-prog/WebServer_ESP32_SC_W5500
1010
Licensed under GPLv3 license
1111
12-
Version: 1.1.0
12+
Version: 1.2.0
1313
1414
Version Modified By Date Comments
1515
------- ----------- ---------- -----------
1616
1.0.0 K Hoang 13/12/2022 Initial coding for ESP32_S3_W5500 (ESP32_S3 + W5500)
1717
1.0.1 K Hoang 14/12/2022 Using SPI_DMA_CH_AUTO instead of manually selected
18-
1.1.0 K Hoang 19/12/2022 dd support to ESP32_S2_W5500 (ESP32_S2 + W5500)
18+
1.1.0 K Hoang 19/12/2022 Add support to ESP32_S2_W5500 (ESP32_S2 + W5500)
19+
1.2.0 K Hoang 20/12/2022 Add support to ESP32_C3_W5500 (ESP32_C3 + W5500)
1920
*****************************************************************************************************************************/
2021

2122
#pragma once

src/w5500/esp32_sc_w5500.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,14 @@
99
Built by Khoi Hoang https://github.com/khoih-prog/WebServer_ESP32_SC_W5500
1010
Licensed under GPLv3 license
1111
12-
Version: 1.1.0
12+
Version: 1.2.0
1313
1414
Version Modified By Date Comments
1515
------- ----------- ---------- -----------
1616
1.0.0 K Hoang 13/12/2022 Initial coding for ESP32_S3_W5500 (ESP32_S3 + W5500)
1717
1.0.1 K Hoang 14/12/2022 Using SPI_DMA_CH_AUTO instead of manually selected
18-
1.1.0 K Hoang 19/12/2022 dd support to ESP32_S2_W5500 (ESP32_S2 + W5500)
18+
1.1.0 K Hoang 19/12/2022 Add support to ESP32_S2_W5500 (ESP32_S2 + W5500)
19+
1.2.0 K Hoang 20/12/2022 Add support to ESP32_C3_W5500 (ESP32_C3 + W5500)
1920
*****************************************************************************************************************************/
2021

2122
#define _ETHERNET_WEBSERVER_LOGLEVEL_ 1

src/w5500/esp32_sc_w5500.h

+3-2
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,14 @@
99
Built by Khoi Hoang https://github.com/khoih-prog/WebServer_ESP32_SC_W5500
1010
Licensed under GPLv3 license
1111
12-
Version: 1.1.0
12+
Version: 1.2.0
1313
1414
Version Modified By Date Comments
1515
------- ----------- ---------- -----------
1616
1.0.0 K Hoang 13/12/2022 Initial coding for ESP32_S3_W5500 (ESP32_S3 + W5500)
1717
1.0.1 K Hoang 14/12/2022 Using SPI_DMA_CH_AUTO instead of manually selected
18-
1.1.0 K Hoang 19/12/2022 dd support to ESP32_S2_W5500 (ESP32_S2 + W5500)
18+
1.1.0 K Hoang 19/12/2022 Add support to ESP32_S2_W5500 (ESP32_S2 + W5500)
19+
1.2.0 K Hoang 20/12/2022 Add support to ESP32_C3_W5500 (ESP32_C3 + W5500)
1920
*****************************************************************************************************************************/
2021

2122
#ifndef _ESP32_W5500_H_

0 commit comments

Comments
 (0)