From eeb018f63e857ab5ab44d1925680d2ab7bf9e619 Mon Sep 17 00:00:00 2001 From: Khoi Hoang <57012152+khoih-prog@users.noreply.github.com> Date: Mon, 19 Dec 2022 22:12:43 -0500 Subject: [PATCH] v1.7.0 to add `ESP32_S2` #### Releases v1.7.0 1. Add support to `ESP32_S2` boards using `LwIP W5500 Ethernet` --- CONTRIBUTING.md | 4 +- README.md | 143 ++++++++++++++++--- changelog.md | 5 + library.json | 2 +- library.properties | 2 +- pics/AsyncWebServer_SendChunked_ESP32_S2.png | Bin 0 -> 77677 bytes pics/ESP32S2_DEV.png | Bin 0 -> 360117 bytes src/AsyncEventSource.cpp | 3 +- src/AsyncEventSource.h | 3 +- src/AsyncJson.h | 3 +- src/AsyncWebServer_ESP32_SC_W5500.cpp | 3 +- src/AsyncWebServer_ESP32_SC_W5500.h | 27 ++-- src/AsyncWebServer_ESP32_SC_W5500_Debug.h | 3 +- src/AsyncWebSocket.cpp | 3 +- src/AsyncWebSocket.h | 3 +- src/AsyncWebSynchronization.h | 3 +- src/ESP32_W5500_SPIFFSEditor.cpp | 3 +- src/ESP32_W5500_SPIFFSEditor.h | 3 +- src/StringArray.h | 3 +- src/WebAuthentication.cpp | 3 +- src/WebAuthentication.h | 3 +- src/WebHandlerImpl.h | 3 +- src/WebHandlers.cpp | 3 +- src/WebRequest.cpp | 3 +- src/WebResponseImpl.h | 3 +- src/WebResponses.cpp | 3 +- src/WebServer.cpp | 3 +- src/w5500/esp32_sc_w5500.cpp | 19 +-- src/w5500/esp32_sc_w5500.h | 3 +- src/w5500/esp_eth/esp_eth_mac_w5500.c | 3 +- src/w5500/esp_eth/esp_eth_phy_w5500.c | 3 +- src/w5500/esp_eth/esp_eth_spi_w5500.c | 3 +- src/w5500/esp_eth/esp_eth_w5500.h | 3 +- src/w5500/esp_eth/w5500.h | 3 +- 34 files changed, 208 insertions(+), 69 deletions(-) create mode 100644 pics/AsyncWebServer_SendChunked_ESP32_S2.png create mode 100644 pics/ESP32S2_DEV.png diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 43d067b..462ff21 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -15,6 +15,7 @@ If you don't find anything, please [open a new issue](https://github.com/khoih-p 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) * Contextual information (e.g. what you were trying to achieve) * Simplest possible steps to reproduce @@ -25,12 +26,11 @@ Please ensure to specify the following: Please be educated, civilized and constructive. Disrespective posts against [GitHub Code of Conduct](https://docs.github.com/en/site-policy/github-terms/github-event-code-of-conduct) will be ignored and deleted. - ### Example ``` Arduino IDE version: 1.8.19 -ESP32_DEV board +ESP32S3_DEV board ESP32 core v2.0.5 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 diff --git a/README.md b/README.md index 32ba074..d05e16c 100644 --- a/README.md +++ b/README.md @@ -77,7 +77,7 @@ * [Methods for controlling websocket connections](#methods-for-controlling-websocket-connections) * [Adding Default Headers](#adding-default-headers) * [Path variable](#path-variable) -* [How to connect W5500 to ESP32_S3](#How-to-connect-W5500-to-ESP32_S3) +* [How to connect W5500 to ESP32_S2/S3](#How-to-connect-W5500-to-ESP32_S2S3) * [Examples](#examples) * [ 1. Async_AdvancedWebServer](examples/Async_AdvancedWebServer) * [ 2. Async_AdvancedWebServer_MemoryIssues_SendArduinoString](examples/Async_AdvancedWebServer_MemoryIssues_SendArduinoString) @@ -103,6 +103,7 @@ * [4. AsyncWebServer_SendChunked on ESP32S3_DEV with ESP32_S3_W5500](#4-AsyncWebServer_SendChunked-on-ESP32S3_DEV-with-ESP32_S3_W5500) * [5. Async_WebSocketsServer on ESP32S3_DEV with ESP32_S3_W5500](#5-Async_WebSocketsServer-on-ESP32S3_DEV-with-ESP32_S3_W5500) * [6. Async_HTTPBasicAuth on ESP32S3_DEV with ESP32_S3_W5500](#6-Async_HTTPBasicAuth-on-ESP32S3_DEV-with-ESP32_S3_W5500) + * [7. Async_AdvancedWebServer_SendChunked on ESP32S2_DEV with ESP32_S2_W5500](#7-Async_AdvancedWebServer_SendChunked-on-ESP32S2_DEV-with-ESP32_S2_W5500) * [Debug](#debug) * [Troubleshooting](#troubleshooting) * [Issues](#issues) @@ -220,8 +221,17 @@ to apply the better and faster **asynchronous** feature of the **powerful** [ESP 1. **ESP32_S3 boards** using `LwIP W5500 Ethernet` + 2. **ESP32_S2 boards** using `LwIP W5500 Ethernet` - Hopefully the `ESP32_S2` and `ESP32_C3-based` boards will be supported in the near future to use `LwIP W5500 or ENC28J60 Ethernet` + Hopefully the `ESP32_C3-based` boards will be supported in the near future to use `LwIP W5500 or ENC28J60 Ethernet` + +--- + +#### ESP32S2_DEV + +
+ +
#### ESP32S3_DEV @@ -230,7 +240,7 @@ to apply the better and faster **asynchronous** feature of the **powerful** [ESP - +--- #### W5500 @@ -1502,7 +1512,7 @@ build_flags = --- --- -### How to connect W5500 to ESP32_S3 +### How to connect W5500 to ESP32_S2/S3 You can change the `INT` pin to another one. Default is `GPIO4` @@ -1513,13 +1523,6 @@ You can change the `INT` pin to another one. Default is `GPIO4` --- - -#### ESP32S3_DEV - -- -
- #### W5500@@ -1530,6 +1533,14 @@ You can change the `INT` pin to another one. Default is `GPIO4`
+--- + + +#### ESP32S3_DEV + ++ +
|W5500|<--->|ESP32_S3| @@ -1544,6 +1555,27 @@ You can change the `INT` pin to another one. Default is `GPIO4` |3.3V|<--->|3.3V| +--- + +#### ESP32S2_DEV + ++ +
+ + +|ENC28J60|<--->|ESP32_S2| +|:-:|:-:|:-:| +|MOSI|<--->|GPIO35| +|MISO|<--->|GPIO37| +|SCK|<--->|GPIO36| +|SS|<--->|GPIO34| +|INT|<--->|GPIO4| +|RST|<--->|RST| +|GND|<--->|GND| +|3.3V|<--->|3.3V| + + --- --- @@ -1593,7 +1625,7 @@ Following are debug terminal output and screen shots when running example [Async ```cpp Start AsyncMultiWebServer_ESP32_W5500 on ESP32S3_DEV with ESP32_S3_W5500 -AsyncWebServer_ESP32_SC_W5500 v1.6.3 for core v2.0.0+ +AsyncWebServer_ESP32_SC_W5500 v1.7.0 for core v2.0.0+ [AWS] Default SPI pinout: [AWS] SPI_HOST: 2 [AWS] MOSI: 11 @@ -1643,7 +1675,7 @@ Following is the debug terminal and screen shot when running example [Async_Adva ```cpp Start Async_AdvancedWebServer_MemoryIssues_Send_CString on ESP32S3_DEV with ESP32_S3_W5500 -AsyncWebServer_ESP32_SC_W5500 v1.6.3 for core v2.0.0+ +AsyncWebServer_ESP32_SC_W5500 v1.7.0 for core v2.0.0+ [AWS] Default SPI pinout: [AWS] SPI_HOST: 2 [AWS] MOSI: 11 @@ -1677,7 +1709,7 @@ While using `Arduino String`, the HEAP usage is very large ```cpp Start Async_AdvancedWebServer_MemoryIssues_SendArduinoString on ESP32S3_DEV with ESP32_S3_W5500 -AsyncWebServer_ESP32_SC_W5500 v1.6.3 for core v2.0.0+ +AsyncWebServer_ESP32_SC_W5500 v1.7.0 for core v2.0.0+ [AWS] Default SPI pinout: [AWS] SPI_HOST: 2 [AWS] MOSI: 11 @@ -1719,7 +1751,7 @@ Following is debug terminal output when running example [Async_AdvancedWebServer ```cpp Start Async_AdvancedWebServer_SendChunked on ESP32S3_DEV with ESP32_S3_W5500 -AsyncWebServer_ESP32_SC_W5500 v1.6.3 for core v2.0.0+ +AsyncWebServer_ESP32_SC_W5500 v1.7.0 for core v2.0.0+ [AWS] Default SPI pinout: [AWS] SPI_HOST: 2 [AWS] MOSI: 11 @@ -1789,7 +1821,7 @@ Following is debug terminal output when running example [AsyncWebServer_SendChun ```cpp Start AsyncWebServer_SendChunked on ESP32S3_DEV with ESP32_S3_W5500 -AsyncWebServer_ESP32_SC_W5500 v1.6.3 for core v2.0.0+ +AsyncWebServer_ESP32_SC_W5500 v1.7.0 for core v2.0.0+ [AWS] Default SPI pinout: [AWS] SPI_HOST: 2 [AWS] MOSI: 11 @@ -1840,7 +1872,7 @@ Following is debug terminal output when running example [Async_WebSocketsServer] ```cpp Starting Async_WebSocketsServer on ESP32S3_DEV with ESP32_S3_W5500 -AsyncWebServer_ESP32_SC_W5500 v1.6.3 for core v2.0.0+ +AsyncWebServer_ESP32_SC_W5500 v1.7.0 for core v2.0.0+ [AWS] Default SPI pinout: [AWS] SPI_HOST: 2 [AWS] MOSI: 11 @@ -1870,7 +1902,7 @@ Following is debug terminal output when running example [Async_HTTPBasicAuth](ex ```cpp Start Async_HTTPBasicAuth on ESP32S3_DEV with ESP32_S3_W5500 -AsyncWebServer_ESP32_SC_W5500 v1.6.3 for core v2.0.0+ +AsyncWebServer_ESP32_SC_W5500 v1.7.0 for core v2.0.0+ [AWS] Default SPI pinout: [AWS] SPI_HOST: 2 [AWS] MOSI: 11 @@ -1891,6 +1923,79 @@ Login using username = admin and password = esp32_w5500 ``` +--- + +#### 7. Async_AdvancedWebServer_SendChunked on ESP32S2_DEV with ESP32_S2_W5500 + +Following is debug terminal output when running example [Async_AdvancedWebServer_SendChunked](examples/Async_AdvancedWebServer_SendChunked) on `ESP32S2_DEV with LwIP W5500`, using ESP32 core `v2.0.0+`, to demo how to use `beginChunkedResponse()` to send large `html` in chunks. The `built-in MAC address` is now used instead of user-defined one. + +```cpp +Start Async_AdvancedWebServer_SendChunked on ESP32S2_DEV with ESP32_S2_W5500 +AsyncWebServer_ESP32_SC_W5500 v1.7.0 for core v2.0.0+ +[AWS] Default SPI pinout: +[AWS] SPI_HOST: 2 +[AWS] MOSI: 35 +[AWS] MISO: 37 +[AWS] SCK: 36 +[AWS] CS: 34 +[AWS] INT: 4 +[AWS] SPI Clock (MHz): 25 +[AWS] ========================= + +ETH Started +ETH Connected +ETH MAC: 7E:DF:A1:08:32:C9, IPv4: 192.168.2.133 +FULL_DUPLEX, 100Mbps +AsyncWebServer is @ IP : 192.168.2.133 +.[AWS] Total length to send in chunks = 31259 +[AWS] Bytes sent in chunk = 5620 +[AWS] Bytes sent in chunk = 1428 +[AWS] Bytes sent in chunk = 1428 +[AWS] Bytes sent in chunk = 1428 +[AWS] Bytes sent in chunk = 1428 +[AWS] Bytes sent in chunk = 1428 +[AWS] Bytes sent in chunk = 1428 +[AWS] Bytes sent in chunk = 1428 +[AWS] Bytes sent in chunk = 1428 +[AWS] Bytes sent in chunk = 1428 +[AWS] Bytes sent in chunk = 1428 +[AWS] Bytes sent in chunk = 1428 +[AWS] Bytes sent in chunk = 1428 +[AWS] Bytes sent in chunk = 1428 +[AWS] Bytes sent in chunk = 1428 +[AWS] Bytes sent in chunk = 1428 +[AWS] Bytes sent in chunk = 1428 +[AWS] Bytes sent in chunk = 2791 +[AWS] Bytes sent in chunk = 0 +[AWS] Total length to send in chunks = 31279 +[AWS] Bytes sent in chunk = 5620 +[AWS] Bytes sent in chunk = 1428 +[AWS] Bytes sent in chunk = 1428 +[AWS] Bytes sent in chunk = 1428 +[AWS] Bytes sent in chunk = 1428 +[AWS] Bytes sent in chunk = 1428 +[AWS] Bytes sent in chunk = 1428 +[AWS] Bytes sent in chunk = 1428 +[AWS] Bytes sent in chunk = 1428 +[AWS] Bytes sent in chunk = 1428 +[AWS] Bytes sent in chunk = 1428 +[AWS] Bytes sent in chunk = 1428 +[AWS] Bytes sent in chunk = 1428 +[AWS] Bytes sent in chunk = 1428 +[AWS] Bytes sent in chunk = 1428 +[AWS] Bytes sent in chunk = 1428 +[AWS] Bytes sent in chunk = 1428 +[AWS] Bytes sent in chunk = 2811 +[AWS] Bytes sent in chunk = 0 +``` + +You can access the Async Advanced WebServers @ the server IP + ++ +
+ + --- --- @@ -1943,6 +2048,8 @@ Submit issues to: [AsyncWebServer_ESP32_SC_W5500 issues](https://github.com/khoi 8. Add examples [Async_AdvancedWebServer_SendChunked](https://github.com/khoih-prog/AsyncWebServer_RP2040W/tree/main/examples/Async_AdvancedWebServer_SendChunked) and [AsyncWebServer_SendChunked](https://github.com/khoih-prog/AsyncWebServer_RP2040W/tree/main/examples/AsyncWebServer_SendChunked) to demo how to use `beginChunkedResponse()` to send large `html` in chunks 9. Use `allman astyle` and add `utils` 10. Add `Async_WebSocketsServer`, `Async_HttpBasicAuth` and `MQTT` examples +11. Add support to **ESP32S2-based boards** using `LwIP W5500 Ethernet` + --- --- diff --git a/changelog.md b/changelog.md index 3919fc1..027147f 100644 --- a/changelog.md +++ b/changelog.md @@ -15,6 +15,7 @@ ## Table of contents * [Changelog](#changelog) + * [Releases v1.7.0](#releases-v170) * [Releases v1.6.3](#releases-v163) @@ -23,6 +24,10 @@ ## Changelog +#### Releases v1.7.0 + +1. Add support to `ESP32_S2` boards using `LwIP W5500 Ethernet` + #### Releases v1.6.3 1. Initial coding to port [ESPAsyncWebServer](https://github.com/me-no-dev/ESPAsyncWebServer) to ESP32_S3 boards using `LwIP W5500 Ethernet`. diff --git a/library.json b/library.json index c8f70e8..01b2b95 100644 --- a/library.json +++ b/library.json @@ -1,6 +1,6 @@ { "name":"AsyncWebServer_ESP32_SC_W5500", - "version": "1.6.3", + "version": "1.7.0", "description":"Asynchronous HTTP and WebSocket Server Library for (ESP32_S2/S3/C3 + LwIP W5500). Now supporting using CString to save heap to send very large data and with examples to demo how to use beginChunkedResponse() to send large html in chunks", "keywords":"http, async, async-webserver, async-websocket, websocket, webserver, esp32, esp32-s2, esp32-s3, esp32-c3, w5500, lwip, lwip-w5500, lwip-ethernet", "authors": diff --git a/library.properties b/library.properties index 49fffbd..228e62c 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=AsyncWebServer_ESP32_SC_W5500 -version=1.6.3 +version=1.7.0 author=Hristo Gochkov,Khoi Hoang maintainer=Khoi Hoang7I
zab5XyXJ&y-7J^WDCySGg+%m}|u32%krA#MlcR?|aW^B<*hp7pXI;pA-YcRk9nT7BN
z06>NLEDgMQ-yK!d0DwkHH+>Z)XgIxM^Q(%O@n@MCkr*1Xcg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