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

Commit 29147f6

Browse files
authored
v1.2.3a
### Releases v1.2.3a 1. Add back MD5/SHA1 authentication feature. 4. Add example, update README.md, clean up.
1 parent 5ce18bc commit 29147f6

37 files changed

+2872
-166
lines changed

README.md

Lines changed: 14 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,12 @@
99
---
1010
---
1111

12-
### Initial Releases v1.2.3
12+
### Releases v1.2.3a
13+
14+
1. Add back MD5/SHA1 authentication feature.
15+
4. Add example, update README.md, clean up.
16+
17+
#### Initial Releases v1.2.3
1318

1419
1. Initial coding to port [ESPAsyncWebServer](https://github.com/me-no-dev/ESPAsyncWebServer) to STM32 boards using builtin LAN8742A Ethernet. More supports will be added gradually later, such as AsyncUDP, other Ethernet / WiFi shields.
1520
2. Add more examples.
@@ -181,8 +186,6 @@ The best and easiest way is to use `Arduino Library Manager`. Search for `AsyncW
181186
the rewrite url, and when the optional ```Filter``` callback return true.
182187
- Setting a ```Filter``` to the ```Rewrite``` enables to control when to apply the rewrite, decision can be based on
183188
request url, http version, request host/port/target host, get parameters or the request client's localIP or remoteIP.
184-
- Two filter callbacks are provided: ```ON_AP_FILTER``` to execute the rewrite when request is made to the AP interface,
185-
```ON_STA_FILTER``` to execute the rewrite when request is made to the STA interface.
186189
- The ```Rewrite``` can specify a target url with optional get parameters, e.g. ```/to-url?with=params```
187190

188191
### Handlers and how do they work
@@ -191,8 +194,6 @@ The best and easiest way is to use `Arduino Library Manager`. Search for `AsyncW
191194
- One ```Handler``` instance can be attached to any request and lives together with the server
192195
- Setting a ```Filter``` to the ```Handler``` enables to control when to apply the handler, decision can be based on
193196
request url, http version, request host/port/target host, get parameters or the request client's localIP or remoteIP.
194-
- Two filter callbacks are provided: ```ON_AP_FILTER``` to execute the rewrite when request is made to the AP interface,
195-
```ON_STA_FILTER``` to execute the rewrite when request is made to the STA interface.
196197
- The ```canHandle``` method is used for handler specific control on whether the requests can be handled
197198
and for declaring any interesting headers that the ```Request``` should parse. Decision can be based on request
198199
method, request url, http version, request host/port/target host and get parameters
@@ -745,10 +746,6 @@ Filters can be set to `Rewrite` or `Handler` in order to control when to apply t
745746
A filter is a callback function that evaluates the request and return a boolean `true` to include the item
746747
or `false` to exclude it.
747748

748-
Two filter callback are provided for convince:
749-
* `ON_STA_FILTER` - return true when requests are made to the STA (station mode) interface.
750-
* `ON_AP_FILTER` - return true when requests are made to the AP (access point) interface.
751-
752749
---
753750

754751
## Bad Responses
@@ -888,25 +885,15 @@ AsyncWebSocket ws("/ws");
888885
ws.printf((uint32_t)client_id, arguments...);
889886
//printf to all clients
890887
ws.printfAll(arguments...);
891-
//printf_P to a client
892-
ws.printf_P((uint32_t)client_id, PSTR(format), arguments...);
893-
//printfAll_P to all clients
894-
ws.printfAll_P(PSTR(format), arguments...);
895888
//send text to a client
896889
ws.text((uint32_t)client_id, (char*)text);
897890
ws.text((uint32_t)client_id, (uint8_t*)text, (size_t)len);
898-
//send text from PROGMEM to a client
899-
ws.text((uint32_t)client_id, PSTR("text"));
900-
const char flash_text[] PROGMEM = "Text to send"
901-
ws.text((uint32_t)client_id, FPSTR(flash_text));
902891
//send text to all clients
903892
ws.textAll((char*)text);
904893
ws.textAll((uint8_t*)text, (size_t)len);
905894
//send binary to a client
906895
ws.binary((uint32_t)client_id, (char*)binary);
907896
ws.binary((uint32_t)client_id, (uint8_t*)binary, (size_t)len);
908-
//send binary from PROGMEM to a client
909-
const uint8_t flash_binary[] PROGMEM = { 0x01, 0x02, 0x03, 0x04 };
910897
ws.binary((uint32_t)client_id, flash_binary, 4);
911898
//send binary to all clients
912899
ws.binaryAll((char*)binary);
@@ -918,21 +905,12 @@ ws.setAuthentication("user", "pass");
918905
AsyncWebSocketClient * client;
919906
//printf
920907
client->printf(arguments...);
921-
//printf_P
922-
client->printf_P(PSTR(format), arguments...);
923908
//send text
924909
client->text((char*)text);
925910
client->text((uint8_t*)text, (size_t)len);
926-
//send text from PROGMEM
927-
client->text(PSTR("text"));
928-
const char flash_text[] PROGMEM = "Text to send";
929-
client->text(FPSTR(flash_text));
930911
//send binary
931912
client->binary((char*)binary);
932913
client->binary((uint8_t*)binary, (size_t)len);
933-
//send binary from PROGMEM
934-
const uint8_t flash_binary[] PROGMEM = { 0x01, 0x02, 0x03, 0x04 };
935-
client->binary(flash_binary, 4);
936914
```
937915
938916
### Direct access to web socket message buffer
@@ -998,7 +976,7 @@ void setup()
998976
{
999977
if(client->lastId())
1000978
{
1001-
Serial.printf("Client reconnected! Last message ID that it gat is: %u\n", client->lastId());
979+
Serial.printf("Client reconnected! Last message ID that it got is: %u\n", client->lastId());
1002980
}
1003981

1004982
//send event with message "hello!", id current millis
@@ -1337,6 +1315,7 @@ build_flags =
13371315
7. [Async_SimpleWebServer_STM32](examples/Async_SimpleWebServer_STM32)
13381316
8. [WebClient](examples/WebClient)
13391317
9. [WebClientRepeating](examples/WebClientRepeating)
1318+
10. [Async_HttpBasicAuth](examples/Async_HttpBasicAuth)
13401319

13411320
---
13421321

@@ -1621,7 +1600,12 @@ Submit issues to: [AsyncWebServer_STM32 issues](https://github.com/khoih-prog/As
16211600
---
16221601
---
16231602
1624-
### Initial Releases v1.2.3
1603+
### Releases v1.2.3a
1604+
1605+
1. Add back MD5/SHA1 authentication feature.
1606+
4. Add example, update README.md, clean up.
1607+
1608+
#### Initial Releases v1.2.3
16251609
16261610
1. Initial coding to port [ESPAsyncWebServer](https://github.com/me-no-dev/ESPAsyncWebServer) to STM32 boards using builtin LAN8742A Ethernet. More supports will be added gradually later, such as AsyncUDP, other Ethernet / WiFi shields.
16271611
2. Add more examples.

examples/AsyncFSBrowser_STM32/AsyncFSBrowser_STM32.ino

Lines changed: 85 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,90 @@
1+
/****************************************************************************************************************************
2+
AsyncFSBrowser_STM32.h - Dead simple AsyncWebServer for STM32 built-in LAN8742A Ethernet
3+
4+
For STM32 with built-in LAN8742A Ethernet (Nucleo-144, DISCOVERY, etc)
5+
6+
AsyncWebServer_STM32 is a library for the STM32 run built-in Ethernet WebServer
7+
8+
Based on and modified from ESPAsyncWebServer (https://github.com/me-no-dev/ESPAsyncWebServer)
9+
Built by Khoi Hoang https://github.com/khoih-prog/AsyncWebServer_STM32
10+
Licensed under MIT license
11+
12+
Version: 1.2.3a
13+
14+
Version Modified By Date Comments
15+
------- ----------- ---------- -----------
16+
1.2.3 K Hoang 02/09/2020 Initial coding for STM32 for built-in Ethernet (Nucleo-144, DISCOVERY, etc).
17+
Bump up version to v1.2.3 to sync with ESPAsyncWebServer v1.2.3
18+
1.2.3a K Hoang 05/09/2020 Add back MD5/SHA1 authentication feature.
19+
*****************************************************************************************************************************/
20+
/*
21+
Currently support
22+
1) STM32 boards with built-in Ethernet (to use USE_BUILTIN_ETHERNET = true) such as :
23+
- Nucleo-144 (F429ZI, F767ZI)
24+
- Discovery (STM32F746G-DISCOVERY)
25+
- STM32 boards (STM32F/L/H/G/WB/MP1) with 32K+ Flash, with Built-in Ethernet,
26+
- See How To Use Built-in Ethernet at (https://github.com/khoih-prog/EthernetWebServer_STM32/issues/1)
27+
*/
28+
29+
#if !( defined(STM32F0) || defined(STM32F1) || defined(STM32F2) || defined(STM32F3) ||defined(STM32F4) || defined(STM32F7) || \
30+
defined(STM32L0) || defined(STM32L1) || defined(STM32L4) || defined(STM32H7) ||defined(STM32G0) || defined(STM32G4) || \
31+
defined(STM32WB) || defined(STM32MP1) )
32+
#error This code is designed to run on STM32F/L/H/G/WB/MP1 platform! Please check your Tools->Board setting.
33+
#endif
34+
35+
#if defined(STM32F0)
36+
#warning STM32F0 board selected
37+
#define BOARD_TYPE "STM32F0"
38+
#elif defined(STM32F1)
39+
#warning STM32F1 board selected
40+
#define BOARD_TYPE "STM32F1"
41+
#elif defined(STM32F2)
42+
#warning STM32F2 board selected
43+
#define BOARD_TYPE "STM32F2"
44+
#elif defined(STM32F3)
45+
#warning STM32F3 board selected
46+
#define BOARD_TYPE "STM32F3"
47+
#elif defined(STM32F4)
48+
#warning STM32F4 board selected
49+
#define BOARD_TYPE "STM32F4"
50+
#elif defined(STM32F7)
51+
#warning STM32F7 board selected
52+
#define BOARD_TYPE "STM32F7"
53+
#elif defined(STM32L0)
54+
#warning STM32L0 board selected
55+
#define BOARD_TYPE "STM32L0"
56+
#elif defined(STM32L1)
57+
#warning STM32L1 board selected
58+
#define BOARD_TYPE "STM32L1"
59+
#elif defined(STM32L4)
60+
#warning STM32L4 board selected
61+
#define BOARD_TYPE "STM32L4"
62+
#elif defined(STM32H7)
63+
#warning STM32H7 board selected
64+
#define BOARD_TYPE "STM32H7"
65+
#elif defined(STM32G0)
66+
#warning STM32G0 board selected
67+
#define BOARD_TYPE "STM32G0"
68+
#elif defined(STM32G4)
69+
#warning STM32G4 board selected
70+
#define BOARD_TYPE "STM32G4"
71+
#elif defined(STM32WB)
72+
#warning STM32WB board selected
73+
#define BOARD_TYPE "STM32WB"
74+
#elif defined(STM32MP1)
75+
#warning STM32MP1 board selected
76+
#define BOARD_TYPE "STM32MP1"
77+
#else
78+
#warning STM32 unknown board selected
79+
#define BOARD_TYPE "STM32 Unknown"
80+
#endif
81+
82+
#ifndef BOARD_NAME
83+
#define BOARD_NAME BOARD_TYPE
84+
#endif
85+
186
#include <LwIP.h>
287
#include <STM32Ethernet.h>
3-
4-
#include <STM32AsyncTCP.h>
588
#include <AsyncWebServer_STM32.h>
689

790
// Enter a MAC address and IP address for your controller below.
@@ -145,7 +228,6 @@ void onWsEvent(AsyncWebSocket * server, AsyncWebSocketClient * client, AwsEventT
145228
}
146229
}
147230

148-
149231
const char * hostName = "esp-async";
150232
const char* http_username = "admin";
151233
const char* http_password = "admin";

examples/Async_AdvancedWebServer/Async_AdvancedWebServer.ino

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/****************************************************************************************************************************
2-
Async_AdvancedWebServer.h - Dead simple AsyncWebServer for STM32 built-in LAN8742A Ethernet
2+
Async_AdvancedWebServer.ino - Dead simple AsyncWebServer for STM32 built-in LAN8742A Ethernet
33
44
For STM32 with built-in LAN8742A Ethernet (Nucleo-144, DISCOVERY, etc)
55
@@ -37,12 +37,13 @@
3737
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
3838
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3939
40-
Version: 1.2.3
40+
Version: 1.2.3a
4141
4242
Version Modified By Date Comments
4343
------- ----------- ---------- -----------
4444
1.2.3 K Hoang 02/09/2020 Initial coding for STM32 for built-in Ethernet (Nucleo-144, DISCOVERY, etc).
4545
Bump up version to v1.2.3 to sync with ESPAsyncWebServer v1.2.3
46+
1.2.3a K Hoang 05/09/2020 Add back MD5/SHA1 authentication feature.
4647
*****************************************************************************************************************************/
4748
/*
4849
Currently support

examples/Async_HelloServer/Async_HelloServer.ino

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,13 @@
99
Built by Khoi Hoang https://github.com/khoih-prog/AsyncWebServer_STM32
1010
Licensed under MIT license
1111
12-
Version: 1.0.0
12+
Version: 1.2.3a
1313
1414
Version Modified By Date Comments
1515
------- ----------- ---------- -----------
16-
1.0.0 K Hoang 02/09/2020 Initial coding for STM32 for built-in Ethernet (Nucleo-144, DISCOVERY, etc)
16+
1.2.3 K Hoang 02/09/2020 Initial coding for STM32 for built-in Ethernet (Nucleo-144, DISCOVERY, etc).
17+
Bump up version to v1.2.3 to sync with ESPAsyncWebServer v1.2.3
18+
1.2.3a K Hoang 05/09/2020 Add back MD5/SHA1 authentication feature.
1719
*****************************************************************************************************************************/
1820
/*
1921
Currently support

examples/Async_HelloServer2/Async_HelloServer2.ino

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/****************************************************************************************************************************
2-
Async_HelloServer.h - Dead simple AsyncWebServer for STM32 built-in LAN8742A Ethernet
2+
Async_HelloServer.ino - Dead simple AsyncWebServer for STM32 built-in LAN8742A Ethernet
33
44
For STM32 with built-in LAN8742A Ethernet (Nucleo-144, DISCOVERY, etc)
55
@@ -8,12 +8,14 @@
88
Based on and modified from ESPAsyncWebServer (https://github.com/me-no-dev/ESPAsyncWebServer)
99
Built by Khoi Hoang https://github.com/khoih-prog/AsyncWebServer_STM32
1010
Licensed under MIT license
11-
12-
Version: 1.0.0
11+
12+
Version: 1.2.3a
1313
1414
Version Modified By Date Comments
1515
------- ----------- ---------- -----------
16-
1.0.0 K Hoang 02/09/2020 Initial coding for STM32 for built-in Ethernet (Nucleo-144, DISCOVERY, etc)
16+
1.2.3 K Hoang 02/09/2020 Initial coding for STM32 for built-in Ethernet (Nucleo-144, DISCOVERY, etc).
17+
Bump up version to v1.2.3 to sync with ESPAsyncWebServer v1.2.3
18+
1.2.3a K Hoang 05/09/2020 Add back MD5/SHA1 authentication feature.
1719
*****************************************************************************************************************************/
1820
/*
1921
Currently support

0 commit comments

Comments
 (0)