Portenta_H7_AsyncTCP. Done, waiting for final tests, touch, docs, and to be published
Portenta_H7_AsyncWebServer. Done for Ethernet, waiting for final tests, touch, docs, and to be published. Next will be for Murata WiFi
Please comment if you have any suggestion and/or enhancement to be included.
Best Regards,
Test Results:
1. Async_AdvancedWebServer
2. MQTT_ThingStream on PORTENTA_H7_M7
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
to apply the better and faster asynchronous feature of the powerfulESPAsyncTCP Library into Portenta_H7 boards, and will be the base for future and more advanced Async libraries for Portenta_H7, such as Portenta_H7_AsyncWebServer, Portenta_H7_AsyncHTTPRequest, Portenta_H7_AsyncHTTPSRequest
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
Initial coding to support Portenta_H7 boards such as Portenta_H7 Rev2 ABX00042, etc., using ArduinoCore-mbed mbed_portenta core and Vision-shield Ethernet
to apply the better and faster asynchronous feature of the powerfulESPAsyncWebServer 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
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
Initial coding to support Portenta_H7 boards such as Portenta_H7 Rev2 ABX00042, etc., using ArduinoCore-mbed mbed_portenta core and Vision-shield Ethernet
Debug Terminal Output Samples
1. AsyncUdpNTPClient on PORTENTA_H7_M7 using Ethernet
This is terminal debug output when running AsyncUdpNTPClient on PORTENTA_H7_M7 using Ethernet and Portenta_Ethernet Library. It connects to NTP Server 0.ca.pool.ntp.org (IP=208.81.1.244:123) using Portenta_H7_AsyncUDP library, and requests NTP time every 60s. The packet is then received and processed asynchronously to print current UTC/GMT time.
Start AsyncUdpNTPClient on PORTENTA_H7_M7 with Ethernet using Portenta_Ethernet Library
Portenta_H7_AsyncUDP v1.0.0
Using mac index = 5
Connected! IP address: 192.168.2.87
UDP connected
============= createNTPpacket =============
Sending UDP Packet
Sent UDP Packet
Received UDP Packet Type: Unicast
From: 208.81.1.244:123, To: 192.168.2.87:58997, Length: 48
Seconds since Jan 1 1900 = 3842738319
Epoch/Unix time = 1633749519
The UTC/GMT time is Sat 2021-10-09 03:18:39 GMT
============= createNTPpacket =============
Sending UDP Packet
Sent UDP Packet
Received UDP Packet Type: Unicast
From: 208.81.1.244:123, To: 192.168.2.87:58997, Length: 48
Seconds since Jan 1 1900 = 3842738378
Epoch/Unix time = 1633749578
The UTC/GMT time is Sat 2021-10-09 03:19:38 GMT
Methods similar in format and usage to XmlHTTPrequest in Javascript.
Supports
GET, POST, PUT, PATCH, DELETE and HEAD
Request and response headers
Chunked response
Single String response for short (<~5K) responses (heap permitting).
Optional onData callback.
Optional onReadyStatechange callback.
Principles of operation
This library adds a simple HTTP layer on top of the Portenta_H7_AsyncTCP library to facilitate REST communication from a Client to a Server. The paradigm is similar to the XMLHttpRequest in Javascript, employing the notion of a ready-state progression through the transaction request.
Synchronization can be accomplished using callbacks on ready-state change, a callback on data receipt, or simply polling for ready-state change. Data retrieval can be incremental as received, or bulk retrieved when the transaction completes provided there is enough heap to buffer the entire response.
Initial Releases v1.0.0
Initial coding to support Portenta_H7 boards such as Portenta_H7 Rev2 ABX00042, etc., using ArduinoCore-mbed mbed_portenta core with Vision-shield Ethernet ot Murata WiFi