AsyncHTTPRequest_Generic
Why do we need this Async AsyncHTTPRequest_Generic library
Features
- Asynchronous HTTP Request library for ESP8266, ESP32 using built-in WiFi, and STM32 boards using built-in LAN8742A Ethernet.
- Providing a subset of HTTP.
- Relying on on
ESPAsyncTCP
for ESP8266,AsyncTCP
for ESP32 using built-in WiFi - Relying on
STM32duino LwIP
/STM32duino STM32Ethernet
/STM32AsyncTCP
for STM32 using built-in LAN8742A Ethernet. - Methods similar in format and usage to XmlHTTPrequest in Javascript.
Supports:
- GET and POST
- 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 ESPAsyncTCP/AsyncTCP/STM32 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.
The underlying buffering uses a new xbuf class. It handles both character and binary data. Class xbuf uses a chain of small (64 byte) segments that are allocated and added to the tail as data is added and deallocated from the head as data is read, achieving the same result as a dynamic circular buffer limited only by the size of heap. The xbuf implements indexOf and readUntil functions.
For short transactions, buffer space should not be an issue. In fact, it can be more economical than other methods that use larger fixed length buffers. Data is acked when retrieved by the caller, so there is some limited flow control to limit heap usage for larger transfers.
Request and response headers are handled in the typical fashion.
Chunked responses are recognized and handled transparently.
Releases v1.0.0
- Initial coding to add support to STM32F/L/H/G/WB/MP1 using built-in LAN8742A Ethernet (Nucleo-144, DISCOVERY, etc).
- Add examples using STM32 boards.
Currently Supported Boards
1. ESP32 and ESP8266
2. STM32F/L/H/G/WB/MP1 with built-in LAN8742A Ethernet.
- Nucleo-144 (F429ZI, F746ZG, F756ZG, F767ZI)
- Discovery STM32F746G-DISCOVERY
- Any STM32 boards with enough flash/memory and already configured to run LAN8742A Ethernet.
AsyncHTTPRequest_Generic for ESP32, ESP8266 using built-in WiFi and STM32 boards using built-in LAN8742A Ethernet
This library is based on, modified from:
Prerequisite
Arduino IDE 1.8.13+
for ArduinoESP8266 Core 2.7.4+
for ESP8266-based boards.ESP32 Core 1.0.4+
for ESP32-based boardsArduino Core for STM32 1.9.0+
for for STM32 using built-in Ethernet LAN8742A.ESPAsyncTCP v1.2.2+
for ESP8266.AsyncTCP v1.1.1+
for ESP32.STM32Ethernet library v1.2.0+
for STM32 using built-in Ethernet LAN8742A on (Nucleo-144, Discovery).LwIP library v2.1.2+
for STM32 using built-in Ethernet LAN8742A on (Nucleo-144, Discovery).STM32AsyncTCP library
for STM32 using built-in Ethernet LAN8742A on (Nucleo-144, Discovery).
Installation
Use Arduino Library Manager
The best and easiest way is to use Arduino Library Manager
. Search for AsyncHTTPRequest_Generic
, then select / install the latest version. You can also use this link for more detailed instructions.
Manual Install
- Navigate to AsyncHTTPRequest_Generic page.
- Download the latest release
AsyncHTTPRequest_Generic-master.zip
. - Extract the zip file to
AsyncHTTPRequest_Generic-master
directory - Copy the whole
AsyncHTTPRequest_Generic-master
folder to Arduino libraries' directory such as~/Arduino/libraries/
.
VS Code & PlatformIO:
- Install VS Code
- Install PlatformIO
- Install AsyncHTTPRequest_Generic library by using Library Manager. Search for AsyncHTTPRequest_Generic in Platform.io Author's Libraries
- Use included platformio.ini file from examples to ensure that all dependent libraries will installed automatically. Please visit documentation for the other options and examples at Project Configuration File
Packages' Patches
- To be able to compile, run and automatically detect and display BOARD_NAME on nRF52840/nRF52832 boards, you have to copy the whole nRF52 0.21.0 directory into Adafruit nRF52 directory (~/.arduino15/packages/adafruit/hardware/nrf52/0.21.0).
Supposing the Adafruit nRF52 version is 0.21.0. These files must be copied into the directory:
~/.arduino15/packages/adafruit/hardware/nrf52/0.21.0/platform.txt
~/.arduino15/packages/adafruit/hardware/nrf52/0.21.0/boards.txt
~/.arduino15/packages/adafruit/hardware/nrf52/0.21.0/variants/NINA_B302_ublox/variant.h
~/.arduino15/packages/adafruit/hardware/nrf52/0.21.0/variants/NINA_B302_ublox/variant.cpp
~/.arduino15/packages/adafruit/hardware/nrf52/0.21.0/variants/NINA_B112_ublox/variant.h
~/.arduino15/packages/adafruit/hardware/nrf52/0.21.0/variants/NINA_B112_ublox/variant.cpp
~/.arduino15/packages/adafruit/hardware/nrf52/0.21.0/cores/nRF5/Udp.h
Whenever a new version is installed, remember to copy these files into the new version directory. For example, new version is x.yy.z These files must be copied into the directory:
~/.arduino15/packages/adafruit/hardware/nrf52/x.yy.z/platform.txt
~/.arduino15/packages/adafruit/hardware/nrf52/x.yy.z/boards.txt
~/.arduino15/packages/adafruit/hardware/nrf52/x.yy.z/variants/NINA_B302_ublox/variant.h
~/.arduino15/packages/adafruit/hardware/nrf52/x.yy.z/variants/NINA_B302_ublox/variant.cpp
~/.arduino15/packages/adafruit/hardware/nrf52/x.yy.z/variants/NINA_B112_ublox/variant.h
~/.arduino15/packages/adafruit/hardware/nrf52/x.yy.z/variants/NINA_B112_ublox/variant.cpp
~/.arduino15/packages/adafruit/hardware/nrf52/x.yy.z/cores/nRF5/Udp.h
- To be able to compile and run on Teensy boards, you have to copy the file Teensy boards.txt into Teensy hardware directory (./arduino-1.8.12/hardware/teensy/avr/boards.txt).
Supposing the Arduino version is 1.8.12. This file must be copied into the directory:
./arduino-1.8.12/hardware/teensy/avr/boards.txt
Whenever a new version is installed, remember to copy this file into the new version directory. For example, new version is x.yy.zz This file must be copied into the directory:
./arduino-x.yy.zz/hardware/teensy/avr/boards.txt
- To be able to compile and run on SAM DUE boards, you have to copy the whole SAM DUE directory into Arduino sam directory (~/.arduino15/packages/arduino/hardware/sam/1.6.12).
Supposing the Arduino SAM core version is 1.6.12. This file must be copied into the directory:
~/.arduino15/packages/arduino/hardware/sam/1.6.12/platform.txt
Whenever a new version is installed, remember to copy this file into the new version directory. For example, new version is x.yy.zz This file must be copied into the directory:
~/.arduino15/packages/arduino/hardware/sam/x.yy.zz/platform.txt
- To be able to compile without error and automatically detect and display BOARD_NAME on Arduino SAMD (Nano-33-IoT, etc) boards, you have to copy the whole Arduino SAMD cores 1.8.8 directory into Arduino SAMD directory (~/.arduino15/packages/arduino/hardware/samd/1.8.8).
Supposing the Arduino SAMD version is 1.8.8. These files must be copied into the directory:
~/.arduino15/packages/arduino/hardware/samd/1.8.8/platform.txt
~/.arduino15/packages/arduino/hardware/samd/1.8.8/cores/arduino/Arduino.h
Whenever a new version is installed, remember to copy these files into the new version directory. For example, new version is x.yy.z
These files must be copied into the directory:
~/.arduino15/packages/arduino/hardware/samd/x.yy.z/platform.txt
~/.arduino15/packages/arduino/hardware/samd/x.yy.z/cores/arduino/Arduino.h
This is mandatory to fix the notorious Arduino SAMD compiler error. See Improve Arduino compatibility with the STL (min and max macro)
...\arm-none-eabi\include\c++\7.2.1\bits\stl_algobase.h:243:56: error: macro "min" passed 3 arguments, but takes just 2
min(const _Tp& __a, const _Tp& __b, _Compare __comp)
Whenever the above-mentioned compiler error issue is fixed with the new Arduino SAMD release, you don't need to copy the Arduino.h
file anymore.
- To be able to automatically detect and display BOARD_NAME on Adafruit SAMD (Itsy-Bitsy M4, etc) boards, you have to copy the file Adafruit SAMD platform.txt into Adafruit samd directory (~/.arduino15/packages/adafruit/hardware/samd/1.6.3).
Supposing the Adafruit SAMD core version is 1.6.3. This file must be copied into the directory:
~/.arduino15/packages/adafruit/hardware/samd/1.6.3/platform.txt
Whenever a new version is installed, remember to copy this file into the new version directory. For example, new version is x.yy.zz This file must be copied into the directory:
~/.arduino15/packages/adafruit/hardware/samd/x.yy.zz/platform.txt
- To be able to automatically detect and display BOARD_NAME on Seeeduino SAMD (XIAO M0, Wio Terminal, etc) boards, you have to copy the file Seeeduino SAMD platform.txt into Adafruit samd directory (~/.arduino15/packages/Seeeduino/hardware/samd/1.7.9).
Supposing the Seeeduino SAMD core version is 1.7.9. This file must be copied into the directory:
~/.arduino15/packages/Seeeduino/hardware/samd/1.7.9/platform.txt
Whenever a new version is installed, remember to copy this file into the new version directory. For example, new version is x.yy.zz This file must be copied into the directory:
~/.arduino15/packages/Seeeduino/hardware/samd/x.yy.zz/platform.txt
- 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 files STM32 variant.h into STM32 stm32 directory (~/.arduino15/packages/STM32/hardware/stm32/1.9.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 1.9.0. These files must be copied into the directory:
~/.arduino15/packages/STM32/hardware/stm32/1.9.0/variants/NUCLEO_F767ZI/variant.h
for Nucleo-144 NUCLEO_F767ZI.~/.arduino15/packages/STM32/hardware/stm32/1.9.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, theses 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
Examples
Also see examples:
- AsyncHTTPRequest_ESP
- AsyncHTTPRequest_ESP_WiFiManager
- AsyncHTTPRequest_STM32
- AsyncCustomHeader_STM32
- AsyncDweetGet_STM32
- AsyncDweetPost_STM32
- AsyncSimpleGET_STM32
- AsyncWebClientRepeating_STM32
Example AsyncHTTPRequest_STM32
Please take a look at other examples, as well.
1. File AsyncHTTPRequest_STM32.ino
#include "defines.h"
// 600s = 10 minutes to not flooding
#define HTTP_REQUEST_INTERVAL_MS 600000
#include <AsyncHTTPRequest_Generic.h> // https://github.com/khoih-prog/AsyncHTTPRequest_Generic
#include <Ticker.h> // https://github.com/sstaub/Ticker
AsyncHTTPRequest request;
void sendRequest(void);
// Repeat forever, millis() resolution
Ticker sendHTTPRequest(sendRequest, HTTP_REQUEST_INTERVAL_MS, 0, MILLIS);
void sendRequest(void)
{
if (request.readyState() == readyStateUnsent || request.readyState() == readyStateDone)
{
//request.open("GET", "http://worldtimeapi.org/api/timezone/Europe/London.txt");
request.open("GET", "http://worldtimeapi.org/api/timezone/America/Toronto.txt");
request.send();
}
}
void requestCB(void* optParm, AsyncHTTPRequest* request, int readyState)
{
if (readyState == readyStateDone)
{
Serial.println("\n**************************************");
Serial.println(request->responseText());
Serial.println("**************************************");
request->setDebug(false);
}
}
void setup(void)
{
Serial.begin(115200);
while (!Serial);
Serial.println("\nStart AsyncHTTPRequest_STM32 on " + String(BOARD_NAME));
// 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]);
Serial.print(F("AsyncHTTPRequest @ IP : "));
Serial.println(Ethernet.localIP());
Serial.println();
request.setDebug(false);
request.onReadyStateChange(requestCB);
sendHTTPRequest.start(); //start the ticker.
// Send first request now
//delay(60);
sendRequest();
}
void loop(void)
{
sendHTTPRequest.update();
}
2. File defines.h
/*
Currently support
1) STM32 boards with built-in Ethernet (to use USE_BUILTIN_ETHERNET = true) such as :
- Nucleo-144 (F429ZI, F767ZI)
- Discovery (STM32F746G-DISCOVERY)
- STM32 boards (STM32F/L/H/G/WB/MP1) with 32K+ Flash, with Built-in Ethernet,
- See How To Use Built-in Ethernet at (https://github.com/khoih-prog/EthernetWebServer_STM32/issues/1)
2) STM32F/L/H/G/WB/MP1 boards (with 32+K Flash) running ENC28J60 shields (to use USE_BUILTIN_ETHERNET = false)
3) STM32F/L/H/G/WB/MP1 boards (with 32+K Flash) running W5x00 shields
*/
#ifndef defines_h
#define defines_h
#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 ASYNC_HTTP_DEBUG_PORT Serial
// Use from 0 to 4. Higher number, more debugging messages and memory usage.
#define _ASYNC_HTTP_LOGLEVEL_ 1
#if defined(STM32F0)
#warning STM32F0 board selected
#define BOARD_TYPE "STM32F0"
#elif defined(STM32F1)
#warning STM32F1 board selected
#define BOARD_TYPE "STM32F1"
#elif defined(STM32F2)
#warning STM32F2 board selected
#define BOARD_TYPE "STM32F2"
#elif defined(STM32F3)
#warning STM32F3 board selected
#define BOARD_TYPE "STM32F3"
#elif defined(STM32F4)
#warning STM32F4 board selected
#define BOARD_TYPE "STM32F4"
#elif defined(STM32F7)
#warning STM32F7 board selected
#define BOARD_TYPE "STM32F7"
#elif defined(STM32L0)
#warning STM32L0 board selected
#define BOARD_TYPE "STM32L0"
#elif defined(STM32L1)
#warning STM32L1 board selected
#define BOARD_TYPE "STM32L1"
#elif defined(STM32L4)
#warning STM32L4 board selected
#define BOARD_TYPE "STM32L4"
#elif defined(STM32H7)
#warning STM32H7 board selected
#define BOARD_TYPE "STM32H7"
#elif defined(STM32G0)
#warning STM32G0 board selected
#define BOARD_TYPE "STM32G0"
#elif defined(STM32G4)
#warning STM32G4 board selected
#define BOARD_TYPE "STM32G4"
#elif defined(STM32WB)
#warning STM32WB board selected
#define BOARD_TYPE "STM32WB"
#elif defined(STM32MP1)
#warning STM32MP1 board selected
#define BOARD_TYPE "STM32MP1"
#else
#warning STM32 unknown board selected
#define BOARD_TYPE "STM32 Unknown"
#endif
#ifndef BOARD_NAME
#define BOARD_NAME BOARD_TYPE
#endif
#include <LwIP.h>
#include <STM32Ethernet.h>
//#include <AsyncUDP_STM32.h>
// Enter a MAC address and IP address for your controller below.
#define NUMBER_OF_MAC 20
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 static IP address according to your local network
IPAddress ip(192, 168, 2, 232);
#endif //defines_h
Debug Terminal Oouput Samples
1. AsyncHTTPRequest_STM32 running on STM32F7 Nucleo-144 NUCLEO_F767ZI using built-in LAN8742A
Start AsyncHTTPRequest_STM32 on NUCLEO_F767ZI
AsyncHTTPRequest @ IP : 192.168.2.72
**************************************
abbreviation: EDT
client_ip: 216.154.52.212
datetime: 2020-09-13T18:22:59.555816-04:00
day_of_week: 0
day_of_year: 257
dst: true
dst_from: 2020-03-08T07:00:00+00:00
dst_offset: 3600
dst_until: 2020-11-01T06:00:00+00:00
raw_offset: -18000
timezone: America/Toronto
unixtime: 1600035779
utc_datetime: 2020-09-13T22:22:59.555816+00:00
utc_offset: -04:00
week_number: 37
**************************************
abbreviation: EDT
client_ip: 216.154.52.212
datetime: 2020-09-13T18:27:57.586325-04:00
day_of_week: 0
day_of_year: 257
dst: true
dst_from: 2020-03-08T07:00:00+00:00
dst_offset: 3600
dst_until: 2020-11-01T06:00:00+00:00
raw_offset: -18000
timezone: America/Toronto
unixtime: 1600036077
utc_datetime: 2020-09-13T22:27:57.586325+00:00
utc_offset: -04:00
week_number: 37
**************************************
2. AsyncHTTPRequest_ESP_WiFiManager running on ESP8266_NODEMCU
Starting AsyncHTTPRequest_ESP_WiFiManager using LittleFS on ESP8266_NODEMCU
Stored: SSID = HueNet1, Pass = 12345678
Got stored Credentials. Timeout 120s
ConnectMultiWiFi in setup
After waiting 3.43 secs more in setup(), connection result is connected. Local IP: 192.168.2.186
H
**************************************
abbreviation: EDT
client_ip: 216.154.52.212
datetime: 2020-09-13T19:35:37.951609-04:00
day_of_week: 0
day_of_year: 257
dst: true
dst_from: 2020-03-08T07:00:00+00:00
dst_offset: 3600
dst_until: 2020-11-01T06:00:00+00:00
raw_offset: -18000
timezone: America/Toronto
unixtime: 1600040137
utc_datetime: 2020-09-13T23:35:37.951609+00:00
utc_offset: -04:00
week_number: 37
**************************************
HHHHHH
3. AsyncHTTPRequest_ESP_WiFiManager running on ESP32_DEV
Starting AsyncHTTPRequest_ESP_WiFiManager using SPIFFS on ESP32_DEV
Stored: SSID = HueNet1, Pass = 12345678
Got stored Credentials. Timeout 120s
ConnectMultiWiFi in setup
After waiting 2.35 secs more in setup(), connection result is connected. Local IP: 192.168.2.232
H
**************************************
abbreviation: EDT
client_ip: 216.154.52.212
datetime: 2020-09-13T19:37:02.118166-04:00
day_of_week: 0
day_of_year: 257
dst: true
dst_from: 2020-03-08T07:00:00+00:00
dst_offset: 3600
dst_until: 2020-11-01T06:00:00+00:00
raw_offset: -18000
timezone: America/Toronto
unixtime: 1600040222
utc_datetime: 2020-09-13T23:37:02.118166+00:00
utc_offset: -04:00
week_number: 37
**************************************
HHHHHHHHH HHHHHHHHHH HHHHHHHHHH H
**************************************
abbreviation: EDT
client_ip: 216.154.52.212
datetime: 2020-09-13T19:42:01.507586-04:00
day_of_week: 0
day_of_year: 257
dst: true
dst_from: 2020-03-08T07:00:00+00:00
dst_offset: 3600
dst_until: 2020-11-01T06:00:00+00:00
raw_offset: -18000
timezone: America/Toronto
unixtime: 1600040521
utc_datetime: 2020-09-13T23:42:01.507586+00:00
utc_offset: -04:00
week_number: 37
**************************************
HHHHHHHHH HHHHHHHHHH HHHHHHHHHH
4. AsyncHTTPRequest_ESP running on ESP8266_NODEMCU
Starting AsyncHTTPRequest_ESP using ESP8266_NODEMCU
Connecting to WiFi SSID: HueNet1
...........
HTTP WebServer is @ IP : 192.168.2.81
**************************************
abbreviation: EDT
client_ip: 216.154.52.212
datetime: 2020-09-13T19:56:28.295033-04:00
day_of_week: 0
day_of_year: 257
dst: true
dst_from: 2020-03-08T07:00:00+00:00
dst_offset: 3600
dst_until: 2020-11-01T06:00:00+00:00
raw_offset: -18000
timezone: America/Toronto
unixtime: 1600041388
utc_datetime: 2020-09-13T23:56:28.295033+00:00
utc_offset: -04:00
week_number: 37
**************************************
HHHHHHHHH HHHHHHHHHH HHHHHHHHHH H
5. AsyncWebClientRepeating_STM32 running on STM32F7 Nucleo-144 NUCLEO_F767ZI using built-in LAN8742A
Start AsyncWebClientRepeating_STM32 on NUCLEO_F767ZI
AsyncHTTPRequest @ IP : 192.168.2.72
**************************************
`:;;;,` .:;;:.
.;;;;;;;;;;;` :;;;;;;;;;;: TM
`;;;;;;;;;;;;;;;` :;;;;;;;;;;;;;;;
:;;;;;;;;;;;;;;;;;; `;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;; .;;;;;;;;;;;;;;;;;;;;
;;;;;;;;:` `;;;;;;;;; ,;;;;;;;;.` .;;;;;;;;
.;;;;;;, :;;;;;;; .;;;;;;; ;;;;;;;
;;;;;; ;;;;;;; ;;;;;;, ;;;;;;.
,;;;;; ;;;;;;.;;;;;;` ;;;;;;
;;;;;. ;;;;;;;;;;;` ``` ;;;;;`
;;;;; ;;;;;;;;;, ;;; .;;;;;
`;;;;: `;;;;;;;; ;;; ;;;;;
,;;;;` `,,,,,,,, ;;;;;;; .,,;;;,,, ;;;;;
:;;;;` .;;;;;;;; ;;;;;, :;;;;;;;; ;;;;;
:;;;;` .;;;;;;;; `;;;;;; :;;;;;;;; ;;;;;
.;;;;. ;;;;;;;. ;;; ;;;;;
;;;;; ;;;;;;;;; ;;; ;;;;;
;;;;; .;;;;;;;;;; ;;; ;;;;;,
;;;;;; `;;;;;;;;;;;; ;;;;;
`;;;;;, .;;;;;; ;;;;;;; ;;;;;;
;;;;;;: :;;;;;;. ;;;;;;; ;;;;;;
;;;;;;;` .;;;;;;;, ;;;;;;;; ;;;;;;;:
;;;;;;;;;:,:;;;;;;;;;: ;;;;;;;;;;:,;;;;;;;;;;
`;;;;;;;;;;;;;;;;;;;. ;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;; :;;;;;;;;;;;;;;;;:
,;;;;;;;;;;;;;, ;;;;;;;;;;;;;;
.;;;;;;;;;` ,;;;;;;;;:
;;; ;;;;;` ;;;;: .;; ;; ,;;;;;, ;;. `;, ;;;;
;;; ;;:;;; ;;;;;; .;; ;; ,;;;;;: ;;; `;, ;;;:;;
,;:; ;; ;; ;; ;; .;; ;; ,;, ;;;,`;, ;; ;;
;; ;: ;; ;; ;; ;; .;; ;; ,;, ;;;;`;, ;; ;;.
;: ;; ;;;;;: ;; ;; .;; ;; ,;, ;;`;;;, ;; ;;`
,;;;;; ;;`;; ;; ;; .;; ;; ,;, ;; ;;;, ;; ;;
;; ,;, ;; .;; ;;;;;: ;;;;;: ,;;;;;: ;; ;;, ;;;;;;
;; ;; ;; ;;` ;;;;. `;;;: ,;;;;;, ;; ;;, ;;;;
Debug
Debug is enabled by default on Serial.
You can also change the debugging level from 0 to 4
#define ASYNC_HTTP_DEBUG_PORT Serial
// Use from 0 to 4. Higher number, more debugging messages and memory usage.
#define _ASYNC_HTTP_LOGLEVEL_ 1
Troubleshooting
If you get compilation errors, more often than not, you may need to install a newer version of the ESP32 / ESP8266 / STM32
core for Arduino.
Sometimes, the library will only work if you update the ESP32 / ESP8266 / STM32
core to the latest version because I am using newly added functions.
Issues
Submit issues to: AsyncHTTPRequest_Generic issues
TO DO
- Fix bug. Add enhancement
- Add support to more Ethernet / WiFi shields
- Add support to more boards.
- Add many more examples.
DONE
- Initially add support to STM32 using built-in LAN8742A Etnernet. Tested on STM32F7 Nucleo-144 F767ZI.
- Add more examples.
- Add debugging features.
Releases v1.0.0
- Initial coding to add support to STM32F/L/H/G/WB/MP1 using built-in LAN8742A Ethernet (Nucleo-144, DISCOVERY, etc).
- Add examples using STM32 boards.
Contributions and Thanks
This library is based on, modified, bug-fixed and improved from:
to use the better asynchronous features of these following Async TCP Libraries : ( ESPAsyncTCP
, AsyncTCP
, and STM32AsyncTCP
).
![]() ⭐️ Bob Lemaire |
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 and credits
- The library is licensed under MIT
Copyright
Copyright (C) <2018> <Bob Lemaire, IoTaWatt, Inc.>
Copyright 2020- Khoi Hoang