Features
This library is based on, modified from:
to apply the better and faster asynchronous feature of the powerful ESPAsyncWebServer Library into Portenta_H7. Thus Portenta_H7_AsyncWebServer is part of a series of advanced Async libraries, such as AsyncTCP, AsyncUDP, AsyncWebSockets, AsyncHTTPRequest, AsyncHTTPSRequest, etc. to be written or modified to support Portenta_H7, using either Vision-shield Ethernet or Murata WiFi.
Why Async is better
- Using asynchronous network means that you can handle more than one connection at the same time
- You are called once the request is ready and parsed
- When you send the response, you are immediately ready to handle other connections while the server is taking care of sending the response in the background
- Speed is OMG
- Easy to use API, HTTP Basic and Digest MD5 Authentication (default), ChunkedResponse
- Easily extensible to handle any type of content
- Supports Continue 100
- Async WebSocket plugin offering different locations without extra servers or ports
- Async EventSource (Server-Sent Events) plugin to send events to the browser
- URL Rewrite plugin for conditional and permanent url rewrites
- ServeStatic plugin that supports cache, Last-Modified, default index and more
- Simple template processing engine to handle templates
Currently supported Boards
-
Portenta_H7 boards such as Portenta_H7 Rev2 ABX00042, etc., using ArduinoCore-mbed mbed_portenta core using
Vision-shield Ethernet
Debug Terminal Output Samples
1. MQTT_ThingStream on PORTENTA_H7_M7 using Ethernet
Following is debug terminal output when running example MQTT_ThingStream on PORTENTA_H7_M7 using Ethernet and Portenta_Ethernet Library
Start MQTT_ThingStream on PORTENTA_H7_M7 with Ethernet using Portenta_Ethernet Library
Portenta_H7_AsyncTCP v1.0.0
Portenta_H7_AsyncWebServer v1.0.0
Using mac index = 17
Connected! IP address: 192.168.2.87
***************************************
STM32_Pub
***************************************
Attempting MQTT connection to broker.emqx.io
...connected
Published connection message successfully!
Subcribed to: STM32_Sub
MQTT Message Send : STM32_Pub => Hello from MQTT_ThingStream on PORTENTA_H7_M7 with Ethernet using Portenta_Ethernet Library
MQTT Message receive [STM32_Pub] Hello from MQTT_ThingStream on PORTENTA_H7_M7 with Ethernet using Portenta_Ethernet Library
MQTT Message Send : STM32_Pub => Hello from MQTT_ThingStream on PORTENTA_H7_M7 with Ethernet using Portenta_Ethernet Library
MQTT Message receive [STM32_Pub] Hello from MQTT_ThingStream on PORTENTA_H7_M7 with Ethernet using Portenta_Ethernet Library
2. Async_HTTPBasicAuth on PORTENTA_H7_M7 using Ethernet
Following is debug terminal output when running example Async_HTTPBasicAuth on PORTENTA_H7_M7 using Ethernet and Portenta_Ethernet Library
Start Async_HTTPBasicAuth on PORTENTA_H7_M7 with Ethernet using Portenta_Ethernet Library
Portenta_H7_AsyncTCP v1.0.0
Portenta_H7_AsyncWebServer v1.0.0
Using mac index = 16
Connected! IP address: 192.168.2.87
Async_HttpBasicAuth started @ IP : 192.168.2.87
Open http://192.168.2.87/ in your browser to see it working
Login using username = admin and password = ethernet
[AWS] getMD5: Success
[AWS] genRandomMD5: res = 795d0e2e77f0bd1ac56d88a223e30cc8
[AWS] getMD5: Success
[AWS] genRandomMD5: res = 0bc073c1bf61fa0ae678fa5892cfd2a6
[AWS] requestDigestAuthentication: header = realm="asyncesp", qop="auth", nonce="795d0e2e77f0bd1ac56d88a223e30cc8", opaque="0bc073c1bf61fa0ae678fa5892cfd2a6"
[AWS] getMD5: Success
[AWS] stringMD5: res = 9384b554a02515c9481a13b3787821da
[AWS] getMD5: Success
[AWS] stringMD5: res = 71998c64aea37ae77020c49c00f73fa8
[AWS] getMD5: Success
[AWS] stringMD5: res = 5908212c923b4d99fd278772873a142f
[AWS] AUTH SUCCESS