Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Jan 29, 2023. It is now read-only.

AsyncWebServer for STM32 using builtin LAN8742A Ethernet. This AsyncWebServer Library for STM32 is currently working on STM32 boards, such as Nucleo-144 F767ZI, etc., using builtin LAN8742A Ethernet. Now support using CString to save heap to send very large data

License

NotificationsYou must be signed in to change notification settings

khoih-prog/AsyncWebServer_STM32

Repository files navigation

arduino-library-badgeGitHub releasecontributions welcomeGitHub issues

Donate to my libraries using BuyMeACoffee



Table of contents



Important Change from v1.5.0

ForGeneric STM32F4 series boards, such asSTM32F407VE, using LAN8720,please use STM32 core v2.2.0 as breaking core v2.3.0 creates the compile error. Will fix in the near future.



Important Note from v1.6.0

The newv1.6.0+ has added a new and powerful feature to permit usingCString to save heap to sendvery large data.

Check themarvelleous PRs of@salasidis inPortenta_H7_AsyncWebServer library

and these new examples

  1. Async_AdvancedWebServer_MemoryIssues_Send_CString
  2. Async_AdvancedWebServer_MemoryIssues_SendArduinoString

If using Arduino String, to send a buffer around 5,5 KBytes, the usedMax Heap is around48,716 bytes

If using CString in regular memory, with the much larger 31 KBytes, the usedMax Heap is around42,952 bytes

This is very critical in use-cases where sendingvery large data is necessary, withoutheap-allocation-error.

  1. The traditional function used to sendArduino String is

voidsend(int code,const String& contentType = String(),const String& content = String());

voidsend(int code,const String& contentType = String(),const String& content = String());

such as

request->send(200, textPlainStr, ArduinoStr);

The required additional HEAP is about2 times of the String size

  1. To useCString with copying while sending. Use function

voidsend(int code,const String& contentType,constchar *content,bool copyingSend =true);// RSMOD

voidsend(int code,const String& contentType,constchar *content,bool copyingSend =true);// RSMOD

such as

request->send(200, textPlainStr, cStr);

The required additional HEAP is also about2 times of the CString size because ofunnecessary copies of the CString in HEAP. Avoid thisunefficient way.

  1. To useCString without copying while sending. Use function

voidsend(int code,const String& contentType,constchar *content,bool copyingSend =true);// RSMOD

voidsend(int code,const String& contentType,constchar *content,bool copyingSend =true);// RSMOD

such as

request->send(200, textPlainStr, cStr,false);

The required additional HEAP is about1 times of the CString size. This way is the best andmost efficient way to use by avoiding ofunnecessary copies of the CString in HEAP



Why do we need thisAsyncWebServer_STM32 library

Features

This library is based on, modified from:

  1. Hristo Gochkov's ESPAsyncWebServer

to apply the better and fasterasynchronous feature of thepowerfulESPAsyncWebServer Library intoSTM32F/L/H/G/WB/MP1 boards using LAN8720 or built-in LAN8742A Ethernet.

Why Async is better

  • Using asynchronous network means that you can handlemore than one connection at the same time
  • You are called once the request is ready and parsed
  • When you send the response, you areimmediately 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 handleany 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

  1. STM32F/L/H/G/WB/MP1 boards with built-in Ethernet LAN8742A such as :
  1. STM32F4/F7 boards using Ethernet LAN8720 such as :
  • Nucleo-144 (F429ZI, NUCLEO_F746NG, NUCLEO_F746ZG, NUCLEO_F756ZG)
  • Discovery (DISCO_F746NG)
  • STM32F4 boards (BLACK_F407VE, BLACK_F407VG, BLACK_F407ZE, BLACK_F407ZG, BLACK_F407VE_Mini, DIYMORE_F407VGT, FK407M1)


Prerequisites

  1. Arduino IDE 1.8.19+ for Arduino.GitHub release
  2. Arduino Core for STM32 v2.3.0+ for STM32 boards.GitHub release
  3. STM32Ethernet library v1.3.0+ for built-in LAN8742A Ethernet on (Nucleo-144, Discovery).GitHub release
  4. LwIP library v2.1.2+ for built-in LAN8742A Ethernet on (Nucleo-144, Discovery).GitHub release
  5. STM32AsyncTCP library v1.0.1+ for built-in Ethernet on (Nucleo-144, Discovery). To install manually for Arduino IDE.

Installation

Use Arduino Library Manager

The best and easiest way is to useArduino Library Manager. Search forAsyncWebServer_STM32, then select / install the latest version. You can also use this linkarduino-library-badge for more detailed instructions.

Manual Install

  1. Navigate toAsyncWebServer_STM32 page.
  2. Download the latest releaseAsyncWebServer_STM32-master.zip.
  3. Extract the zip file toAsyncWebServer_STM32-master directory
  4. Copy the wholeAsyncWebServer_STM32-master folder to Arduino libraries' directory such as~/Arduino/libraries/.

VS Code & PlatformIO:

  1. InstallVS Code
  2. InstallPlatformIO
  3. InstallAsyncWebServer_STM32 library by usingLibrary Manager. Search forAsyncWebServer_STM32 inPlatform.io Author's Libraries
  4. Use includedplatformio.ini file from examples to ensure that all dependent libraries will installed automatically. Please visit documentation for the other options and examples atProject Configuration File


Packages' Patches

1. For STM32 boards to use LAN8720

To use LAN8720 on some STM32 boards

  • Nucleo-144 (F429ZI, NUCLEO_F746NG, NUCLEO_F746ZG, NUCLEO_F756ZG)
  • Discovery (DISCO_F746NG)
  • STM32F4 boards (BLACK_F407VE, BLACK_F407VG, BLACK_F407ZE, BLACK_F407ZG, BLACK_F407VE_Mini, DIYMORE_F407VGT, FK407M1)

you have to copy the filesstm32f4xx_hal_conf_default.h andstm32f7xx_hal_conf_default.h into STM32 stm32 directory (~/.arduino15/packages/STM32/hardware/stm32/2.3.0/system) to overwrite the old files.

Supposing the STM32 stm32 core version is 2.3.0. These files must be copied into the directory:

  • ~/.arduino15/packages/STM32/hardware/stm32/2.3.0/system/STM32F4xx/stm32f4xx_hal_conf_default.h for STM32F4.
  • ~/.arduino15/packages/STM32/hardware/stm32/2.3.0/system/STM32F7xx/stm32f7xx_hal_conf_default.h for Nucleo-144 STM32F7.

Whenever a new version is installed, remember to copy this file into the new version directory. For example, new version is x.yy.zz,these files must be copied into the corresponding directory:

  • ~/.arduino15/packages/STM32/hardware/stm32/x.yy.zz/system/STM32F4xx/stm32f4xx_hal_conf_default.h
  • `~/.arduino15/packages/STM32/hardware/stm32/x.yy.zz/system/STM32F7xx/stm32f7xx_hal_conf_default.h

2. For STM32 boards to use Serial1

To use Serial1 on some STM32 boards without Serial1 definition (Nucleo-144 NUCLEO_F767ZI, Nucleo-64 NUCLEO_L053R8, etc.) boards, you have to copy the filesSTM32 variant.h into STM32 stm32 directory (~/.arduino15/packages/STM32/hardware/stm32/2.3.0). You have to modify the files corresponding to your boards, this is just an illustration how to do.

Supposing the STM32 stm32 core version is 2.3.0. These files must be copied into the directory:

  • ~/.arduino15/packages/STM32/hardware/stm32/2.3.0/variants/NUCLEO_F767ZI/variant.h for Nucleo-144 NUCLEO_F767ZI.
  • ~/.arduino15/packages/STM32/hardware/stm32/2.3.0/variants/NUCLEO_L053R8/variant.h for Nucleo-64 NUCLEO_L053R8.

Whenever a new version is installed, remember to copy this file into the new version directory. For example, new version is x.yy.zz,these files must be copied into the corresponding directory:

  • ~/.arduino15/packages/STM32/hardware/stm32/x.yy.zz/variants/NUCLEO_F767ZI/variant.h
  • ~/.arduino15/packages/STM32/hardware/stm32/x.yy.zz/variants/NUCLEO_L053R8/variant.h


Important things to remember

  • This is fully asynchronous server and as such does not run on the loop thread.
  • You can not useyield() ordelay() or any function that uses them inside the callbacks
  • The server is smart enough to know when to close the connection and free resources
  • You can not send more than one response to a single request

Principles of operation

The Async Web server

  • Listens for connections
  • Wraps the new clients intoRequest
  • Keeps track of clients and cleans memory
  • ManagesRewrites and apply them on the request url
  • ManagesHandlers and attaches them to Requests

Request Life Cycle

  • TCP connection is received by the server
  • The connection is wrapped insideRequest object
  • When the request head is received (type, url, get params, http version and host),the server goes through allRewrites (in the order they were added) to rewrite the url and inject query parameters,next, it goes through all attachedHandlers (in the order they were added) trying to find onethatcanHandle the given request. If none are found, the default(catch-all) handler is attached.
  • The rest of the request is received, calling thehandleUpload orhandleBody methods of theHandler if they are needed (POST+File/Body)
  • When the whole request is parsed, the result is given to thehandleRequest method of theHandler and is ready to be responded to
  • In thehandleRequest method, to theRequest is attached aResponse object (see below) that will serve the response data back to the client
  • When theResponse is sent, the client is closed and freed from the memory

Rewrites and how do they work

  • TheRewrites are used to rewrite the request url and/or inject get parameters for a specific request url path.
  • AllRewrites are evaluated on the request in the order they have been added to the server.
  • TheRewrite will change the request url only if the request url (excluding get parameters) is fully matchthe rewrite url, and when the optionalFilter callback return true.
  • Setting aFilter to theRewrite enables to control when to apply the rewrite, decision can be based onrequest url, http version, request host/port/target host, get parameters or the request client's localIP or remoteIP.
  • TheRewrite can specify a target url with optional get parameters, e.g./to-url?with=params

Handlers and how do they work

  • TheHandlers are used for executing specific actions to particular requests
  • OneHandler instance can be attached to any request and lives together with the server
  • Setting aFilter to theHandler enables to control when to apply the handler, decision can be based onrequest url, http version, request host/port/target host, get parameters or the request client's localIP or remoteIP.
  • ThecanHandle method is used for handler specific control on whether the requests can be handledand for declaring any interesting headers that theRequest should parse. Decision can be based on requestmethod, request url, http version, request host/port/target host and get parameters
  • Once aHandler is attached to givenRequest (canHandle returned true)thatHandler takes care to receive any file/data upload and attach aResponseonce theRequest has been fully parsed
  • Handlers are evaluated in the order they are attached to the server. ThecanHandle is called onlyif theFilter that was set to theHandler return true.
  • The firstHandler that can handle the request is selected, not furtherFilter andcanHandle are called.

Responses and how do they work

  • TheResponse objects are used to send the response data back to the client
  • TheResponse object lives with theRequest and is freed on end or disconnect
  • Different techniques are used depending on the response type to send the data in packetsreturning back almost immediately and sending the next packet when this one is received.Any time in between is spent to run the user loop and handle other network packets
  • Responding asynchronously is probably the most difficult thing for most to understand
  • Many different options exist for the user to make responding a background task

Template processing

  • AsyncWebServer_STM32 contains simple template processing engine.
  • Template processing can be added to most response types.
  • Currently it supports only replacing template placeholders with actual values. No conditional processing, cycles, etc.
  • Placeholders are delimited with% symbols. Like this:%TEMPLATE_PLACEHOLDER%.
  • It works by extracting placeholder name from response text and passing it to user provided function which should return actual value to be used instead of placeholder.
  • Since it's user provided function, it is possible for library users to implement conditional processing and cycles themselves.
  • Since it's impossible to know the actual response size after template processing step in advance (and, therefore, to include it in response headers), the response becomeschunked.

Request Variables

Common Variables

request->version();// uint8_t: 0 = HTTP/1.0, 1 = HTTP/1.1request->method();// enum:    HTTP_GET, HTTP_POST, HTTP_DELETE, HTTP_PUT, HTTP_PATCH, HTTP_HEAD, HTTP_OPTIONSrequest->url();// String:  URL of the request (not including host, port or GET parameters)request->host();// String:  The requested host (can be used for virtual hosting)request->contentType();// String:  ContentType of the request (not available in Handler::canHandle)request->contentLength();// size_t:  ContentLength of the request (not available in Handler::canHandle)request->multipart();// bool:    True if the request has content type "multipart"

Headers

//List all collected headersint headers = request->headers();int i;for (i=0;i<headers;i++){  AsyncWebHeader* h = request->getHeader(i);  Serial.printf("HEADER[%s]: %s\n", h->name().c_str(), h->value().c_str());}//get specific header by nameif (request->hasHeader("MyHeader")){  AsyncWebHeader* h = request->getHeader("MyHeader");  Serial.printf("MyHeader: %s\n", h->value().c_str());}//List all collected headers (Compatibility)int headers = request->headers();int i;for (i=0;i<headers;i++){  Serial.printf("HEADER[%s]: %s\n", request->headerName(i).c_str(), request->header(i).c_str());}//get specific header by name (Compatibility)if (request->hasHeader("MyHeader")){  Serial.printf("MyHeader: %s\n", request->header("MyHeader").c_str());}

GET, POST and FILE parameters

//List all parametersint params = request->params();for (int i=0;i<params;i++){  AsyncWebParameter* p = request->getParam(i);if (p->isFile())  {//p->isPost() is also true    Serial.printf("FILE[%s]: %s, size: %u\n", p->name().c_str(), p->value().c_str(), p->size());  }elseif (p->isPost())  {    Serial.printf("POST[%s]: %s\n", p->name().c_str(), p->value().c_str());  }else   {    Serial.printf("GET[%s]: %s\n", p->name().c_str(), p->value().c_str());  }}//Check if GET parameter existsif (request->hasParam("download"))  AsyncWebParameter* p = request->getParam("download");//Check if POST (but not File) parameter existsif (request->hasParam("download",true))  AsyncWebParameter* p = request->getParam("download",true);//Check if FILE was uploadedif (request->hasParam("download",true,true))  AsyncWebParameter* p = request->getParam("download",true,true);//List all parameters (Compatibility)int args = request->args();for (int i=0;i<args;i++){  Serial.printf("ARG[%s]: %s\n", request->argName(i).c_str(), request->arg(i).c_str());}//Check if parameter exists (Compatibility)if (request->hasArg("download"))  String arg = request->arg("download");

JSON body handling with ArduinoJson

Endpoints which consume JSON can use a special handler to get ready to use JSON data in the request callback:

#include"AsyncJson.h"#include"ArduinoJson.h"AsyncCallbackJsonWebHandler* handler =new AsyncCallbackJsonWebHandler("/rest/endpoint", [](AsyncWebServerRequest *request, JsonVariant &json) {  JsonObject& jsonObj = json.as<JsonObject>();// ...});server.addHandler(handler);

Responses

Redirect to another URL

//to local urlrequest->redirect("/login");//to external urlrequest->redirect("http://esp8266.com");

Basic response with HTTP Code

request->send(404);//Sends 404 File Not Found

Basic response with HTTP Code and extra headers

AsyncWebServerResponse *response = request->beginResponse(404);//Sends 404 File Not Foundresponse->addHeader("Server","AsyncWebServer_STM32");request->send(response);

Basic response with string content

request->send(200,"text/plain","Hello World!");

Basic response with string content and extra headers

AsyncWebServerResponse *response = request->beginResponse(200,"text/plain","Hello World!");response->addHeader("Server","AsyncWebServer");request->send(response);

Respond with content coming from a Stream

//read 12 bytes from Serial and send them as Content Type text/plainrequest->send(Serial,"text/plain",12);

Respond with content coming from a Stream and extra headers

//read 12 bytes from Serial and send them as Content Type text/plainAsyncWebServerResponse *response = request->beginResponse(Serial,"text/plain",12);response->addHeader("Server","AsyncWebServer_STM32");request->send(response);

Respond with content coming from a Stream containing templates

Stringprocessor(const String& var){if (var =="HELLO_FROM_TEMPLATE")returnF("Hello world!");returnString();}// ...//read 12 bytes from Serial and send them as Content Type text/plainrequest->send(Serial,"text/plain",12, processor);

Respond with content coming from a Stream containing templates and extra headers

Stringprocessor(const String& var){if (var =="HELLO_FROM_TEMPLATE")returnF("Hello world!");returnString();}// ...//read 12 bytes from Serial and send them as Content Type text/plainAsyncWebServerResponse *response = request->beginResponse(Serial,"text/plain",12, processor);response->addHeader("Server","AsyncWebServer_STM32");request->send(response);

Respond with content using a callback

//send 128 bytes as plain textrequest->send("text/plain",128, [](uint8_t *buffer,size_t maxLen,size_t index) -> size_t {//Write up to "maxLen" bytes into "buffer" and return the amount written.//index equals the amount of bytes that have been already sent//You will not be asked for more bytes once the content length has been reached.//Keep in mind that you can not delay or yield waiting for more data!//Send what you currently have and you will be asked for more againreturn mySource.read(buffer, maxLen);});

Respond with content using a callback and extra headers

//send 128 bytes as plain textAsyncWebServerResponse *response = request->beginResponse("text/plain",128, [](uint8_t *buffer,size_t maxLen,size_t index) -> size_t {//Write up to "maxLen" bytes into "buffer" and return the amount written.//index equals the amount of bytes that have been already sent//You will not be asked for more bytes once the content length has been reached.//Keep in mind that you can not delay or yield waiting for more data!//Send what you currently have and you will be asked for more againreturn mySource.read(buffer, maxLen);});response->addHeader("Server","AsyncWebServer_STM32");request->send(response);

Respond with content using a callback containing templates

Stringprocessor(const String& var){if (var =="HELLO_FROM_TEMPLATE")returnF("Hello world!");returnString();}// ...//send 128 bytes as plain textrequest->send("text/plain",128, [](uint8_t *buffer,size_t maxLen,size_t index) -> size_t {//Write up to "maxLen" bytes into "buffer" and return the amount written.//index equals the amount of bytes that have been already sent//You will not be asked for more bytes once the content length has been reached.//Keep in mind that you can not delay or yield waiting for more data!//Send what you currently have and you will be asked for more againreturn mySource.read(buffer, maxLen);}, processor);

Respond with content using a callback containing templates and extra headers

Stringprocessor(const String& var){if (var =="HELLO_FROM_TEMPLATE")returnF("Hello world!");returnString();}// ...//send 128 bytes as plain textAsyncWebServerResponse *response = request->beginResponse("text/plain",128, [](uint8_t *buffer,size_t maxLen,size_t index) -> size_t {//Write up to "maxLen" bytes into "buffer" and return the amount written.//index equals the amount of bytes that have been already sent//You will not be asked for more bytes once the content length has been reached.//Keep in mind that you can not delay or yield waiting for more data!//Send what you currently have and you will be asked for more againreturn mySource.read(buffer, maxLen);}, processor);response->addHeader("Server","AsyncWebServer_STM32");request->send(response);

Chunked Response

Used when content length is unknown. Works best if the client supports HTTP/1.1

AsyncWebServerResponse *response = request->beginChunkedResponse("text/plain", [](uint8_t *buffer,size_t maxLen,size_t index) -> size_t {//Write up to "maxLen" bytes into "buffer" and return the amount written.//index equals the amount of bytes that have been already sent//You will be asked for more data until 0 is returned//Keep in mind that you can not delay or yield waiting for more data!return mySource.read(buffer, maxLen);});response->addHeader("Server","AsyncWebServer_STM32");request->send(response);

Chunked Response containing templates

Used when content length is unknown. Works best if the client supports HTTP/1.1

Stringprocessor(const String& var){if (var =="HELLO_FROM_TEMPLATE")returnF("Hello world!");returnString();}// ...AsyncWebServerResponse *response = request->beginChunkedResponse("text/plain", [](uint8_t *buffer,size_t maxLen,size_t index) -> size_t {//Write up to "maxLen" bytes into "buffer" and return the amount written.//index equals the amount of bytes that have been already sent//You will be asked for more data until 0 is returned//Keep in mind that you can not delay or yield waiting for more data!return mySource.read(buffer, maxLen);}, processor);response->addHeader("Server","AsyncWebServer_STM32");request->send(response);

Print to response

AsyncResponseStream *response = request->beginResponseStream("text/html");response->addHeader("Server","AsyncWebServer_STM32");response->printf("<!DOCTYPE html><html><head><title>Webpage at %s</title></head><body>", request->url().c_str());response->print("<h2>Hello");response->print(request->client()->remoteIP());response->print("</h2>");response->print("<h3>General</h3>");response->print("<ul>");response->printf("<li>Version: HTTP/1.%u</li>", request->version());response->printf("<li>Method: %s</li>", request->methodToString());response->printf("<li>URL: %s</li>", request->url().c_str());response->printf("<li>Host: %s</li>", request->host().c_str());response->printf("<li>ContentType: %s</li>", request->contentType().c_str());response->printf("<li>ContentLength: %u</li>", request->contentLength());response->printf("<li>Multipart: %s</li>", request->multipart()?"true":"false");response->print("</ul>");response->print("<h3>Headers</h3>");response->print("<ul>");int headers = request->headers();for (int i=0;i<headers;i++){  AsyncWebHeader* h = request->getHeader(i);  response->printf("<li>%s: %s</li>", h->name().c_str(), h->value().c_str());}response->print("</ul>");response->print("<h3>Parameters</h3>");response->print("<ul>");int params = request->params();for (int i=0;i<params;i++){  AsyncWebParameter* p = request->getParam(i);if (p->isFile())  {    response->printf("<li>FILE[%s]: %s, size: %u</li>", p->name().c_str(), p->value().c_str(), p->size());  }elseif (p->isPost())  {    response->printf("<li>POST[%s]: %s</li>", p->name().c_str(), p->value().c_str());  }else   {    response->printf("<li>GET[%s]: %s</li>", p->name().c_str(), p->value().c_str());  }}response->print("</ul>");response->print("</body></html>");//send the response lastrequest->send(response);

ArduinoJson Basic Response

This way of sending Json is great for when the result isbelow 4KB

#include"AsyncJson.h"#include"ArduinoJson.h"AsyncResponseStream *response = request->beginResponseStream("application/json");DynamicJsonBuffer jsonBuffer;JsonObject &root = jsonBuffer.createObject();root["heap"] = ESP.getFreeHeap();root["ssid"] = WiFi.SSID();root.printTo(*response);request->send(response);

ArduinoJson Advanced Response

This response can handle reallylarge Json objects (tested to 40KB)

There isn't any noticeable speed decrease for small results with the method above

Since ArduinoJson does not allow reading parts of the string, the whole Json has to be passed every time achunks needs to be sent, which shows speed decrease proportional to the resulting json packets

#include"AsyncJson.h"#include"ArduinoJson.h"AsyncJsonResponse * response =new AsyncJsonResponse();response->addHeader("Server","AsyncWebServer");JsonObject& root = response->getRoot();root["IP"] = Ethernet.localIP();response->setLength();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}"

classOneParamRewrite :publicAsyncWebRewrite{protected:    String _urlPrefix;int _paramIndex;    String _paramsBackup;public:OneParamRewrite(constchar* from,constchar* to)      : AsyncWebRewrite(from, to)    {      _paramIndex = _from.indexOf('{');if ( _paramIndex >=0 && _from.endsWith("}"))      {        _urlPrefix = _from.substring(0, _paramIndex);int index = _params.indexOf('{');if (index >=0)        {          _params = _params.substring(0, index);        }      }else      {        _urlPrefix = _from;      }      _paramsBackup = _params;    }boolmatch(AsyncWebServerRequest *request)override    {if (request->url().startsWith(_urlPrefix))      {if (_paramIndex >=0)        {          _params = _paramsBackup + request->url().substring(_paramIndex);        }else        {          _params = _paramsBackup;        }returntrue;      }else      {returnfalse;      }    }};

Usage:

server.addRewrite(new OneParamRewrite("/radio/{frequence}","/radio?f={frequence}") );

Using filters

Filters can be set toRewrite orHandler in order to control when to apply the rewrite and consider the handler.A filter is a callback function that evaluates the request and return a booleantrue to include the itemorfalse to exclude it.


Bad Responses

Some responses are implemented, but you should not use them, because they do not conform to HTTP.The following example will lead to unclean close of the connection and more time wastedthan providing the length of the content

Respond with content using a callback without content length to HTTP/1.0 clients

//This is used as fallback for chunked responses to HTTP/1.0 Clientsrequest->send("text/plain",0, [](uint8_t *buffer,size_t maxLen,size_t index) -> size_t {//Write up to "maxLen" bytes into "buffer" and return the amount written.//You will be asked for more data until 0 is returned//Keep in mind that you can not delay or yield waiting for more data!return mySource.read(buffer, maxLen);});

Async WebSocket Plugin

The server includes a web socket plugin which lets you define different WebSocket locations to connect towithout starting another listening service or using different port

Async WebSocket Event

voidonEvent(AsyncWebSocket * server, AsyncWebSocketClient * client, AwsEventType type,void * arg,uint8_t *data,size_t len){if (type == WS_EVT_CONNECT)  {//client connected    Serial.printf("ws[%s][%u] connect\n", server->url(), client->id());    client->printf("Hello Client %u :)", client->id());    client->ping();  }elseif (type == WS_EVT_DISCONNECT)  {//client disconnected    Serial.printf("ws[%s][%u] disconnect: %u\n", server->url(), client->id());  }elseif (type == WS_EVT_ERROR)  {//error was received from the other end    Serial.printf("ws[%s][%u] error(%u): %s\n", server->url(), client->id(), *((uint16_t*)arg), (char*)data);  }elseif (type == WS_EVT_PONG)  {//pong message was received (in response to a ping request maybe)    Serial.printf("ws[%s][%u] pong[%u]: %s\n", server->url(), client->id(), len, (len)?(char*)data:"");  }elseif (type == WS_EVT_DATA)  {//data packet    AwsFrameInfo * info = (AwsFrameInfo*)arg;if (info->final && info->index ==0 && info->len == len)    {//the whole message is in a single frame and we got all of it's data      Serial.printf("ws[%s][%u] %s-message[%llu]:", server->url(), client->id(), (info->opcode == WS_TEXT)?"text":"binary", info->len);if (info->opcode == WS_TEXT)      {        data[len] =0;        Serial.printf("%s\n", (char*)data);      }else       {for (size_t i=0; i < info->len; i++)        {          Serial.printf("%02x", data[i]);        }                Serial.printf("\n");      }if (info->opcode == WS_TEXT)        client->text("I got your text message");else        client->binary("I got your binary message");    }else     {//message is comprised of multiple frames or the frame is split into multiple packetsif (info->index ==0)      {if (info->num ==0)          Serial.printf("ws[%s][%u] %s-message start\n", server->url(), client->id(), (info->message_opcode == WS_TEXT)?"text":"binary");                  Serial.printf("ws[%s][%u] frame[%u] start[%llu]\n", server->url(), client->id(), info->num, info->len);      }      Serial.printf("ws[%s][%u] frame[%u] %s[%llu - %llu]:", server->url(), client->id(), info->num, (info->message_opcode == WS_TEXT)?"text":"binary", info->index, info->index + len);if (info->message_opcode == WS_TEXT)      {        data[len] =0;        Serial.printf("%s\n", (char*)data);      }else       {for (size_t i=0; i < len; i++)        {          Serial.printf("%02x", data[i]);        }                Serial.printf("\n");      }if ((info->index + len) == info->len)      {        Serial.printf("ws[%s][%u] frame[%u] end[%llu]\n", server->url(), client->id(), info->num, info->len);if (info->final)        {          Serial.printf("ws[%s][%u] %s-message end\n", server->url(), client->id(), (info->message_opcode == WS_TEXT)?"text":"binary");if (info->message_opcode == WS_TEXT)            client->text("I got your text message");else            client->binary("I got your binary message");        }      }    }  }}

Methods for sending data to a socket client

//Server methodsAsyncWebSocketws("/ws");//printf to a clientws.printf((uint32_t)client_id, arguments...);//printf to all clientsws.printfAll(arguments...);//send text to a clientws.text((uint32_t)client_id, (char*)text);ws.text((uint32_t)client_id, (uint8_t*)text, (size_t)len);//send text to all clientsws.textAll((char*)text);ws.textAll((uint8_t*)text, (size_t)len);//send binary to a clientws.binary((uint32_t)client_id, (char*)binary);ws.binary((uint32_t)client_id, (uint8_t*)binary, (size_t)len);ws.binary((uint32_t)client_id, flash_binary,4);//send binary to all clientsws.binaryAll((char*)binary);ws.binaryAll((uint8_t*)binary, (size_t)len);//HTTP Authenticate before switch to Websocket protocolws.setAuthentication("user","pass");//client methodsAsyncWebSocketClient * client;//printfclient->printf(arguments...);//send textclient->text((char*)text);client->text((uint8_t*)text, (size_t)len);//send binaryclient->binary((char*)binary);client->binary((uint8_t*)binary, (size_t)len);

Direct access to web socket message buffer

When sending a web socket message using the above methods a buffer is created. Under certain circumstances you might want to manipulate or populate this buffer directly from your application, for example to prevent unnecessary duplications of the data. This example below shows how to create a buffer and print data to it from an ArduinoJson object then send it.

voidsendDataWs(AsyncWebSocketClient * client){  DynamicJsonBuffer jsonBuffer;  JsonObject& root = jsonBuffer.createObject();  root["a"] ="abc";  root["b"] ="abcd";  root["c"] ="abcde";  root["d"] ="abcdef";  root["e"] ="abcdefg";size_t len = root.measureLength();    AsyncWebSocketMessageBuffer * buffer = ws.makeBuffer(len);//  creates a buffer (len + 1) for you.if (buffer)   {    root.printTo((char *)buffer->get(), len +1);if (client)     {        client->text(buffer);    }else     {        ws.textAll(buffer);    }  }}

Limiting the number of web socket clients

Browsers sometimes do not correctly close the websocket connection, even when theclose() function is called in javascript.This will eventually exhaust the web server's resources andwill cause the server to crash. Periodically calling thecleanClients() function from the mainloop() function limits the number of clients by closing the oldest client when the maximum number of clients has been exceeded. This can called be every cycle, however, if you wish to use less power, then calling as infrequently as once per second is sufficient.

voidloop(){  ws.cleanupClients();}

Async Event Source Plugin

The server includesEventSource (Server-Sent Events) plugin which can be used to send short text events to the browser.Difference betweenEventSource andWebSockets is thatEventSource is single direction, text-only protocol.

Setup Event Source on the server

AsyncWebServerserver(80);AsyncEventSourceevents("/events");voidsetup(){// setup ......  events.onConnect([](AsyncEventSourceClient *client)  {if (client->lastId())    {      Serial.printf("Client reconnected! Last message ID that it got is: %u\n", client->lastId());    }//send event with message "hello!", id current millis// and set reconnect delay to 1 second    client->send("hello!",NULL,millis(),1000);  });//HTTP Basic authentication  events.setAuthentication("user","pass");  server.addHandler(&events);// setup ......}voidloop(){if (eventTriggered)  {// your logic here//send event "myevent"    events.send("my event content","myevent",millis());  }}

Setup Event Source in the browser

if(!!window.EventSource){varsource=newEventSource('/events');source.addEventListener('open',function(e){console.log("Events Connected");},false);source.addEventListener('error',function(e){if(e.target.readyState!=EventSource.OPEN){console.log("Events Disconnected");}},false);source.addEventListener('message',function(e){console.log("message",e.data);},false);source.addEventListener('myevent',function(e){console.log("myevent",e.data);},false);}

Remove handlers and rewrites

Server goes through handlers in same order as they were added. You can't simple add handler with same path to override them.To remove handler:

// save callback for particular URL pathauto handler = server.on("/some/path", [](AsyncWebServerRequest *request){//do something useful});// when you don't need handler anymore remove itserver.removeHandler(&handler);// same with rewritesserver.removeRewrite(&someRewrite);server.onNotFound([](AsyncWebServerRequest *request){  request->send(404);});// remove server.onNotFound handlerserver.onNotFound(NULL);// remove all rewrites, handlers and onNotFound/onFileUpload/onRequestBody callbacksserver.reset();

Setting up the server

#include<LwIP.h>#include<STM32Ethernet.h>#include<AsyncWebServer_STM32.h>// Enter a MAC address and IP address for your controller below.#defineNUMBER_OF_MAC20byte mac[][NUMBER_OF_MAC] ={  {0xDE,0xAD,0xBE,0xEF,0x32,0x01 },  {0xDE,0xAD,0xBE,0xEF,0x32,0x02 },  {0xDE,0xAD,0xBE,0xEF,0x32,0x03 },  {0xDE,0xAD,0xBE,0xEF,0x32,0x04 },  {0xDE,0xAD,0xBE,0xEF,0x32,0x05 },  {0xDE,0xAD,0xBE,0xEF,0x32,0x06 },  {0xDE,0xAD,0xBE,0xEF,0x32,0x07 },  {0xDE,0xAD,0xBE,0xEF,0x32,0x08 },  {0xDE,0xAD,0xBE,0xEF,0x32,0x09 },  {0xDE,0xAD,0xBE,0xEF,0x32,0x0A },  {0xDE,0xAD,0xBE,0xEF,0x32,0x0B },  {0xDE,0xAD,0xBE,0xEF,0x32,0x0C },  {0xDE,0xAD,0xBE,0xEF,0x32,0x0D },  {0xDE,0xAD,0xBE,0xEF,0x32,0x0E },  {0xDE,0xAD,0xBE,0xEF,0x32,0x0F },  {0xDE,0xAD,0xBE,0xEF,0x32,0x10 },  {0xDE,0xAD,0xBE,0xEF,0x32,0x11 },  {0xDE,0xAD,0xBE,0xEF,0x32,0x12 },  {0xDE,0xAD,0xBE,0xEF,0x32,0x13 },  {0xDE,0xAD,0xBE,0xEF,0x32,0x14 },};// Select the IP address according to your local networkIPAddressip(192,168,2,232);AsyncWebServerserver(80);constint led =13;voidhandleRoot(AsyncWebServerRequest *request){digitalWrite(led,1);  request->send(200,"text/plain",String("Hello from AsyncWebServer_STM32 on") + BOARD_NAME );digitalWrite(led,0);}voidhandleNotFound(AsyncWebServerRequest *request){digitalWrite(led,1);  String message ="File Not Found\n\n";  message +="URI:";//message += server.uri();  message += request->url();  message +="\nMethod:";  message += (request->method() == HTTP_GET) ?"GET" :"POST";  message +="\nArguments:";  message += request->args();  message +="\n";for (uint8_t i =0; i < request->args(); i++)  {    message +="" + request->argName(i) +":" + request->arg(i) +"\n";  }  request->send(404,"text/plain", message);digitalWrite(led,0);}voidsetup(void){pinMode(led, OUTPUT);digitalWrite(led,0);  Serial.begin(115200);while (!Serial &&millis() <5000);    Serial.println("\nStart Async_HelloServer on" +String(BOARD_NAME));// start the ethernet connection and the server// Use random macuint16_t index =millis() % NUMBER_OF_MAC;// Use Static IP//Ethernet.begin(mac[index], ip);// Use DHCP dynamic IP and random mac  Ethernet.begin(mac[index]);  server.on("/", HTTP_GET, [](AsyncWebServerRequest * request)  {handleRoot(request);  });  server.on("/inline", [](AsyncWebServerRequest * request)  {    request->send(200,"text/plain","This works as well");  });  server.onNotFound(handleNotFound);  server.begin();  Serial.print(F("HTTP EthernetWebServer is @ IP :"));  Serial.println(Ethernet.localIP());}voidloop(void){}

Setup global and class functions as request handlers

#include<Arduino.h>#include<LwIP.h>#include<STM32Ethernet.h>#include<AsyncWebServer_STM32.h>#include<functional>...voidhandleRequest(AsyncWebServerRequest *request){}classWebClass {public :  AsyncWebServer classWebServer = AsyncWebServer(81);WebClass(){};voidclassRequest (AsyncWebServerRequest *request){}voidbegin()  {// attach global request handler    classWebServer.on("/example", HTTP_ANY, handleRequest);// attach class request handler    classWebServer.on("/example", HTTP_ANY,std::bind(&WebClass::classRequest,this, std::placeholders::_1));  }};AsyncWebServerglobalWebServer(80);WebClass webClassInstance;voidsetup() {// attach global request handler  globalWebServer.on("/example", HTTP_ANY, handleRequest);// attach class request handler  globalWebServer.on("/example", HTTP_ANY,std::bind(&WebClass::classRequest, webClassInstance, std::placeholders::_1));}voidloop() {}

Methods for controlling websocket connections

// Disable client connections if it was activatedif ( ws.enabled() )    ws.enable(false);// enable client connections if it was disabledif ( !ws.enabled() )    ws.enable(true);

Adding Default Headers

In some cases, such as when working withCORS, or with some sort of custom authentication system,you might need to define a header that should get added to all responses (including static, websocket and EventSource).TheDefaultHeaders singleton allows you to do this.

Example:

DefaultHeaders::Instance().addHeader("Access-Control-Allow-Origin","*");webServer.begin();

NOTE: You will still need to respond to the OPTIONS method forCORS pre-flight in most cases. (unless you are only using GET)

This is one option:

webServer.onNotFound([](AsyncWebServerRequest *request) {if (request->method() == HTTP_OPTIONS)   {    request->send(200);  }else   {    request->send(404);  }});

Path variable

With path variable you can create a customregex rule for a specific parameter in a route.For example we want asensorId parameter in a route rule to match only an integer.

server.on("^\\/sensor\\/([0-9]+)$", HTTP_GET, [] (AsyncWebServerRequest *request) {    String sensorId = request->pathArg(0);});

NOTE: All regex patterns starts with^ and ends with$

To enable thePath variable support, you have to define the buildflag-DASYNCWEBSERVER_REGEX.

For Arduino IDE create/updateplatform.local.txt:

Windows: C:\Users(username)\AppData\Local\Arduino15\packages\{espxxxx}\hardware\espxxxx\{version}\platform.local.txt

Linux: ~/.arduino15/packages/{espxxxx}/hardware/{espxxxx}/{version}/platform.local.txt

Add/Update the following line:

compiler.cpp.extra_flags=-DDASYNCWEBSERVER_REGEX

For platformio modifyplatformio.ini:

[env:myboard]build_flags = -DASYNCWEBSERVER_REGEX

NOTE: By enablingASYNCWEBSERVER_REGEX,<regex> will be included. This will add an 100k to your binary.



HOWTO use STM32F4 with LAN8720

1. Wiring

This is the Wiring for STM32F4 (BLACK_F407VE, etc.) using LAN8720

LAN8720 PHY<--->STM32F4
TX1<--->PB_13
TX_EN<--->PB_11
TX0<--->PB_12
RX0<--->PC_4
RX1<--->PC_5
nINT/RETCLK<--->PA_1
CRS<--->PA_7
MDIO<--->PA_2
MDC<--->PC_1
GND<--->GND
VCC<--->+3.3V

2. HOWTO program using STLink V-2 or V-3

Connect as follows. To program, useSTM32CubeProgrammer or Arduino IDE with

  • U(S)ART Support: "Enabled (generic Serial)"
  • Upload Method : "STM32CubeProgrammer (SWD)"
STLink<--->STM32F4
SWCLK<--->SWCLK
SWDIO<--->SWDIO
RST<--->NRST
GND<--->GND
5v<--->5V


3. HOWTO use Serial Port for Debugging

Connect FDTI (USB to Serial) as follows:

FDTI<--->STM32F4
RX<--->TX=PA_9
TX<--->RX=PA_10
GND<--->GND


Examples

1. For LAN8742A

  1. Async_AdvancedWebServer
  2. AsyncFSBrowser_STM32
  3. Async_HelloServer
  4. Async_HelloServer2
  5. Async_HttpBasicAuth
  6. Async_PostServer
  7. AsyncMultiWebServer_STM32
  8. Async_RegexPatterns_STM32
  9. Async_SimpleWebServer_STM32
  10. MQTTClient_Auth
  11. MQTTClient_Basic
  12. MQTT_ThingStream
  13. WebClient
  14. WebClientRepeating
  15. Async_AdvancedWebServer_faviconNew
  16. Async_AdvancedWebServer_MemoryIssues_SendArduinoStringNew
  17. Async_AdvancedWebServer_MemoryIssues_Send_CStringNew
  18. Async_AdvancedWebServer_SendChunkedNew
  19. AsyncWebServer_SendChunkedNew

2. For LAN8720

  1. Async_AdvancedWebServer_LAN8720
  2. AsyncFSBrowser_STM32_LAN8720
  3. Async_HelloServer_LAN8720
  4. Async_HelloServer2_LAN8720
  5. Async_HttpBasicAuth_LAN8720
  6. AsyncMultiWebServer_STM32_LAN8720
  7. Async_PostServer_LAN8720
  8. Async_RegexPatterns_STM32_LAN8720
  9. Async_SimpleWebServer_STM32_LAN8720
  10. MQTTClient_Auth_LAN8720
  11. MQTTClient_Basic_LAN8720
  12. MQTT_ThingStream_LAN8720
  13. WebClient_LAN8720
  14. WebClientRepeating_LAN8720


#if !( defined(STM32F0) || defined(STM32F1) || defined(STM32F2) || defined(STM32F3) ||defined(STM32F4) || defined(STM32F7) || \
defined(STM32L0) || defined(STM32L1) || defined(STM32L4) || defined(STM32H7) ||defined(STM32G0) || defined(STM32G4) || \
defined(STM32WB) || defined(STM32MP1) )
#error This code is designed to run on STM32F/L/H/G/WB/MP1 platform! Please check your Tools->Board setting.
#endif
#define_ASYNCWEBSERVER_STM32_LOGLEVEL_4
#if defined(STM32F0)
#warning STM32F0 board selected
#defineBOARD_TYPE"STM32F0"
#elif defined(STM32F1)
#warning STM32F1 board selected
#defineBOARD_TYPE"STM32F1"
#elif defined(STM32F2)
#warning STM32F2 board selected
#defineBOARD_TYPE"STM32F2"
#elif defined(STM32F3)
#warning STM32F3 board selected
#defineBOARD_TYPE"STM32F3"
#elif defined(STM32F4)
#warning STM32F4 board selected
#defineBOARD_TYPE"STM32F4"
#elif defined(STM32F7)
#warning STM32F7 board selected
#defineBOARD_TYPE"STM32F7"
#elif defined(STM32L0)
#warning STM32L0 board selected
#defineBOARD_TYPE"STM32L0"
#elif defined(STM32L1)
#warning STM32L1 board selected
#defineBOARD_TYPE"STM32L1"
#elif defined(STM32L4)
#warning STM32L4 board selected
#defineBOARD_TYPE"STM32L4"
#elif defined(STM32H7)
#warning STM32H7 board selected
#defineBOARD_TYPE"STM32H7"
#elif defined(STM32G0)
#warning STM32G0 board selected
#defineBOARD_TYPE"STM32G0"
#elif defined(STM32G4)
#warning STM32G4 board selected
#defineBOARD_TYPE"STM32G4"
#elif defined(STM32WB)
#warning STM32WB board selected
#defineBOARD_TYPE"STM32WB"
#elif defined(STM32MP1)
#warning STM32MP1 board selected
#defineBOARD_TYPE"STM32MP1"
#else
#warning STM32 unknown board selected
#defineBOARD_TYPE"STM32 Unknown"
#endif
#ifndef BOARD_NAME
#defineBOARD_NAME BOARD_TYPE
#endif
#defineSHIELD_TYPE"LAN8742A built-in Ethernet"
#include<LwIP.h>
#include<STM32Ethernet.h>
#include<AsyncWebServer_STM32.h>
// Enter a MAC address and IP address for your controller below.
#defineNUMBER_OF_MAC20
byte mac[][NUMBER_OF_MAC] =
{
{0xDE,0xAD,0xBE,0xEF,0x32,0x01 },
{0xDE,0xAD,0xBE,0xEF,0x32,0x02 },
{0xDE,0xAD,0xBE,0xEF,0x32,0x03 },
{0xDE,0xAD,0xBE,0xEF,0x32,0x04 },
{0xDE,0xAD,0xBE,0xEF,0x32,0x05 },
{0xDE,0xAD,0xBE,0xEF,0x32,0x06 },
{0xDE,0xAD,0xBE,0xEF,0x32,0x07 },
{0xDE,0xAD,0xBE,0xEF,0x32,0x08 },
{0xDE,0xAD,0xBE,0xEF,0x32,0x09 },
{0xDE,0xAD,0xBE,0xEF,0x32,0x0A },
{0xDE,0xAD,0xBE,0xEF,0x32,0x0B },
{0xDE,0xAD,0xBE,0xEF,0x32,0x0C },
{0xDE,0xAD,0xBE,0xEF,0x32,0x0D },
{0xDE,0xAD,0xBE,0xEF,0x32,0x0E },
{0xDE,0xAD,0xBE,0xEF,0x32,0x0F },
{0xDE,0xAD,0xBE,0xEF,0x32,0x10 },
{0xDE,0xAD,0xBE,0xEF,0x32,0x11 },
{0xDE,0xAD,0xBE,0xEF,0x32,0x12 },
{0xDE,0xAD,0xBE,0xEF,0x32,0x13 },
{0xDE,0xAD,0xBE,0xEF,0x32,0x14 },
};
// Select the IP address according to your local network
IPAddressip(192,168,2,232);
AsyncWebServerserver(80);
int reqCount =0;// number of requests received
constint led =13;
voidhandleRoot(AsyncWebServerRequest *request)
{
digitalWrite(led,1);
#defineBUFFER_SIZE400
char temp[BUFFER_SIZE];
int sec =millis() /1000;
int min = sec /60;
int hr = min /60;
int day = hr /24;
snprintf(temp, BUFFER_SIZE -1,
"<html>\
<head>\
<meta http-equiv='refresh' content='5'/>\
<title>AsyncWebServer-%s</title>\
<style>\
body { background-color: #cccccc; font-family: Arial, Helvetica, Sans-Serif; Color: #000088; }\
</style>\
</head>\
<body>\
<h2>AsyncWebServer_STM32!</h2>\
<h3>running on %s</h3>\
<p>Uptime: %d d %02d:%02d:%02d</p>\
<img src=\"/test.svg\" />\
</body>\
</html>", BOARD_NAME, BOARD_NAME, day, hr %24, min %60, sec %60);
request->send(200,"text/html", temp);
digitalWrite(led,0);
}
voidhandleNotFound(AsyncWebServerRequest *request)
{
digitalWrite(led,1);
String message ="File Not Found\n\n";
message +="URI:";
message += request->url();
message +="\nMethod:";
message += (request->method() == HTTP_GET) ?"GET" :"POST";
message +="\nArguments:";
message += request->args();
message +="\n";
for (uint8_t i =0; i < request->args(); i++)
{
message +="" + request->argName(i) +":" + request->arg(i) +"\n";
}
request->send(404,"text/plain", message);
digitalWrite(led,0);
}
voiddrawGraph(AsyncWebServerRequest *request)
{
String out;
out.reserve(3000);
char temp[70];
out +="<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" width=\"310\" height=\"150\">\n";
out +="<rect width=\"310\" height=\"150\" fill=\"rgb(250, 230, 210)\" stroke-width=\"2\" stroke=\"rgb(0, 0, 0)\" />\n";
out +="<g stroke=\"blue\">\n";
int y =rand() %130;
for (int x =10; x <300; x +=10)
{
int y2 =rand() %130;
sprintf(temp,"<line x1=\"%d\" y1=\"%d\" x2=\"%d\" y2=\"%d\" stroke-width=\"2\" />\n", x,140 - y, x +10,140 - y2);
out += temp;
y = y2;
}
out +="</g>\n</svg>\n";
request->send(200,"image/svg+xml", out);
}
voidsetup(void)
{
pinMode(led, OUTPUT);
digitalWrite(led,0);
Serial.begin(115200);
while (!Serial);
delay(200);
Serial.print("\nStart Async_AdvancedWebServer_STM32 on"); Serial.print(BOARD_NAME);
Serial.print(" with"); Serial.println(SHIELD_TYPE);
Serial.println(ASYNC_WEBSERVER_STM32_VERSION);
#if (_ASYNCWEBSERVER_STM32_LOGLEVEL_ > 2)
Serial.print("STM32 Core version v"); Serial.print(STM32_CORE_VERSION_MAJOR);
Serial.print("."); Serial.print(STM32_CORE_VERSION_MINOR);
Serial.print("."); Serial.println(STM32_CORE_VERSION_PATCH);
#endif
// start the ethernet connection and the server
// Use random mac
uint16_t index =millis() % NUMBER_OF_MAC;
// Use Static IP
//Ethernet.begin(mac[index], ip);
// Use DHCP dynamic IP and random mac
Ethernet.begin(mac[index]);
server.on("/", HTTP_GET, [](AsyncWebServerRequest * request)
{
handleRoot(request);
});
server.on("/test.svg", HTTP_GET, [](AsyncWebServerRequest * request)
{
drawGraph(request);
});
server.on("/inline", [](AsyncWebServerRequest * request)
{
request->send(200,"text/plain","This works as well");
});
server.onNotFound(handleNotFound);
server.begin();
Serial.print(F("HTTP EthernetWebServer is @ IP :"));
Serial.println(Ethernet.localIP());
}
voidloop(void)
{
}


You can access the Async Advanced WebServer @ the server IP



Debug Termimal Output Samples

1. AsyncMultiWebServer_STM32 on NUCLEO_F767ZI using Built-in LAN8742A Ethernet and STM32Ethernet Library

Following are debug terminal output and screen shots when running exampleAsyncMultiWebServer_STM32 on STM32F7 Nucleo-144 NUCLEO_F767ZI using Built-in LAN8742A Ethernet and STM32Ethernet Library to demonstrate the operation of 3 independent AsyncWebServers on 3 different ports and how to handle the complicated AsyncMultiWebServers.

Starting AsyncMultiWebServer_STM32 on NUCLEO_F767ZI with LAN8742A built-in EthernetAsyncWebServer_STM32 v1.6.0Connected to network. IP = 192.168.2.141Initialize multiServer OK, serverIndex = 0, port = 8080HTTP server started at ports 8080Initialize multiServer OK, serverIndex = 1, port = 8081HTTP server started at ports 8081Initialize multiServer OK, serverIndex = 2, port = 8082HTTP server started at ports 8082

You can access the Async Advanced WebServers @ the server IP and corresponding ports (8080, 8081 and 8082)


2. WebClient on NUCLEO_F767ZI using Built-in LAN8742A Ethernet and STM32Ethernet Library

Following is debug terminal output when running exampleWebClient on STM32F7 Nucleo-144 NUCLEO_F767ZI using Built-in LAN8742A Ethernet and STM32Ethernet Library.

Starting WebClient on NUCLEO_F767ZI with LAN8742A built-in EthernetAsyncWebServer_STM32 v1.6.0You're connected to the network, IP = 192.168.2.71Starting connection to server...Connected to serverHTTP/1.1 200 OKServer: nginx/1.4.2Date: Mon, 28 Dec 2020 22:30:39 GMTContent-Type: text/plainContent-Length: 2263Last-Modified: Wed, 02 Oct 2013 13:46:47 GMTConnection: closeVary: Accept-EncodingETag: "524c23c7-8d7"Accept-Ranges: bytes           `:;;;,`                      .:;;:.                   .;;;;;;;;;;;`                :;;;;;;;;;;:     TM       `;;;;;;;;;;;;;;;`            :;;;;;;;;;;;;;;;           :;;;;;;;;;;;;;;;;;;         `;;;;;;;;;;;;;;;;;;         ;;;;;;;;;;;;;;;;;;;;;       .;;;;;;;;;;;;;;;;;;;;       ;;;;;;;;:`   `;;;;;;;;;     ,;;;;;;;;.`   .;;;;;;;;     .;;;;;;,         :;;;;;;;   .;;;;;;;          ;;;;;;;    ;;;;;;             ;;;;;;;  ;;;;;;,            ;;;;;;.  ,;;;;;               ;;;;;;.;;;;;;`              ;;;;;;  ;;;;;.                ;;;;;;;;;;;`      ```       ;;;;;` ;;;;;                  ;;;;;;;;;,       ;;;       .;;;;;`;;;;:                  `;;;;;;;;        ;;;        ;;;;;,;;;;`    `,,,,,,,,      ;;;;;;;      .,,;;;,,,     ;;;;;:;;;;`    .;;;;;;;;       ;;;;;,      :;;;;;;;;     ;;;;;:;;;;`    .;;;;;;;;      `;;;;;;      :;;;;;;;;     ;;;;;.;;;;.                   ;;;;;;;.        ;;;        ;;;;; ;;;;;                  ;;;;;;;;;        ;;;        ;;;;; ;;;;;                 .;;;;;;;;;;       ;;;       ;;;;;, ;;;;;;               `;;;;;;;;;;;;                ;;;;;  `;;;;;,             .;;;;;; ;;;;;;;              ;;;;;;   ;;;;;;:           :;;;;;;.  ;;;;;;;            ;;;;;;     ;;;;;;;`       .;;;;;;;,    ;;;;;;;;        ;;;;;;;:      ;;;;;;;;;:,:;;;;;;;;;:      ;;;;;;;;;;:,;;;;;;;;;;       `;;;;;;;;;;;;;;;;;;;.        ;;;;;;;;;;;;;;;;;;;;          ;;;;;;;;;;;;;;;;;           :;;;;;;;;;;;;;;;;:            ,;;;;;;;;;;;;;,              ;;;;;;;;;;;;;;                .;;;;;;;;;`                  ,;;;;;;;;:                                                                                                                                                                                                                                                 ;;;   ;;;;;`  ;;;;:  .;;  ;; ,;;;;;, ;;. `;,  ;;;;       ;;;   ;;:;;;  ;;;;;; .;;  ;; ,;;;;;: ;;; `;, ;;;:;;     ,;:;   ;;  ;;  ;;  ;; .;;  ;;   ,;,   ;;;,`;, ;;  ;;     ;; ;:  ;;  ;;  ;;  ;; .;;  ;;   ,;,   ;;;;`;, ;;  ;;.    ;: ;;  ;;;;;:  ;;  ;; .;;  ;;   ,;,   ;;`;;;, ;;  ;;`   ,;;;;;  ;;`;;   ;;  ;; .;;  ;;   ,;,   ;; ;;;, ;;  ;;    ;;  ,;, ;; .;;  ;;;;;:  ;;;;;: ,;;;;;: ;;  ;;, ;;;;;;    ;;   ;; ;;  ;;` ;;;;.   `;;;:  ,;;;;;, ;;  ;;,  ;;;;   Disconnecting from server...

3. MQTTClient_Auth on NUCLEO_F767ZI using Built-in LAN8742A Ethernet and STM32Ethernet Library

Following is debug terminal output when running exampleMQTTClient_Auth on STM32F7 Nucleo-144 NUCLEO_F767ZI using Built-in LAN8742A Ethernet and STM32Ethernet Library.

Starting MQTTClient_Auth on NUCLEO_F767ZI with LAN8742A built-in EthernetAsyncWebServer_STM32 v1.6.0Connected to network. IP = 192.168.2.71Attempting MQTT connection to broker.emqx.io...connectedMessage Send : MQTT_Pub => Hello from MQTTClient_Auth on NUCLEO_F767ZI with LAN8742A built-in EthernetMessage arrived [MQTT_Pub] Hello from MQTTClient_Auth on NUCLEO_F767ZI with LAN8742A built-in EthernetMessage Send : MQTT_Pub => Hello from MQTTClient_Auth on NUCLEO_F767ZI with LAN8742A built-in EthernetMessage arrived [MQTT_Pub] Hello from MQTTClient_Auth on NUCLEO_F767ZI with LAN8742A built-in Ethernet

4. MQTTClient_Basic on NUCLEO_F767ZI using Built-in LAN8742A Ethernet and STM32Ethernet Library

Following is debug terminal output when running exampleMQTTClient_Basic on STM32F7 Nucleo-144 NUCLEO_F767ZI using Built-in LAN8742A Ethernet and STM32Ethernet Library.

Starting MQTTClient_Basic on NUCLEO_F767ZI with LAN8742A built-in EthernetAsyncWebServer_STM32 v1.6.0Connected to network. IP = 192.168.2.71Attempting MQTT connection to broker.shiftr.io...connectedMessage Send : MQTT_Pub => Hello from MQTTClient_Basic on NUCLEO_F767ZI with LAN8742A built-in EthernetMessage arrived [MQTT_Pub] Hello from MQTTClient_Basic on NUCLEO_F767ZI with LAN8742A built-in EthernetMessage Send : MQTT_Pub => Hello from MQTTClient_Basic on NUCLEO_F767ZI with LAN8742A built-in EthernetMessage arrived [MQTT_Pub] Hello from MQTTClient_Basic on NUCLEO_F767ZI with LAN8742A built-in EthernetMessage Send : MQTT_Pub => Hello from MQTTClient_Basic on NUCLEO_F767ZI with LAN8742A built-in EthernetMessage arrived [MQTT_Pub] Hello from MQTTClient_Basic on NUCLEO_F767ZI with LAN8742A built-in EthernetMessage Send : MQTT_Pub => Hello from MQTTClient_Basic on NUCLEO_F767ZI with LAN8742A built-in EthernetMessage arrived [MQTT_Pub] Hello from MQTTClient_Basic on NUCLEO_F767ZI with LAN8742A built-in EthernetMessage Send : MQTT_Pub => Hello from MQTTClient_Basic on NUCLEO_F767ZI with LAN8742A built-in EthernetMessage arrived [MQTT_Pub] Hello from MQTTClient_Basic on NUCLEO_F767ZI with LAN8742A built-in EthernetMessage Send : MQTT_Pub => Hello from MQTTClient_Basic on NUCLEO_F767ZI with LAN8742A built-in EthernetMessage arrived [MQTT_Pub] Hello from MQTTClient_Basic on NUCLEO_F767ZI with LAN8742A built-in Ethernet

5. MQTT_ThingStream on NUCLEO_F767ZI using Built-in LAN8742A Ethernet and STM32Ethernet Library

Following is debug terminal output when running exampleMQTT_ThingStream on STM32F7 Nucleo-144 NUCLEO_F767ZI using Built-in LAN8742A Ethernet and STM32Ethernet Library.

Starting MQTT_ThingStream on NUCLEO_F767ZI with LAN8742A built-in EthernetAsyncWebServer_STM32 v1.6.0Connected to network. IP = 192.168.2.71***************************************STM32_Pub***************************************Attempting MQTT connection to broker.emqx.io...connectedPublished connection message successfully!Subscribed to: STM32_SubMQTT Message Send : STM32_Pub => Hello from MQTT_ThingStream on NUCLEO_F767ZI with LAN8742A built-in EthernetMQTT Message receive [STM32_Pub] Hello from MQTT_ThingStream on NUCLEO_F767ZI with LAN8742A built-in EthernetMQTT Message Send : STM32_Pub => Hello from MQTT_ThingStream on NUCLEO_F767ZI with LAN8742A built-in EthernetMQTT Message receive [STM32_Pub] Hello from MQTT_ThingStream on NUCLEO_F767ZI with LAN8742A built-in EthernetMQTT Message Send : STM32_Pub => Hello from MQTT_ThingStream on NUCLEO_F767ZI with LAN8742A built-in EthernetMQTT Message receive [STM32_Pub] Hello from MQTT_ThingStream on NUCLEO_F767ZI with LAN8742A built-in EthernetMQTT Message Send : STM32_Pub => Hello from MQTT_ThingStream on NUCLEO_F767ZI with LAN8742A built-in EthernetMQTT Message receive [STM32_Pub] Hello from MQTT_ThingStream on NUCLEO_F767ZI with LAN8742A built-in EthernetMQTT Message Send : STM32_Pub => Hello from MQTT_ThingStream on NUCLEO_F767ZI with LAN8742A built-in EthernetMQTT Message receive [STM32_Pub] Hello from MQTT_ThingStream on NUCLEO_F767ZI with LAN8742A built-in Ethernet

6. MQTTClient_Auth_LAN8720 on BLACK_F407VE using LAN8720 Ethernet and STM32Ethernet Library

Following is debug terminal output when running exampleMQTTClient_Auth_LAN8720 on STM32F4 BLACK_F407VE with LAN8720 Ethernet and STM32Ethernet Library.

Start MQTTClient_Auth_LAN8720 on BLACK_F407VE with LAN8720 EthernetAsyncWebServer_STM32 v1.6.0Connected to network. IP = 192.168.2.150Attempting MQTT connection to broker.emqx.io...connectedMessage Send : MQTT_Pub => Hello from MQTTClient_Auth_LAN8720 on BLACK_F407VE with LAN8720 EthernetMessage arrived [MQTT_Pub] Hello from MQTTClient_Auth_LAN8720 on BLACK_F407VE with LAN8720 EthernetMessage Send : MQTT_Pub => Hello from MQTTClient_Auth_LAN8720 on BLACK_F407VE with LAN8720 EthernetMessage arrived [MQTT_Pub] Hello from MQTTClient_Auth_LAN8720 on BLACK_F407VE with LAN8720 EthernetMessage Send : MQTT_Pub => Hello from MQTTClient_Auth_LAN8720 on BLACK_F407VE with LAN8720 EthernetMessage arrived [MQTT_Pub] Hello from MQTTClient_Auth_LAN8720 on BLACK_F407VE with LAN8720 EthernetMessage Send : MQTT_Pub => Hello from MQTTClient_Auth_LAN8720 on BLACK_F407VE with LAN8720 EthernetMessage arrived [MQTT_Pub] Hello from MQTTClient_Auth_LAN8720 on BLACK_F407VE with LAN8720 EthernetMessage Send : MQTT_Pub => Hello from MQTTClient_Auth_LAN8720 on BLACK_F407VE with LAN8720 EthernetMessage arrived [MQTT_Pub] Hello from MQTTClient_Auth_LAN8720 on BLACK_F407VE with LAN8720 EthernetMessage Send : MQTT_Pub => Hello from MQTTClient_Auth_LAN8720 on BLACK_F407VE with LAN8720 EthernetMessage arrived [MQTT_Pub] Hello from MQTTClient_Auth_LAN8720 on BLACK_F407VE with LAN8720 Ethernet

7. Async_AdvancedWebServer_LAN8720 on BLACK_F407VE using LAN8720 Ethernet and STM32Ethernet Library

Following is the screen shot when running exampleAsync_AdvancedWebServer_LAN8720 on STM32F4 BLACK_F407VE with LAN8720 Ethernet and STM32Ethernet Library to demonstrate the operation of AsyncWebServer.


8. AsyncMultiWebServer_STM32_LAN8720 on BLACK_F407VE using LAN8720 Ethernet and STM32Ethernet Library

Following are debug terminal output and screen shots when running exampleAsyncMultiWebServer_STM32_LAN8720 on STM32F4 BLACK_F407VE with LAN8720 Ethernet and STM32Ethernet Library to demonstrate the operation of 3 independent AsyncWebServers on 3 different ports and how to handle the complicated AsyncMultiWebServers.

Start AsyncMultiWebServer_STM32_LAN8720 on BLACK_F407VE with LAN8720 EthernetAsyncWebServer_STM32 v1.6.0Connected to network. IP = 192.168.2.150Initialize multiServer OK, serverIndex = 0, port = 8080HTTP server started at ports 8080Initialize multiServer OK, serverIndex = 1, port = 8081HTTP server started at ports 8081Initialize multiServer OK, serverIndex = 2, port = 8082HTTP server started at ports 8082

You can access the Async Advanced WebServers @ the server IP and corresponding ports (8080, 8081 and 8082)


9. Async_AdvancedWebServer_favicon on NUCLEO_F767ZI with LAN8742A built-in Ethernet

Following is the debug terminal when running exampleAsync_AdvancedWebServer_favicon on NUCLEO_F767ZI, with LAN8742A built-in Ethernet, to demonstrate the operation of AsyncWebServer_STM32, to displayfavicon.ico, which many browsers support.

Start Async_AdvancedWebServer_favicon on NUCLEO_F767ZI with LAN8742A built-in EthernetAsyncWebServer_STM32 v1.6.0STM32 Core version v2.2.0HTTP EthernetWebServer is @ IP : 192.168.2.69

You can see thefavicon.ico at the upper left corner

On Firefox


10. Async_AdvancedWebServer_MemoryIssues_Send_CString on NUCLEO_F767ZI with LAN8742A built-in Ethernet

Following is the debug terminal and screen shot when running exampleAsync_AdvancedWebServer_MemoryIssues_Send_CString on NUCLEO_F767ZI, with LAN8742A built-in Ethernet, to demonstrate the new and powerfulHEAP-saving feature

Using CString ===> small heap (42,952 bytes) for ~31 KBytes data length
Start Async_AdvancedWebServer_MemoryIssues_Send_CString on NUCLEO_F767ZI with LAN8742A built-in EthernetAsyncWebServer_STM32 v1.6.0HEAP DATA - Start =>  Free RAM: 479908  Used heap: 260STM32 Core version v2.2.0HTTP EthernetWebServer is @ IP : 192.168.2.72HEAP DATA - Pre Create Arduino String  Free RAM: 439116  Used heap: 41052.HEAP DATA - Pre Send  Free RAM: 437380  Used heap: 42788HEAP DATA - Post Send  Free RAM: 437216  Used heap: 42952......Out String Length=31248... ....Out String Length=31194...... .Out String Length=31223.......Out String Length=31244.. .....

While using Arduino String, the HEAP usage is very large, even with smaller data. Unfortunately, we currently can't useArduino String larger than5,5 KBytes now.

Async_AdvancedWebServer_MemoryIssues_SendArduinoString ===> very large heap (48,716 bytes) for 5,592 bytes data

Start Async_AdvancedWebServer_MemoryIssues_SendArduinoString on NUCLEO_F767ZI with LAN8742A built-in EthernetAsyncWebServer_STM32 v1.6.0HEAP DATA - Start =>  Free RAM: 479908  Used heap: 260STM32 Core version v2.2.0HTTP EthernetWebServer is @ IP : 192.168.2.72HEAP DATA - Pre Create Arduino String  Free RAM: 479124  Used heap: 1044.HEAP DATA - Pre Send  Free RAM: 437172  Used heap: 42996HEAP DATA - Post Send  Free RAM: 431452  Used heap: 48716......Out String Length=5580... ....Out String Length=5583...... .Out String Length=5584......Out String Length=5585... ....Out String Length=5592...

You can access the Async Advanced WebServers at the displayed server IP, e.g.192.168.2.72


11. Async_AdvancedWebServer_SendChunked on NUCLEO_F767ZI with LAN8742A built-in Ethernet

Following is debug terminal output when running exampleAsync_AdvancedWebServer_SendChunked onNUCLEO_F767ZI with LAN8742A built-in Ethernet, to demo how to usebeginChunkedResponse() to send largehtml in chunks

Start Async_AdvancedWebServer_SendChunked on NUCLEO_F767ZI with LAN8742A built-in EthernetAsyncWebServer_STM32 v1.6.1STM32 Core version v2.3.0AsyncWebServer is @ IP : 192.168.2.124.[AWS] Total length to send in chunks = 31262[AWS] Bytes sent in chunk = 5716[AWS] Bytes sent in chunk = 5832[AWS] Bytes sent in chunk = 5832[AWS] Bytes sent in chunk = 5832[AWS] Bytes sent in chunk = 5832[AWS] Bytes sent in chunk = 2218[AWS] Bytes sent in chunk = 0[AWS] Total length to send in chunks = 31277[AWS] Bytes sent in chunk = 5716[AWS] Bytes sent in chunk = 5832[AWS] Bytes sent in chunk = 5832[AWS] Bytes sent in chunk = 5832[AWS] Bytes sent in chunk = 5832[AWS] Bytes sent in chunk = 2233[AWS] Bytes sent in chunk = 0[AWS] Total length to send in chunks = 31233[AWS] Bytes sent in chunk = 5716[AWS] Bytes sent in chunk = 5832[AWS] Bytes sent in chunk = 5832[AWS] Bytes sent in chunk = 5832[AWS] Bytes sent in chunk = 5832[AWS] Bytes sent in chunk = 2189[AWS] Bytes sent in chunk = 0

You can access the Async_AdvancedWebServer_SendChunked at the displayed server IP, e.g.192.168.2.123


12. AsyncWebServer_SendChunked on NUCLEO_F767ZI with LAN8742A built-in Ethernet

Following is debug terminal output when running exampleAsyncWebServer_SendChunked onNUCLEO_F767ZI with LAN8742A built-in Ethernet, to demo how to usebeginChunkedResponse() to send largehtml in chunks

Start AsyncWebServer_SendChunked on NUCLEO_F767ZI with LAN8742A built-in EthernetAsyncWebServer_STM32 v1.6.0STM32 Core version v2.3.0AsyncWebServer is @ IP : 192.168.2.124.[AWS] Total length to send in chunks = 41798[AWS] Bytes sent in chunk = 5720[AWS] Bytes sent in chunk = 5832[AWS] Bytes sent in chunk = 5832[AWS] Bytes sent in chunk = 5832[AWS] Bytes sent in chunk = 5832[AWS] Bytes sent in chunk = 5832[AWS] Bytes sent in chunk = 5832[AWS] Bytes sent in chunk = 1086[AWS] Bytes sent in chunk = 0.[AWS] Total length to send in chunks = 41798[AWS] Bytes sent in chunk = 5720[AWS] Bytes sent in chunk = 5832[AWS] Bytes sent in chunk = 5832[AWS] Bytes sent in chunk = 5832[AWS] Bytes sent in chunk = 5832[AWS] Bytes sent in chunk = 5832[AWS] Bytes sent in chunk = 5832[AWS] Bytes sent in chunk = 1086[AWS] Bytes sent in chunk = 0


Debug

Debug is enabled by default on Serial. Debug Level from 0 to 4. To disable, change theETHERNET_WEBSERVER_LOGLEVEL to 0

// Use this to output debug msgs to Serial#defineASYNCWEBSERVER_STM32_DEBUG_PORT       Serial// Use this to disable all output debug msgs// Debug Level from 0 to 4#define_ASYNCWEBSERVER_STM32_LOGLEVEL_0

Troubleshooting

If you get compilation errors, more often than not, you may need to install a newer version of Arduino IDE, the ArduinoSTM32 core or depending libraries.

Sometimes, the library will only work if you update theSTM32 core to the latest version because I'm always using the latest cores /libraries.


Issues

Submit issues to:AsyncWebServer_STM32 issues



TO DO

  1. Fix bug. Add enhancement
  2. Add support to more Ethernet / WiFi shield
  3. Add support to more STM32 boards.
  4. Add support to File using STM32-SD or STM32-FS

DONE

  1. Initial port to STM32 using builtin LAN8742A Etnernet. Tested onSTM32F7 Nucleo-144 F767ZI.
  2. Add more examples.
  3. Add debugging features.
  4. Add AsyncUDP_STM32 to support Async UDP on STM32
  5. Add Authentication support (MD5, SHA1).
  6. Add support toEthernet LAN8720 usingSTM32Ethernet library, for boards such asNucleo-144 (F429ZI, NUCLEO_F746NG, NUCLEO_F746ZG, NUCLEO_F756ZG), Discovery (DISCO_F746NG) andSTM32F4 boards (BLACK_F407VE, BLACK_F407VG, BLACK_F407ZE, BLACK_F407ZG, BLACK_F407VE_Mini, DIYMORE_F407VGT, FK407M1). Tested onSTM32F4 BLACK_F407VE.
  7. Add Table-of-Contents and Version String
  8. Fix issue with slow browsers or network
  9. Add functions and exampleAsync_AdvancedWebServer_favicon to supportfavicon.ico
  10. Support usingCString to save heap to sendvery large data. Checkrequest->send(200, textPlainStr, jsonChartDataCharStr); - Without using String Class - to save heap #8
  11. Add examplesAsync_AdvancedWebServer_SendChunked andAsyncWebServer_SendChunked to demo how to usebeginChunkedResponse() to send largehtml in chunks
  12. Useallman astyle and addutils


Contributions and Thanks

  1. Based on and modified fromHristo Gochkov's ESPAsyncWebServer. Many thanks toHristo Gochkov for greatESPAsyncWebServer Library
  2. Relied onFrederic Pillon's STM32duino LwIP Library.
  3. Relied onPhilBowles' STM32 AsyncTCP Library.
  4. Thanks to good work ofMiguel Wisintainer for working with, developing, debugging and testing.
  5. Thanks toJean-Claude andchris007de to help locate the dependency issue, discuss solution leading to release v1.2.6. CheckCompilation broken due to error in STM32AsyncTCP dependency andhow to run one of the examples?.
  6. Thanks totothtechnika to create the PRFix base64 encoding of websocket client key and progmem support for webserver #7 leading to new release v1.4.0
  7. Thanks tosalasidis akars77can to discuss and make the followingmarvellous PRs inPortenta_H7_AsyncWebServer library
me-no-dev
⭐️⭐️ Hristo Gochkov

fpistm
⭐️ Frederic Pillon

philbowles
⭐️ Phil Bowles

tcpipchip
tcpipchip

jcw
Jean-Claude

chris007de
chris007de

tothtechnika
tothtechnika

salasidis
⭐️ salasidis


Contributing

If you want to contribute to this project:

  • Report bugs and errors
  • Ask for enhancements
  • Create issues and pull requests
  • Tell other people about this library

License

  • The library is licensed underGPLv3

Copyright

Copyright 2020- Khoi Hoang

About

AsyncWebServer for STM32 using builtin LAN8742A Ethernet. This AsyncWebServer Library for STM32 is currently working on STM32 boards, such as Nucleo-144 F767ZI, etc., using builtin LAN8742A Ethernet. Now support using CString to save heap to send very large data

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp