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

Commit

Permalink
v1.4.0 to add LittleFS functions
Browse files Browse the repository at this point in the history
#### Release v1.4.0

1. Add `LittleFS` functions such as AsyncFSWebServer
2. Add examples [AsyncFSWebServer](https://github.com/khoih-prog/AsyncWebServer_RP2040W/tree/main/examples/AsyncFSWebServer) and [AsyncFSWebServer_Complex](https://github.com/khoih-prog/AsyncWebServer_RP2040W/tree/main/examples/AsyncFSWebServer_Complex) to demo the new feature
  • Loading branch information
khoih-prog authored Oct 20, 2022
1 parent b71cf4e commit 0c259b6
Show file tree
Hide file tree
Showing 24 changed files with 1,584 additions and 275 deletions.
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +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
* `RP2040` Core Version (e.g. RP2040 core v2.6.0)
* `RP2040` Core Version (e.g. RP2040 core v2.6.1)
* `RP2040W` Board type (e.g. RASPBERRY_PI_PICO_W)
* Contextual information (e.g. what you were trying to achieve)
* Simplest possible steps to reproduce
Expand All @@ -28,10 +28,10 @@ Please ensure to specify the following:

```
Arduino IDE version: 1.8.19
RP2040 core v2.6.0
RP2040 core v2.6.1
RASPBERRY_PI_PICO_W Module
OS: Ubuntu 20.04 LTS
Linux xy-Inspiron-3593 5.15.0-48-generic #54~20.04.1-Ubuntu SMP Thu Sep 1 16:17:26 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
Linux xy-Inspiron-3593 5.15.0-50-generic #56~20.04.1-Ubuntu SMP Tue Sep 27 15:51:29 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
Context:
I encountered a crash while using this library
Expand Down
71 changes: 66 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
## Table of contents

* [Table of contents](#table-of-contents)
* [Important Note from v1.4.0](#Important-Note-from-v140)
* [Important Note from v1.2.0](#Important-Note-from-v120)
* [Why do we need this AsyncWebServer_RP2040W library](#why-do-we-need-this-AsyncWebServer_RP2040W-library)
* [Features](#features)
Expand Down Expand Up @@ -93,6 +94,8 @@
* [14. Async_AdvancedWebServer_MemoryIssues_Send_CString](examples/Async_AdvancedWebServer_MemoryIssues_Send_CString) **New**
* [15. Async_WebSocketsServer](examples/Async_WebSocketsServer) **New**
* [16. Async_WebSocketsServer_Xtreme](examples/Async_WebSocketsServer_Xtreme) **New**
* [17. AsyncFSWebServer](examples/AsyncFSWebServer) **New**
* [18. AsyncFSWebServer_Complex](examples/AsyncFSWebServer_Complex) **New**
* [Example Async_AdvancedWebServer](#Example-Async_AdvancedWebServer)
* [Debug Terminal Output Samples](#debug-terminal-output-samples)
* [1. Async_AdvancedWebServer on RASPBERRY_PI_PICO_W using CYW43439 WiFi](#1-Async_AdvancedWebServer-on-RASPBERRY_PI_PICO_W-using-CYW43439-WiFi)
Expand All @@ -105,6 +108,7 @@
* [8. Async_AdvancedWebServer_MemoryIssues_Send_CString on RASPBERRY_PI_PICO_W](#8-Async_AdvancedWebServer_MemoryIssues_Send_CString-on-RASPBERRY_PI_PICO_W)
* [9. Async_WebSocketsServer on RASPBERRY_PI_PICO_W using CYW43439 WiFi](#9-Async_WebSocketsServer-on-RASPBERRY_PI_PICO_W-using-CYW43439-WiFi)
* [10. Async_WebSocketsServer_Xtreme on RASPBERRY_PI_PICO_W using CYW43439 WiFi](#10-Async_WebSocketsServer_Xtreme-on-RASPBERRY_PI_PICO_W-using-CYW43439-WiFi)
* [11. AsyncFSWebServer_Complex on RASPBERRY_PI_PICO_W using CYW43439 WiFi](#11-AsyncFSWebServer_Complex-on-RASPBERRY_PI_PICO_W-using-CYW43439-WiFi)
* [Debug](#debug)
* [Troubleshooting](#troubleshooting)
* [Issues](#issues)
Expand All @@ -118,6 +122,21 @@
---
---

### Important Note from v1.4.0

The new `v1.4.0+` has added a new and powerful feature to use `LittleFS` functions, such as AsyncFSWebServer

Check these new examples

1. [AsyncFSWebServer](https://github.com/khoih-prog/AsyncWebServer_RP2040W/tree/main/examples/AsyncFSWebServer)
2. [AsyncFSWebServer_Complex](https://github.com/khoih-prog/AsyncWebServer_RP2040W/tree/main/examples/AsyncFSWebServer_Complex)

<p align="center">
<img src="https://github.com/khoih-prog/AsyncWebServer_RP2040W/blob/main/pics/AsyncFSWebServer_Complex.png">
</p>

---

### Important Note from v1.2.0

The new `v1.2.0+` has added a new and powerful feature to permit using `CString` to save heap to send `very large data`.
Expand Down Expand Up @@ -188,7 +207,6 @@ request->send(200, textPlainStr, cStr, false);
The required additional HEAP is about **1 times of the CString size**. This way is the best and **most efficient way** to use by avoiding of `unnecessary copies` of the CString in HEAP



---
---

Expand Down Expand Up @@ -235,7 +253,7 @@ to apply the better and faster **asynchronous** feature of the **powerful** [ESP
## Prerequisites

1. [`Arduino IDE 1.8.19+` for Arduino](https://github.com/arduino/Arduino). [![GitHub release](https://img.shields.io/github/release/arduino/Arduino.svg)](https://github.com/arduino/Arduino/releases/latest)
2. [`Earle Philhower's arduino-pico core v2.6.0+`](https://github.com/earlephilhower/arduino-pico) for **RASPBERRY_PI_PICO_W with CYW43439 WiFi**, etc. [![GitHub release](https://img.shields.io/github/release/earlephilhower/arduino-pico.svg)](https://github.com/earlephilhower/arduino-pico/releases/latest)
2. [`Earle Philhower's arduino-pico core v2.6.1+`](https://github.com/earlephilhower/arduino-pico) for **RASPBERRY_PI_PICO_W with CYW43439 WiFi**, etc. [![GitHub release](https://img.shields.io/github/release/earlephilhower/arduino-pico.svg)](https://github.com/earlephilhower/arduino-pico/releases/latest)
3. [`AsyncTCP_RP2040W library v1.1.0+`](https://github.com/khoih-prog/AsyncTCP_RP2040W) for RASPBERRY_PI_PICO_W with CYW43439 WiFi. [![GitHub release](https://img.shields.io/github/release/khoih-prog/AsyncTCP_RP2040W.svg)](https://github.com/khoih-prog/AsyncTCP_RP2040W/releases/latest)

---
Expand Down Expand Up @@ -790,6 +808,7 @@ request->send(response);
---

## Param Rewrite With Matching

It is possible to rewrite the request url with parameter matchg. Here is an example with one parameter:
Rewrite for example "/radio/{frequence}" -> "/radio?f={frequence}"

Expand Down Expand Up @@ -893,7 +912,6 @@ without starting another listening service or using different port
### Async WebSocket Event
```cpp
void onEvent(AsyncWebSocket * server, AsyncWebSocketClient * client, AwsEventType type, void * arg, uint8_t *data, size_t len)
{
if(type == WS_EVT_CONNECT)
Expand Down Expand Up @@ -1511,7 +1529,9 @@ build_flags =
13. [Async_AdvancedWebServer_MemoryIssues_SendArduinoString](examples/Async_AdvancedWebServer_MemoryIssues_SendArduinoString) **New**
14. [Async_AdvancedWebServer_MemoryIssues_Send_CString](examples/Async_AdvancedWebServer_MemoryIssues_Send_CString) **New**
15. [Async_WebSocketsServer](examples/Async_WebSocketsServer) **New**
15. [Async_WebSocketsServer_Xtreme](examples/Async_WebSocketsServer_Xtreme) **New**
16. [Async_WebSocketsServer_Xtreme](examples/Async_WebSocketsServer_Xtreme) **New**
17. [AsyncFSWebServer](examples/AsyncFSWebServer) **New**
18. [AsyncFSWebServer_Complex](examples/AsyncFSWebServer_Complex) **New**


---
Expand Down Expand Up @@ -1915,6 +1935,45 @@ You can access the Async_WebSockets Servers at the displayed server IP, e.g. `19
</p>


---


#### 11. AsyncFSWebServer_Complex on RASPBERRY_PI_PICO_W with RP2040W CYW43439 WiFi

Following is debug terminal output when running example [AsyncFSWebServer_Complex](examples/AsyncFSWebServer_Complex) on RASPBERRY_PI_PICO_W using CYW43439 WiFi.


```
Start AsyncFSWebServer_Complex on RASPBERRY_PI_PICO_W with RP2040W CYW43439 WiFi
AsyncTCP_RP2040W v1.1.0
AsyncWebServer_RP2040W v1.4.0
Connecting to SSID: HueNet1
SSID: HueNet1
Local IP Address: 192.168.2.77
Opening / directory
FS File: CanadaFlag_1.png, size: 40.25KB
FS File: CanadaFlag_2.png, size: 8.12KB
FS File: CanadaFlag_3.jpg, size: 10.89KB
FS File: css, size: 0B
FS File: edit.htm.gz, size: 4.02KB
FS File: favicon.ico, size: 1.12KB
FS File: graphs.js.gz, size: 1.92KB
FS File: index.htm, size: 3.63KB
FS File: js, size: 0B
AsyncWebServer started @192.168.2.77
Open http://192.168.2.77/edit to see the file browser
AsyncFSEditor::handleRequest: Sending AsyncWebServerResponse
```


You can access the Async_WebSockets Servers at the displayed server IP, e.g. `192.168.2.77`

<p align="center">
<img src="https://github.com/khoih-prog/AsyncWebServer_RP2040W/blob/main/pics/AsyncFSWebServer_Complex.png">
</p>


---
---
Expand Down Expand Up @@ -1961,7 +2020,9 @@ Submit issues to: [AsyncWebServer_RP2040W issues](https://github.com/khoih-prog/
7. Support using `CString` to save heap to send `very large data`. Check [request->send(200, textPlainStr, jsonChartDataCharStr); - Without using String Class - to save heap #8](https://github.com/khoih-prog/Portenta_H7_AsyncWebServer/pull/8)
8. Fix `crash` when using `AsyncWebSockets server` and add example [Async_WebSocketsServer](https://github.com/khoih-prog/AsyncWebServer_RP2040W/tree/main/examples/Async_WebSocketsServer) to demo the AsyncWebSockets Server with a Python [WSClient.py](examples/Async_WebSocketsServer/WSClient_Python/WSClient.py)
9. Improve robustness of AsyncWebSockets server. Check [AsyncWebSocketServer_RP2040W crashes with "[AWS] ERROR: Too many messages queued" #6](https://github.com/khoih-prog/AsyncWebServer_RP2040W/issues/6) and add example [Async_WebSocketsServer_Xtreme](https://github.com/khoih-prog/AsyncWebServer_RP2040W/tree/main/examples/Async_WebSocketsServer_Xtreme) to demo the nearly highest possible WebSockets Server speed

10. Add `LittleFS` functions such as `AsyncFSWebServer`


---
---

Expand Down
6 changes: 6 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
## Table of Contents

* [Changelog](#changelog)
* [Release v1.4.0](#Release-v140)
* [Release v1.3.1](#Release-v131)
* [Release v1.3.0](#Release-v130)
* [Release v1.2.1](#Release-v121)
Expand All @@ -28,6 +29,11 @@

## Changelog

#### Release v1.4.0

1. Add `LittleFS` functions such as AsyncFSWebServer
2. Add examples [AsyncFSWebServer](https://github.com/khoih-prog/AsyncWebServer_RP2040W/tree/main/examples/AsyncFSWebServer) and [AsyncFSWebServer_Complex](https://github.com/khoih-prog/AsyncWebServer_RP2040W/tree/main/examples/AsyncFSWebServer_Complex) to demo the new feature

#### Release v1.3.1

1. Improve robustness of AsyncWebSockets server. Check [AsyncWebSocketServer_RP2040W crashes with "[AWS] ERROR: Too many messages queued" #6](https://github.com/khoih-prog/AsyncWebServer_RP2040W/issues/6)
Expand Down
4 changes: 2 additions & 2 deletions library.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "AsyncWebServer_RP2040W",
"version": "1.3.1",
"version": "1.4.0",
"keywords": "http, async, websocket, webserver, async-webserver, async-tcp, async-udp, async-websocket, async-http, ssl, tls, rp2040, rp2040w, raspberry-pi-pico-w, cyw43439, wifi",
"description": "Asynchronous WebServer Library for RASPBERRY_PI_PICO_W using CYW43439 WiFi with arduino-pico core. This library, which is relied on AsyncTCP_RP2040W, is part of a series of advanced Async libraries for RP2040W, such as AsyncTCP_RP2040W, AsyncUDP_RP2040W, AsyncWebServer_RP2040W, AsyncHTTPRequest_RP2040W, AsyncHTTPSRequest_RP2040W, etc. Now can display programmed WiFi country-code and support using CString to save heap to send very large data",
"authors":
Expand Down Expand Up @@ -41,5 +41,5 @@
"frameworks": "*",
"platforms": "raspberrypi",
"examples": "examples/*/*/*.ino",
"headers": "AsyncWebServer_RP2040W.h"
"headers": ["AsyncWebServer_RP2040W.h", "AsyncFSEditor_RP2040W.h"]
}
4 changes: 2 additions & 2 deletions library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=AsyncWebServer_RP2040W
version=1.3.1
version=1.4.0
author=Hristo Gochkov,Khoi Hoang
maintainer=Khoi Hoang <[email protected]>
sentence=Asynchronous WebServer Library for RASPBERRY_PI_PICO_W using CYW43439 WiFi with arduino-pico core.
Expand All @@ -10,4 +10,4 @@ architectures=rp2040
repository=https://github.com/khoih-prog/AsyncWebServer_RP2040W
license=GPLv3
depends=AsyncTCP_RP2040W
includes=AsyncWebServer_RP2040W.h
includes=AsyncWebServer_RP2040W.h, AsyncFSEditor_RP2040W.h
3 changes: 2 additions & 1 deletion src/AsyncEventSource_RP2040W.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
Built by Khoi Hoang https://github.com/khoih-prog/AsyncWebServer_RP2040W
Licensed under GPLv3 license
Version: 1.3.1
Version: 1.4.0
Version Modified By Date Comments
------- ----------- ---------- -----------
Expand All @@ -23,6 +23,7 @@
1.2.1 K Hoang 05/10/2022 Don't need memmove(), String no longer destroyed
1.3.0 K Hoang 10/10/2022 Fix crash when using AsyncWebSockets server
1.3.1 K Hoang 10/10/2022 Improve robustness of AsyncWebSockets server
1.4.0 K Hoang 20/10/2022 Add LittleFS functions such as AsyncFSWebServer
*****************************************************************************************************************************/

#if !defined(_RP2040W_AWS_LOGLEVEL_)
Expand Down
3 changes: 2 additions & 1 deletion src/AsyncEventSource_RP2040W.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
Built by Khoi Hoang https://github.com/khoih-prog/AsyncWebServer_RP2040W
Licensed under GPLv3 license
Version: 1.3.1
Version: 1.4.0
Version Modified By Date Comments
------- ----------- ---------- -----------
Expand All @@ -23,6 +23,7 @@
1.2.1 K Hoang 05/10/2022 Don't need memmove(), String no longer destroyed
1.3.0 K Hoang 10/10/2022 Fix crash when using AsyncWebSockets server
1.3.1 K Hoang 10/10/2022 Improve robustness of AsyncWebSockets server
1.4.0 K Hoang 20/10/2022 Add LittleFS functions such as AsyncFSWebServer
*****************************************************************************************************************************/

#pragma once
Expand Down
Loading

0 comments on commit 0c259b6

Please sign in to comment.