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

Commit 72bfff9

Browse files
authored
v1.1.0 for ESP32_S2
#### Releases v1.1.0 1. Add support to ESP32_S2-based boards using `LwIP W5500 Ethernet`
1 parent 92f9d6c commit 72bfff9

16 files changed

+120
-42
lines changed

README.md

Lines changed: 79 additions & 15 deletions
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_S3](#How-to-connect-W5500-to-ESP32_S3)
38+
* [How to connect W5500 to ESP32_S2/S3](#How-to-connect-W5500-to-ESP32_S2S3)
3939
* [Examples](#examples)
4040
* [Original Examples](#original-examples)
4141
* [ 1. AdvancedWebServer](examples/AdvancedWebServer)
@@ -62,6 +62,7 @@
6262
* [ 4. MQTTClient_Basic on ESP32S3_DEV with ESP32_S3_W5500](#4-MQTTClient_Basic-on-ESP32S3_DEV-with-ESP32_S3_W5500)
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)
65+
* [ 7. AdvancedWebServer on ESP32S2_DEV with ESP32_S2_W5500](#7-AdvancedWebServer-on-ESP32S2_DEV-with-ESP32_S2_W5500)
6566
* [Debug](#debug)
6667
* [Troubleshooting](#troubleshooting)
6768
* [Releases](#releases)
@@ -98,22 +99,32 @@ Library is providing similar functions to:
9899
1. [Ivan Grokhotkov's ESP32 WebServer](https://github.com/espressif/arduino-esp32/tree/master/libraries/WebServer)
99100
2. [HTTPClient Library](https://github.com/espressif/arduino-esp32/tree/master/libraries/HTTPClient)
100101

102+
---
103+
101104
Please also check these twin libraries
102105

103106
1. [WebServer_WT32_ETH01](https://github.com/khoih-prog/WebServer_WT32_ETH01) for ESP32-based `WT32_ETH01` using `LwIP LAN8720`
104107
2. [WebServer_ESP32_ENC](https://github.com/khoih-prog/WebServer_ESP32_ENC) for ESP32-boards using `LwIP ENC28J60`
105108
3. [WebServer_ESP32_W5500](https://github.com/khoih-prog/WebServer_ESP32_W5500) for ESP32-boards using `LwIP W5500`
106109
4. [WebServer_ESP32_SC_ENC](https://github.com/khoih-prog/WebServer_ESP32_SC_ENC) for ESP32_S3-boards using `LwIP ENC28J60`
107110

111+
---
108112

109113
#### Currently supported Boards
110114

111115
This [**WebServer_ESP32_SC_W5500** library](https://github.com/khoih-prog/WebServer_ESP32_SC_W5500) currently supports these following boards:
112116

113117
1. **ESP32_S3 boards** using `LwIP W5500 Ethernet`
118+
2. **ESP32_S2 boards** using `LwIP W5500 Ethernet`
114119

115-
Hopefully the `ESP32_S2` and `ESP32_C3-based` boards will be supported in the near future to use `LwIP W5500 or ENC28J60 Ethernet`
120+
Hopefully the `ESP32_C3-based` boards will be supported in the near future to use `LwIP W5500 or ENC28J60 Ethernet`
121+
116122

123+
#### ESP32S2_DEV
124+
125+
<p align="center">
126+
<img src="https://github.com/khoih-prog/WebServer_ESP32_SC_W5500/raw/main/pics/ESP32S2_DEV.png">
127+
</p>
117128

118129
#### ESP32S3_DEV
119130

@@ -201,8 +212,6 @@ in many files. But be sure to use the following `.h` file **in just 1 `.h`, `.cp
201212

202213
Check the new [**multiFileProject** example](examples/multiFileProject) for a `HOWTO` demo.
203214

204-
205-
206215
---
207216
---
208217

@@ -253,7 +262,7 @@ Look in file [**adc_common.c**](https://github.com/espressif/esp-idf/blob/master
253262
### Class Constructor
254263

255264
```cpp
256-
WebServer server(80);
265+
WebServer server(80);
257266
```
258267
259268
Creates the `WebServer_ESP32_SC_W5500` class object.
@@ -408,7 +417,7 @@ size_t streamFile();
408417
---
409418
---
410419

411-
### How to connect W5500 to ESP32_S3
420+
### How to connect W5500 to ESP32_S2/S3
412421

413422
You can change the `INT` pin to another one. Default is `GPIO4`
414423

@@ -419,13 +428,6 @@ You can change the `INT` pin to another one. Default is `GPIO4`
419428

420429
---
421430

422-
423-
#### ESP32S3_DEV
424-
425-
<p align="center">
426-
<img src="https://github.com/khoih-prog/WebServer_ESP32_SC_W5500/raw/main/pics/ESP32S3_DEV.png">
427-
</p>
428-
429431
#### W5500
430432

431433
<p align="center">
@@ -436,6 +438,14 @@ You can change the `INT` pin to another one. Default is `GPIO4`
436438
<img src="https://github.com/khoih-prog/WebServer_ESP32_SC_W5500/raw/main/pics/W5500_small.png">
437439
</p>
438440

441+
---
442+
443+
444+
#### ESP32S3_DEV
445+
446+
<p align="center">
447+
<img src="https://github.com/khoih-prog/WebServer_ESP32_SC_W5500/raw/main/pics/ESP32S3_DEV.png">
448+
</p>
439449

440450

441451
|W5500|<--->|ESP32_S3|
@@ -449,6 +459,26 @@ You can change the `INT` pin to another one. Default is `GPIO4`
449459
|GND|<--->|GND|
450460
|3.3V|<--->|3.3V|
451461

462+
---
463+
464+
#### ESP32S2_DEV
465+
466+
<p align="center">
467+
<img src="https://github.com/khoih-prog/WebServer_ESP32_SC_W5500/raw/main/pics/ESP32S2_DEV.png">
468+
</p>
469+
470+
471+
|W5500|<--->|ESP32_S2|
472+
|:-:|:-:|:-:|
473+
|MOSI|<--->|GPIO35|
474+
|MISO|<--->|GPIO37|
475+
|SCK|<--->|GPIO36|
476+
|SS|<--->|GPIO34|
477+
|INT|<--->|GPIO4|
478+
|RST|<--->|RST|
479+
|GND|<--->|GND|
480+
|3.3V|<--->|3.3V|
481+
452482

453483
---
454484
---
@@ -740,6 +770,40 @@ Unix time = 1670996705
740770
The UTC time is 5:45:05
741771
```
742772

773+
---
774+
775+
776+
#### 7. AdvancedWebServer on ESP32S2_DEV with ESP32_S2_W5500
777+
778+
The following are debug terminal output and screen shot when running example [AdvancedWebServer](examples/AdvancedWebServer) on `ESP32S2_DEV` with `ESP32_S2_W5500`. The `built-in MAC address` is used now instead of user-defined one.
779+
780+
<p align="center">
781+
<img src="https://github.com/khoih-prog/WebServer_ESP32_SC_W5500/raw/main/pics/AdvancedWebServer_ESP32_S2.png">
782+
</p>
783+
784+
```cpp
785+
Start AdvancedWebServer on ESP32S2_DEV with ESP32_S2_W5500
786+
WebServer_ESP32_SC_W5500 v1.1.0 for core v2.0.0+
787+
[EWS] Default SPI pinout:
788+
[EWS] SPI_HOST: 2
789+
[EWS] MOSI: 35
790+
[EWS] MISO: 37
791+
[EWS] SCK: 36
792+
[EWS] CS: 34
793+
[EWS] INT: 4
794+
[EWS] SPI Clock (MHz): 25
795+
[EWS] =========================
796+
Using built-in mac_eth = 7E:DF:A1:08:32:C9
797+
798+
ETH Started
799+
ETH Connected
800+
ETH MAC: 7E:DF:A1:08:32:C9, IPv4: 192.168.2.133
801+
FULL_DUPLEX, 100Mbps
802+
HTTP EthernetWebServer is @ IP : 192.168.2.133
803+
...
804+
```
805+
806+
743807
---
744808
---
745809
@@ -774,15 +838,15 @@ Submit issues to: [WebServer_ESP32_SC_W5500 issues](https://github.com/khoih-pro
774838
### TO DO
775839

776840
1. Bug Searching and Killing
777-
2. Add support to **ESP32_S2 and ESP32_C3-based boards** using `LwIP W5500 Ethernet`
841+
2. Add support to **ESP32_C3-based boards** using `LwIP W5500 Ethernet`
778842
3. Add support to **ESP32_S2 and ESP32_C3-based boards** using `LwIP ENC28J60 Ethernet`
779843

780844
### DONE
781845

782846
1. Add support to **ESP32S3-based boards** using `LwIP W5500 Ethernet`
783847
2. Using `SPI_DMA_CH_AUTO` instead of manually selected
784848
3. Add example [multiFileProject]](https://github.com/khoih-prog/WebServer_ESP32_SC_W5500/tree/main/examples/multiFileProject)
785-
849+
4. Add support to **ESP32S2-based boards** using `LwIP W5500 Ethernet`
786850

787851
---
788852
---

changelog.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,19 @@
1515

1616

1717
* [Changelog](#changelog)
18-
* [Releases v1.0.0](#releases-v100)
18+
* [Releases v1.1.0](#releases-v110)
1919
* [Releases v1.0.1](#releases-v101)
20+
* [Releases v1.0.0](#releases-v100)
2021

2122
---
2223
---
2324

2425
## Changelog
2526

27+
#### Releases v1.1.0
28+
29+
1. Add support to ESP32_S2-based boards using `LwIP W5500 Ethernet`
30+
2631
#### Releases v1.0.1
2732

2833
1. Using `SPI_DMA_CH_AUTO` instead of manually selected

library.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "WebServer_ESP32_SC_W5500",
3-
"version": "1.0.1",
3+
"version": "1.1.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",
55
"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",
66
"authors":

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=WebServer_ESP32_SC_W5500
2-
version=1.0.1
2+
version=1.1.0
33
author=Khoi Hoang
44
license=GPLv3
55
maintainer=Khoi Hoang <[email protected]>

platformio/platformio.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ build_flags =
138138

139139

140140
; ============================================================
141-
[env:esp32sc3]
141+
[env:esp32c3]
142142
platform = espressif32
143143
framework = arduino
144144

src/WebServer_ESP32_SC_W5500.h

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,13 @@
99
Built by Khoi Hoang https://github.com/khoih-prog/WebServer_ESP32_SC_W5500
1010
Licensed under GPLv3 license
1111
12-
Version: 1.0.1
12+
Version: 1.1.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)
1819
*****************************************************************************************************************************/
1920

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

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

40-
#define WEBSERVER_ESP32_SC_W5500_VERSION "WebServer_ESP32_SC_W5500 v1.0.1 for core v1.0.6-"
41+
#define WEBSERVER_ESP32_SC_W5500_VERSION "WebServer_ESP32_SC_W5500 v1.1.0 for core v1.0.6-"
4142
#endif
4243

4344
//////////////////////////////////////////////////////////////
4445

4546
#define WEBSERVER_ESP32_SC_W5500_VERSION_MAJOR 1
46-
#define WEBSERVER_ESP32_SC_W5500_VERSION_MINOR 0
47-
#define WEBSERVER_ESP32_SC_W5500_VERSION_PATCH 1
47+
#define WEBSERVER_ESP32_SC_W5500_VERSION_MINOR 1
48+
#define WEBSERVER_ESP32_SC_W5500_VERSION_PATCH 0
4849

49-
#define WEBSERVER_ESP32_SC_W5500_VERSION_INT 1000001
50+
#define WEBSERVER_ESP32_SC_W5500_VERSION_INT 1001000
5051

5152
/////////////////////////////////////////////////////////////
5253

src/WebServer_ESP32_SC_W5500.hpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,13 @@
99
Built by Khoi Hoang https://github.com/khoih-prog/WebServer_ESP32_SC_W5500
1010
Licensed under GPLv3 license
1111
12-
Version: 1.0.1
12+
Version: 1.1.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)
1819
*****************************************************************************************************************************/
1920

2021
#pragma once
@@ -37,9 +38,7 @@
3738
#ifndef SHIELD_TYPE
3839
#define SHIELD_TYPE "ESP32_S2_W5500"
3940
#endif
40-
41-
#error ESP32_S2 not supported yet. Please use EthernetWebServer
42-
41+
4342
#elif ( ARDUINO_ESP32C3_DEV )
4443
#if (_ETHERNET_WEBSERVER_LOGLEVEL_ > 3)
4544
#if ( defined(ESP_ARDUINO_VERSION_MAJOR) && (ESP_ARDUINO_VERSION_MAJOR >= 2) )

src/WebServer_ESP32_SC_W5500_Debug.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,13 @@
99
Built by Khoi Hoang https://github.com/khoih-prog/WebServer_ESP32_SC_W5500
1010
Licensed under GPLv3 license
1111
12-
Version: 1.0.1
12+
Version: 1.1.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)
1819
*****************************************************************************************************************************/
1920

2021
#pragma once

src/WebServer_ESP32_SC_W5500_Impl.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,13 @@
99
Built by Khoi Hoang https://github.com/khoih-prog/WebServer_ESP32_SC_W5500
1010
Licensed under GPLv3 license
1111
12-
Version: 1.0.1
12+
Version: 1.1.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)
1819
*****************************************************************************************************************************/
1920

2021
#pragma once

src/w5500/esp32_sc_w5500.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,13 @@
99
Built by Khoi Hoang https://github.com/khoih-prog/WebServer_ESP32_SC_W5500
1010
Licensed under GPLv3 license
1111
12-
Version: 1.0.1
12+
Version: 1.1.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)
1819
*****************************************************************************************************************************/
1920

2021
#define _ETHERNET_WEBSERVER_LOGLEVEL_ 1
@@ -136,18 +137,18 @@ bool ESP32_W5500::begin(int MISO, int MOSI, int SCLK, int CS, int INT, int SPICL
136137
return false;
137138
}
138139

140+
#if USING_ESP32_S3
139141
eth_mac->set_addr(eth_mac, W5500_Mac);
140-
141-
#if 1
142+
#else
143+
eth_mac->set_addr(eth_mac, mac_eth);
144+
#endif
142145

143146
if ( (SPICLOCK_MHZ < 14) || (SPICLOCK_MHZ > 25) )
144147
{
145148
ET_LOGERROR("SPI Clock must be >= 14 and <= 25 MHz for W5500");
146149
ESP_ERROR_CHECK(ESP_FAIL);
147150
}
148151

149-
#endif
150-
151152
/* attach Ethernet driver to TCP/IP stack */
152153
if (esp_netif_attach(eth_netif, esp_eth_new_netif_glue(eth_handle)) != ESP_OK)
153154
{

src/w5500/esp32_sc_w5500.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,13 @@
99
Built by Khoi Hoang https://github.com/khoih-prog/WebServer_ESP32_SC_W5500
1010
Licensed under GPLv3 license
1111
12-
Version: 1.0.1
12+
Version: 1.1.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)
1819
*****************************************************************************************************************************/
1920

2021
#ifndef _ESP32_W5500_H_

0 commit comments

Comments
 (0)