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

Commit 1a11f36

Browse files
authored
v1.1.0 for ESP32_S2
#### Releases v1.1.0 1. Add support to ESP32_S2-based boards using `LwIP ENC28J60 Ethernet`
1 parent 70fb7ac commit 1a11f36

29 files changed

+278
-101
lines changed

README.md

Lines changed: 108 additions & 32 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 ENC28J60 to ESP32_S3](#How-to-connect-ENC28J60-to-ESP32_S3)
38+
* [How to connect ENC28J60 to ESP32_S2/S3](#How-to-connect-ENC28J60-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_ENC28J60](#4-MQTTClient_Basic-on-ESP32S3_DEV-with-ESP32_S3_ENC28J60)
6363
* [ 5. WebClient on ESP32S3_DEV with ESP32_S3_ENC28J60](#5-WebClient-on-ESP32S3_DEV-with-ESP32_S3_ENC28J60)
6464
* [ 6. UDPSendReceive on ESP32S3_DEV with ESP32_S3_ENC28J60](#6-UDPSendReceive-on-ESP32S3_DEV-with-ESP32_S3_ENC28J60)
65+
* [ 7. UdpNTPClient on ESP32S2_DEV with ESP32_S2_ENC28J60](#7-UdpNTPClient-on-ESP32S2_DEV-with-ESP32_S2_ENC28J60)
6566
* [Debug](#debug)
6667
* [Troubleshooting](#troubleshooting)
6768
* [Releases](#releases)
@@ -103,7 +104,7 @@ Please also check these twin libraries
103104
1. [WebServer_WT32_ETH01](https://github.com/khoih-prog/WebServer_WT32_ETH01) for ESP32-based `WT32_ETH01` using `LwIP LAN8720`
104105
2. [WebServer_ESP32_ENC](https://github.com/khoih-prog/WebServer_ESP32_ENC) for ESP32-boards using `LwIP ENC28J60`
105106
3. [WebServer_ESP32_W5500](https://github.com/khoih-prog/WebServer_ESP32_W5500) for ESP32-boards using `LwIP W5500`
106-
3. [WebServer_ESP32_SC_W5500](https://github.com/khoih-prog/WebServer_ESP32_SC_W5500) for ESP32_S3-boards using `LwIP W5500`
107+
4. [WebServer_ESP32_SC_W5500](https://github.com/khoih-prog/WebServer_ESP32_SC_W5500) for ESP32_S3-boards using `LwIP W5500`
107108

108109
---
109110

@@ -112,17 +113,26 @@ Please also check these twin libraries
112113
This [**WebServer_ESP32_SC_ENC** library](https://github.com/khoih-prog/WebServer_ESP32_SC_ENC) currently supports these following boards:
113114

114115
1. **ESP32_S3 boards** using `LwIP ENC28J60 Ethernet`
116+
2. **ESP32_S2 boards** using `LwIP ENC28J60 Ethernet`
115117

118+
Hopefully the `ESP32_C3-based` boards will be supported in the near future to use `LwIP W5500 or ENC28J60 Ethernet`
119+
120+
121+
122+
#### ESP32S2_DEV
123+
124+
<p align="center">
125+
<img src="https://github.com/khoih-prog/WebServer_ESP32_SC_ENC/raw/main/pics/ESP32S3_DEV.png">
126+
</p>
116127

117-
Hopefully the `ESP32_S2` and `ESP32_C3-based` boards will be supported in the near future to use `LwIP W5500 or ENC28J60 Ethernet`
118-
119128

120129
#### ESP32S3_DEV
121130

122131
<p align="center">
123132
<img src="https://github.com/khoih-prog/WebServer_ESP32_SC_ENC/raw/main/pics/ESP32S3_DEV.png">
124133
</p>
125134

135+
126136
#### ENC28J60
127137

128138
<p align="center">
@@ -254,7 +264,7 @@ Look in file [**adc_common.c**](https://github.com/espressif/esp-idf/blob/master
254264
### Class Constructor
255265

256266
```cpp
257-
WebServer server(80);
267+
WebServer server(80);
258268
```
259269
260270
Creates the `WebServer_ESP32_SC_ENC` class object.
@@ -409,7 +419,7 @@ size_t streamFile();
409419
---
410420
---
411421

412-
### How to connect ENC28J60 to ESP32_S3
422+
### How to connect W5500 to ESP32_S2/S3
413423

414424
You can change the `INT` pin to another one. Default is `GPIO4`
415425

@@ -421,18 +431,20 @@ You can change the `INT` pin to another one. Default is `GPIO4`
421431
---
422432

423433

424-
#### ESP32S3_DEV
425-
426-
<p align="center">
427-
<img src="https://github.com/khoih-prog/WebServer_ESP32_SC_ENC/raw/main/pics/ESP32S3_DEV.png">
428-
</p>
429-
430434
#### ENC28J60
431435

432436
<p align="center">
433437
<img src="https://github.com/khoih-prog/WebServer_ESP32_SC_ENC/raw/main/pics/ENC28J60.png">
434438
</p>
435439

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

437449
|ENC28J60|<--->|ESP32_S3|
438450
|:-:|:-:|:-:|
@@ -445,6 +457,28 @@ You can change the `INT` pin to another one. Default is `GPIO4`
445457
|3.3V|<--->|3.3V|
446458

447459

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

@@ -495,8 +529,9 @@ The following are debug terminal output and screen shot when running example [Ad
495529

496530
```cpp
497531
Start AdvancedWebServer on ESP32S3_DEV with ESP32_S3_ENC28J60
498-
WebServer_ESP32_SC_ENC v1.0.0 for core v2.0.0+
532+
WebServer_ESP32_SC_ENC v1.1.0 for core v2.0.0+
499533
[EWS] Default SPI pinout:
534+
[EWS] SPI_HOST: 1
500535
[EWS] MOSI: 11
501536
[EWS] MISO: 13
502537
[EWS] SCK: 12
@@ -521,8 +556,9 @@ The terminal output of **ESP32S3_DEV with ENC28J60** running [MQTT_ThingStream e
521556
522557
```cpp
523558
Start MQTT_ThingStream on ESP32S3_DEV with ESP32_S3_ENC28J60
524-
WebServer_ESP32_SC_ENC v1.0.0 for core v2.0.0+
559+
WebServer_ESP32_SC_ENC v1.1.0 for core v2.0.0+
525560
[EWS] Default SPI pinout:
561+
[EWS] SPI_HOST: 1
526562
[EWS] MOSI: 11
527563
[EWS] MISO: 13
528564
[EWS] SCK: 12
@@ -559,8 +595,9 @@ The terminal output of **ESP32S3_DEV with ENC28J60** running [MQTTClient_Auth ex
559595

560596
```cpp
561597
Start MQTTClient_Auth on ESP32S3_DEV with ESP32_S3_ENC28J60
562-
WebServer_ESP32_SC_ENC v1.0.0 for core v2.0.0+
598+
WebServer_ESP32_SC_ENC v1.1.0 for core v2.0.0+
563599
[EWS] Default SPI pinout:
600+
[EWS] SPI_HOST: 1
564601
[EWS] MOSI: 11
565602
[EWS] MISO: 13
566603
[EWS] SCK: 12
@@ -572,7 +609,7 @@ WebServer_ESP32_SC_ENC v1.0.0 for core v2.0.0+
572609
ETH Started
573610
ETH Connected
574611
ETH MAC: DE:AD:BE:EF:BE:0E, IPv4: 192.168.2.106
575-
FULL_DUPLEX, 100Mbps
612+
FULL_DUPLEX, 10Mbps
576613
Message Send : MQTT_Pub => Hello from MQTTClient_Auth on ESP32S3_DEV with ESP32_S3_ENC28J60
577614
Message arrived [MQTT_Pub] Hello from MQTTClient_Auth on ESP32S3_DEV with ESP32_S3_ENC28J60
578615
Message Send : MQTT_Pub => Hello from MQTTClient_Auth on ESP32S3_DEV with ESP32_S3_ENC28J60
@@ -587,8 +624,9 @@ The terminal output of **ESP32S3_DEV with ENC28J60** running [MQTTClient_Basic e
587624
588625
```cpp
589626
Start MQTTClient_Basic on ESP32S3_DEV with ESP32_S3_ENC28J60
590-
WebServer_ESP32_SC_ENC v1.0.0 for core v2.0.0+
627+
WebServer_ESP32_SC_ENC v1.1.0 for core v2.0.0+
591628
[EWS] Default SPI pinout:
629+
[EWS] SPI_HOST: 1
592630
[EWS] MOSI: 11
593631
[EWS] MISO: 13
594632
[EWS] SCK: 12
@@ -600,7 +638,7 @@ WebServer_ESP32_SC_ENC v1.0.0 for core v2.0.0+
600638
ETH Started
601639
ETH Connected
602640
ETH MAC: DE:AD:BE:EF:BE:0E, IPv4: 192.168.2.106
603-
FULL_DUPLEX, 100Mbps
641+
FULL_DUPLEX, 10Mbps
604642
Message Send : MQTT_Pub => Hello from MQTTClient_Basic on ESP32S3_DEV with ESP32_S3_ENC28J60
605643
Message arrived [MQTT_Pub] Hello from MQTTClient_Basic on ESP32S3_DEV with ESP32_S3_ENC28J60
606644
Message Send : MQTT_Pub => Hello from MQTTClient_Basic on ESP32S3_DEV with ESP32_S3_ENC28J60
@@ -616,8 +654,9 @@ The terminal output of **ESP32S3_DEV with ENC28J60** running [WebClient example]
616654

617655
```cpp
618656
Start WebClient on ESP32S3_DEV with ESP32_S3_ENC28J60
619-
WebServer_ESP32_SC_ENC v1.0.0 for core v2.0.0+
657+
WebServer_ESP32_SC_ENC v1.1.0 for core v2.0.0+
620658
[EWS] Default SPI pinout:
659+
[EWS] SPI_HOST: 1
621660
[EWS] MOSI: 11
622661
[EWS] MISO: 13
623662
[EWS] SCK: 12
@@ -629,7 +668,7 @@ WebServer_ESP32_SC_ENC v1.0.0 for core v2.0.0+
629668
ETH Started
630669
ETH Connected
631670
ETH MAC: DE:AD:BE:EF:BE:0A, IPv4: 192.168.2.98
632-
FULL_DUPLEX, 100Mbps
671+
FULL_DUPLEX, 10Mbps
633672

634673
Starting connection to server...
635674
Connected to server
@@ -701,8 +740,9 @@ The terminal output of **ESP32S3_DEV with ENC28J60** running [UDPSendReceive exa
701740
702741
```cpp
703742
Start UDPSendReceive on ESP32S3_DEV with ESP32_S3_ENC28J60
704-
WebServer_ESP32_SC_ENC v1.0.0 for core v2.0.0+
743+
WebServer_ESP32_SC_ENC v1.1.0 for core v2.0.0+
705744
[EWS] Default SPI pinout:
745+
[EWS] SPI_HOST: 1
706746
[EWS] MOSI: 11
707747
[EWS] MISO: 13
708748
[EWS] SCK: 12
@@ -720,21 +760,56 @@ Starting connection to server...
720760
Listening on port 2390
721761
UDP Packet received, size 48
722762
From 132.163.97.3, port 123
723-
Seconds since Jan 1 1900 = 3880030042
724-
Unix time = 1671041242
725-
The UTC time is 18:07:22
763+
Seconds since Jan 1 1900 = 3880480438
764+
Unix time = 1671491638
765+
The UTC time is 23:13:58
726766
UDP Packet received, size 48
727767
From 132.163.97.3, port 123
728-
Seconds since Jan 1 1900 = 3880030054
729-
Unix time = 1671041254
730-
The UTC time is 18:07:34
768+
Seconds since Jan 1 1900 = 3880480450
769+
Unix time = 1671491650
770+
The UTC time is 23:14:10
771+
```
772+
773+
774+
---
775+
776+
#### 7. UdpNTPClient on ESP32S2_DEV with ESP32_S2_ENC28J60
777+
778+
The terminal output of **ESP32S2_DEV with ENC28J60** running [UdpNTPClient example](examples/UdpNTPClient). The `built-in MAC address` is used now instead of user-defined one.
779+
780+
781+
782+
```cpp
783+
Start UdpNTPClient on ESP32S2_DEV with ESP32_S2_ENC28J60
784+
WebServer_ESP32_SC_ENC v1.1.0 for core v2.0.0+
785+
[EWS] Default SPI pinout:
786+
[EWS] SPI_HOST: 1
787+
[EWS] MOSI: 35
788+
[EWS] MISO: 37
789+
[EWS] SCK: 36
790+
[EWS] CS: 34
791+
[EWS] INT: 4
792+
[EWS] SPI Clock (MHz): 8
793+
[EWS] =========================
794+
Using built-in mac_eth = 7E:DF:A1:08:64:27
795+
796+
ETH Started
797+
ETH Connected
798+
ETH MAC: 7E:DF:A1:08:64:27, IPv4: 192.168.2.232
799+
FULL_DUPLEX, 10Mbps
731800
UDP Packet received, size 48
732801
From 132.163.97.3, port 123
733-
Seconds since Jan 1 1900 = 3880030066
734-
Unix time = 1671041266
735-
The UTC time is 18:07:46
802+
Seconds since Jan 1 1900 = 3880480414
803+
Unix time = 1671491614
804+
The UTC time is 23:13:34
805+
UDP Packet received, size 48
806+
From 132.163.97.3, port 123
807+
Seconds since Jan 1 1900 = 3880480426
808+
Unix time = 1671491626
809+
The UTC time is 23:13:46
736810
```
737811
812+
738813
---
739814
---
740815
@@ -769,12 +844,13 @@ Submit issues to: [WebServer_ESP32_SC_ENC issues](https://github.com/khoih-prog/
769844
### TO DO
770845

771846
1. Bug Searching and Killing
772-
2. Add support to **ESP32_S2 and ESP32_C3-based boards** using `LwIP W5500 Ethernet`
773-
3. Add support to **ESP32_S2 and ESP32_C3-based boards** using `LwIP ENC28J60 Ethernet`
847+
2. Add support to **ESP32_C3-based boards** using `LwIP W5500 or ENC28J60 Ethernet`
848+
774849

775850
### DONE
776851

777852
1. Add support to **ESP32S3-based boards** using `LwIP ENC28J60 Ethernet`
853+
2. Add support to **ESP32S2-based boards** using `LwIP ENC28J60 Ethernet`
778854

779855
---
780856
---

changelog.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,18 @@
1515

1616

1717
* [Changelog](#changelog)
18+
* [Releases v1.1.0](#releases-v110)
1819
* [Releases v1.0.0](#releases-v100)
1920

2021
---
2122
---
2223

2324
## Changelog
2425

26+
#### Releases v1.1.0
27+
28+
1. Add support to ESP32_S2-based boards using `LwIP ENC28J60 Ethernet`
29+
2530
#### Releases v1.0.0
2631

2732
1. Initial coding to support ESP32_S3-based boards using `LwIP ENC28J60 Ethernet`.

examples/AdvancedWebServer/AdvancedWebServer.ino

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
//////////////////////////////////////////////////////////
5151

5252
// Optional values to override default settings
53-
//#define SPI_HOST 1
53+
//#define ETH_SPI_HOST SPI2_HOST
5454
//#define SPI_CLOCK_MHZ 8
5555

5656
// Must connect INT to GPIOxx or not working
@@ -195,6 +195,7 @@ void setup()
195195
Serial.println(WEBSERVER_ESP32_SC_ENC_VERSION);
196196

197197
ET_LOGWARN(F("Default SPI pinout:"));
198+
ET_LOGWARN1(F("SPI_HOST:"), ETH_SPI_HOST);
198199
ET_LOGWARN1(F("MOSI:"), MOSI_GPIO);
199200
ET_LOGWARN1(F("MISO:"), MISO_GPIO);
200201
ET_LOGWARN1(F("SCK:"), SCK_GPIO);
@@ -214,8 +215,8 @@ void setup()
214215

215216
//bool begin(int MISO_GPIO, int MOSI_GPIO, int SCLK_GPIO, int CS_GPIO, int INT_GPIO, int SPI_CLOCK_MHZ,
216217
// int SPI_HOST, uint8_t *ENC28J60_Mac = ENC28J60_Default_Mac);
217-
//ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, SPI_HOST );
218-
ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, SPI_HOST, mac[index] );
218+
//ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, ETH_SPI_HOST );
219+
ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, ETH_SPI_HOST, mac[index] );
219220

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

examples/HelloServer/HelloServer.ino

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ void setup()
118118
Serial.println(WEBSERVER_ESP32_SC_ENC_VERSION);
119119

120120
ET_LOGWARN(F("Default SPI pinout:"));
121+
ET_LOGWARN1(F("SPI_HOST:"), ETH_SPI_HOST);
121122
ET_LOGWARN1(F("MOSI:"), MOSI_GPIO);
122123
ET_LOGWARN1(F("MISO:"), MISO_GPIO);
123124
ET_LOGWARN1(F("SCK:"), SCK_GPIO);
@@ -137,8 +138,8 @@ void setup()
137138

138139
//bool begin(int MISO_GPIO, int MOSI_GPIO, int SCLK_GPIO, int CS_GPIO, int INT_GPIO, int SPI_CLOCK_MHZ,
139140
// int SPI_HOST, uint8_t *ENC28J60_Mac = ENC28J60_Default_Mac);
140-
//ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, SPI_HOST );
141-
ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, SPI_HOST, mac[index] );
141+
//ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, ETH_SPI_HOST );
142+
ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, ETH_SPI_HOST, mac[index] );
142143

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

examples/HelloServer2/HelloServer2.ino

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ void setup()
118118
Serial.println(WEBSERVER_ESP32_SC_ENC_VERSION);
119119

120120
ET_LOGWARN(F("Default SPI pinout:"));
121+
ET_LOGWARN1(F("SPI_HOST:"), ETH_SPI_HOST);
121122
ET_LOGWARN1(F("MOSI:"), MOSI_GPIO);
122123
ET_LOGWARN1(F("MISO:"), MISO_GPIO);
123124
ET_LOGWARN1(F("SCK:"), SCK_GPIO);
@@ -137,8 +138,8 @@ void setup()
137138

138139
//bool begin(int MISO_GPIO, int MOSI_GPIO, int SCLK_GPIO, int CS_GPIO, int INT_GPIO, int SPI_CLOCK_MHZ,
139140
// int SPI_HOST, uint8_t *ENC28J60_Mac = ENC28J60_Default_Mac);
140-
//ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, SPI_HOST );
141-
ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, SPI_HOST, mac[index] );
141+
//ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, ETH_SPI_HOST );
142+
ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, ETH_SPI_HOST, mac[index] );
142143

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

0 commit comments

Comments
 (0)