- Important Change from v2.0.0
- Important Change from v1.3.0
- Why do we need the new Async AsyncHTTPSRequest_Generic library
- Changelog
- Prerequisites
- Installation
- Note for Platform IO using ESP32 LittleFS
- HOWTO Fix
Multiple DefinitionsLinker Error - Note for Platform IO using ESP32 LittleFS
- HOWTO Use analogRead() with ESP32 running WiFi and/or BlueTooth (BT/BLE)
- Examples
- Example AsyncHTTP_HTTPSRequest_ESP
- Debug Terminal Output Samples
- 1. AsyncHTTPSRequest_ESP on ESP32_DEV
- 2. AsyncHTTPSRequest_ESP on ESP32S2_DEV
- 3. AsyncHTTPSRequest_ESP on ESP32C3_DEV
- 4. AsyncHTTPSRequest_ESP_WiFiManager on ESP32_DEV
- 5. AsyncHTTPSRequest_WT32_ETH01 on WT32_ETH01 using ESP32 core v2.0.0
- 6. AsyncHTTPSRequest_WT32_ETH01 on WT32_ETH01 using ESP32 core v1.0.6
- 7. AsyncHTTPSRequest_ESP_WiFiManager using LittleFS on ESP32C3_DEV
- 8. AsyncHTTPSRequest_ESP_WiFiManager using LittleFS on ESP32S3_DEV
- 9. AsyncHTTPSRequest_ESP_Multi on ESP32_DEV New
- 10. AsyncHTTP_HTTPSRequest_ESP on ESP32_DEV New
- Debug
- Troubleshooting
- Issues
- TO DO
- DONE
- Contributions and Thanks
- Contributing
- License and credits
- Copyright
Breaking change to permit coexisting with AsyncHTTPRequest library. Now you can send HTTP / HTTPS requests to multiple addresses and receive responses from them.
Please have a look at HOWTO Fix Multiple Definitions Linker Error
Why do we need this Async AsyncHTTPSRequest_Generic library
ESP32 Core v2.0.0+ introduces new enum breaking almost all WT32_ETH01 codes written for core v1.0.6-.
It's really strange to define a breaking enum arduino_event_id_t in WiFiGeneric.h#L36-L78, compared to the old system_event_id_t, now placed in esp_event_legacy.h#L29-L63
It's better to preserve the old enum order and just adding new items to do no harm to pre-2.0.0 codes
- WebServer_WT32_ETH01 Releases v1.2.0-** to be used for EP32 core v1.0.6- only
- WebServer_WT32_ETH01 Releases v1.3.0+** can be used for either EP32 core v2.0.0+ or v1.0.6-. Default is using core v2.0.0+
To use with core v1.0.6-, just define in your sketch
#define USING_CORE_ESP32_CORE_V200_PLUS false
- WebServer_WT32_ETH01 Releases v1.4.0+** can be used for either ESP32 core v2.0.0+ or v1.0.6-. Autodetect core
- Asynchronous HTTPS Request library for ESP32, ESP32_S2, ESP32_C3, ESP32_S3 using built-in WiFi or WT32_ETH01 using either WiFi of built-in LAN8720 Ethernet
- Providing a subset of HTTPS.
- Relying on
AsyncTCP_SSLlibrary for ESP32 - Methods similar in format and usage to
XmlHTTPrequestin Javascript. - Coexist with
AsyncHTTPRequestlibrary to permit sendingHTTP / HTTPSrequests to multiple addresses and receive responses from them
- 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.
This library adds a simple HTTPS layer on top of the AsyncTCP_SSL 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.
This library is based on, modified from:
- ESP32-S2 (ESP32-S2 Saola, AI-Thinker ESP-12K, etc.) using EEPROM, SPIFFS or LittleFS.
- ESP32-C3 (ARDUINO_ESP32C3_DEV) using EEPROM, SPIFFS or LittleFS.
- ESP32-S3 (ESP32S3_DEV, ESP32_S3_BOX, UM TINYS3, UM PROS3, UM FEATHERS3, etc.) using EEPROM, SPIFFS or LittleFS.
- ESP8266
- RP2040W using arduino-pico core
- STM32 using built-in LAN8742A
- Portenta_H7 using either Ethernet or built-in WiFi
Arduino IDE 1.8.19+for Arduino.ESP32 Core 2.0.5+for ESP32-based boards. [Latest stable releaseAsyncTCP_SSL v1.3.1+for ESP32.WebServer_WT32_ETH01 v1.5.1+for ESP32-based WT32_ETH01 using either ESP32 core v2.0.0+ or v1.0.6-.ESPAsync_WiFiManager library v1.14.1+for ESP32/ESP8266 using some examples.AsyncHTTPRequest_Generic library v1.9.1+for ESP32/ESP8266 using with AsyncHTTP_HTTPSRequest_ESP example.
The best and easiest way is to use Arduino Library Manager. Search for AsyncHTTPSRequest_Generic, then select / install the latest version. You can also use this link for more detailed instructions.
- Navigate to AsyncHTTPSRequest_Generic page.
- Download the latest release
AsyncHTTPSRequest_Generic-main.zip. - Extract the zip file to
AsyncHTTPSRequest_Generic-maindirectory - Copy the whole
AsyncHTTPSRequest_Generic-mainfolder to Arduino libraries' directory such as~/Arduino/libraries/.
- Install VS Code
- Install PlatformIO
- Install AsyncHTTPSRequest_Generic library by using Library Manager. Search for AsyncHTTPSRequest_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
In Platform IO, to fix the error when using LittleFS_esp32 v1.0 for ESP32-based boards with ESP32 core v1.0.4- (ESP-IDF v3.2-), uncomment the following line
from
//#define CONFIG_LITTLEFS_FOR_IDF_3_2 /* For old IDF - like in release 1.0.4 */
to
#define CONFIG_LITTLEFS_FOR_IDF_3_2 /* For old IDF - like in release 1.0.4 */
It's advisable to use the latest LittleFS_esp32 v1.0.5+ to avoid the issue.
Thanks to Roshan to report the issue in Error esp_littlefs.c 'utime_p'
The current library implementation, using xyz-Impl.h instead of standard xyz.cpp, possibly creates certain Multiple Definitions Linker error in certain use cases.
You can include this .hpp file
// Can be included as many times as necessary, without `Multiple Definitions` Linker Error
#include "AsyncHTTPSRequest_Generic.hpp" //https://github.com/khoih-prog/AsyncHTTPSRequest_Generic
in many files. But be sure to use the following .h file in just 1 .h, .cpp or .ino file, which must not be included in any other file, to avoid Multiple Definitions Linker Error
// To be included only in main(), .ino with setup() to avoid `Multiple Definitions` Linker Error
#include "AsyncHTTPSRequest_Generic.h" //https://github.com/khoih-prog/AsyncHTTPSRequest_Generic
Check the new multiFileProject example for a HOWTO demo.
Have a look at the discussion in Different behaviour using the src_cpp or src_h lib #80
In Platform IO, to fix the error when using LittleFS_esp32 v1.0 for ESP32-based boards with ESP32 core v1.0.4- (ESP-IDF v3.2-), uncomment the following line
from
//#define CONFIG_LITTLEFS_FOR_IDF_3_2 /* For old IDF - like in release 1.0.4 */
to
#define CONFIG_LITTLEFS_FOR_IDF_3_2 /* For old IDF - like in release 1.0.4 */
It's advisable to use the latest LittleFS_esp32 v1.0.5+ to avoid the issue.
Thanks to Roshan to report the issue in Error esp_littlefs.c 'utime_p'
Please have a look at ESP_WiFiManager Issue 39: Not able to read analog port when using the autoconnect example to have more detailed description and solution of the issue.
- ADC1 controls ADC function for pins GPIO32-GPIO39
- ADC2 controls ADC function for pins GPIO0, 2, 4, 12-15, 25-27
Look in file adc_common.c
In ADC2, there're two locks used for different cases:
lock shared with app and Wi-Fi: ESP32: When Wi-Fi using the ADC2, we assume it will never stop, so app checks the lock and returns immediately if failed. ESP32S2: The controller's control over the ADC is determined by the arbiter. There is no need to control by lock.
lock shared between tasks: when several tasks sharing the ADC2, we want to guarantee all the requests will be handled. Since conversions are short (about 31us), app returns the lock very soon, we use a spinlock to stand there waiting to do conversions one by one.
adc2_spinlock should be acquired first, then adc2_wifi_lock or rtc_spinlock.
- In order to use ADC2 for other functions, we have to acquire complicated firmware locks and very difficult to do
- So, it's not advisable to use ADC2 with WiFi/BlueTooth (BT/BLE).
- Use ADC1, and pins GPIO32-GPIO39
- If somehow it's a must to use those pins serviced by ADC2 (GPIO0, 2, 4, 12, 13, 14, 15, 25, 26 and 27), use the fix mentioned at the end of ESP_WiFiManager Issue 39: Not able to read analog port when using the autoconnect example to work with ESP32 WiFi/BlueTooth (BT/BLE).
- AsyncHTTPSRequest_ESP
- AsyncHTTPSRequest_ESP_WiFiManager
- AsyncHTTPSRequest_ESP_Multi New
- AsyncHTTP_HTTPSRequest_ESP New
Example AsyncHTTP_HTTPSRequest_ESP
Following is the debug terminal when running example AsyncHTTPSRequest_ESP on ESP32_DEV to demonstrate the operation of SSL Async HTTPS request, using AsyncTCP_SSL Library.
AsyncTCP_SSL v1.3.1
AsyncHTTPSRequest_Generic v2.1.1
Connecting to WiFi SSID: HueNet1
...
AsyncHTTPSRequest @ IP : 192.168.2.187
[AHTTPS] _onError handler SSL error = OK
**************************************
[AHTTPS] Response Code = HTTP OK
**************************************
abbreviation: EDT
client_ip: aaa.bbb.ccc.ddd
datetime: 2022-09-18T01:35:32.451975-04:00
day_of_week: 0
day_of_year: 261
dst: true
dst_from: 2022-03-13T07:00:00+00:00
dst_offset: 3600
dst_until: 2022-11-06T06:00:00+00:00
raw_offset: -18000
timezone: America/Toronto
unixtime: 1663479332
utc_datetime: 2022-09-18T05:35:32.451975+00:00
utc_offset: -04:00
week_number: 37
**************************************
HHHHHH
**************************************
[AHTTPS] Response Code = HTTP OK
**************************************
abbreviation: EDT
client_ip: aaa.bbb.ccc.ddd
datetime: 2022-09-18T01:36:31.992595-04:00
day_of_week: 0
day_of_year: 261
dst: true
dst_from: 2022-03-13T07:00:00+00:00
dst_offset: 3600
dst_until: 2022-11-06T06:00:00+00:00
raw_offset: -18000
timezone: America/Toronto
unixtime: 1663479391
utc_datetime: 2022-09-18T05:36:31.992595+00:00
utc_offset: -04:00
week_number: 37
**************************************
Following is the debug terminal when running example AsyncHTTPSRequest_ESP on ESP32S2_DEV to demonstrate the operation of SSL Async HTTPS request, using AsyncTCP_SSL Library.
Starting AsyncHTTPSRequest_ESP using ESP32S2_DEV
AsyncTCP_SSL v1.3.1
AsyncHTTPSRequest_Generic v2.1.2
Connecting to WiFi SSID: HueNet1
.......
AsyncHTTPSRequest @ IP : 192.168.2.79
[ATCP] _handle_async_event: LWIP_TCP_DNS = 0x3FFE4E24
[ATCP] _handle_async_event: LWIP_TCP_DNS, name = worldtimeapi.org , IP = 213.188.196.246
[ATCP] _handle_async_event: LWIP_TCP_CONNECTED = 0x3FFE4E24 0x3FFE5024
[ATCP] _handle_async_event: LWIP_TCP_CONNECTED = 0
[ATCP] _handle_async_event: LWIP_TCP_SENT = 0x3FFE5024
[ATCP] _sent: len = 305
[ATCP] _handle_async_event: LWIP_TCP_RECV = 0x3FFE5024
[ATCP] _recv: tot_len = 1436
[ATCP] _handle_async_event: LWIP_TCP_RECV = 0x3FFE5024
[ATCP] _recv: tot_len = 1436
[ATCP] _handle_async_event: LWIP_TCP_RECV = 0x3FFE5024
[ATCP] _recv: tot_len = 1242
[ATCP] _handle_async_event: LWIP_TCP_SENT = 0x3FFE5024
[ATCP] _sent: len = 107
[ATCP] _handle_async_event: LWIP_TCP_SENT = 0x3FFE5024
[ATCP] _sent: len = 6
[ATCP] _handle_async_event: LWIP_TCP_SENT = 0x3FFE5024
[ATCP] _sent: len = 45
[ATCP] _handle_async_event: LWIP_TCP_RECV = 0x3FFE5024
[ATCP] _recv: tot_len = 51
[ATCP] _handle_async_event: LWIP_TCP_SENT = 0x3FFE5024
[ATCP] _sent: len = 106
[ATCP] _handle_async_event: LWIP_TCP_RECV = 0x3FFE5024
[ATCP] _recv: tot_len = 1016
**************************************
abbreviation: EDT
client_ip: aaa.bbb.ccc.ddd
datetime: 2022-09-18T01:35:32.451975-04:00
day_of_week: 0
day_of_year: 261
dst: true
dst_from: 2022-03-13T07:00:00+00:00
dst_offset: 3600
dst_until: 2022-11-06T06:00:00+00:00
raw_offset: -18000
timezone: America/Toronto
unixtime: 1663479332
utc_datetime: 2022-09-18T05:35:32.451975+00:00
utc_offset: -04:00
week_number: 37
**************************************
HHHHHH
**************************************
[AHTTPS] Response Code = HTTP OK
**************************************
abbreviation: EDT
client_ip: aaa.bbb.ccc.ddd
datetime: 2022-09-18T01:36:31.992595-04:00
day_of_week: 0
day_of_year: 261
dst: true
dst_from: 2022-03-13T07:00:00+00:00
dst_offset: 3600
dst_until: 2022-11-06T06:00:00+00:00
raw_offset: -18000
timezone: America/Toronto
unixtime: 1663479391
utc_datetime: 2022-09-18T05:36:31.992595+00:00
utc_offset: -04:00
week_number: 37
**************************************
Following is the debug terminal when running example AsyncHTTPSRequest_ESP on ESP32C3_DEV to demonstrate the operation of SSL Async HTTPS request, using AsyncTCP_SSL Library.
Starting AsyncHTTPSRequest_ESP using ESP32C3_DEV
AsyncTCP_SSL v1.3.1
AsyncHTTPSRequest_Generic v2.1.2
Connecting to WiFi SSID: HueNet1
.........
AsyncHTTPSRequest @ IP : 192.168.2.80
**************************************
abbreviation: EDT
client_ip: aaa.bbb.ccc.ddd
datetime: 2022-09-18T01:35:32.451975-04:00
day_of_week: 0
day_of_year: 261
dst: true
dst_from: 2022-03-13T07:00:00+00:00
dst_offset: 3600
dst_until: 2022-11-06T06:00:00+00:00
raw_offset: -18000
timezone: America/Toronto
unixtime: 1663479332
utc_datetime: 2022-09-18T05:35:32.451975+00:00
utc_offset: -04:00
week_number: 37
**************************************
HHHHHH
**************************************
[AHTTPS] Response Code = HTTP OK
**************************************
abbreviation: EDT
client_ip: aaa.bbb.ccc.ddd
datetime: 2022-09-18T01:36:31.992595-04:00
day_of_week: 0
day_of_year: 261
dst: true
dst_from: 2022-03-13T07:00:00+00:00
dst_offset: 3600
dst_until: 2022-11-06T06:00:00+00:00
raw_offset: -18000
timezone: America/Toronto
unixtime: 1663479391
utc_datetime: 2022-09-18T05:36:31.992595+00:00
utc_offset: -04:00
week_number: 37
**************************************
Following is the debug terminal when running example AsyncHTTPSRequest_ESP_WiFiManager on ESP32_DEV to demonstrate the operation of SSL Async HTTPS request, using AsyncTCP_SSL Library, and ESPAsync_WiFiManager Library
Starting AsyncHTTPSRequest_ESP_WiFiManager using LittleFS on ESP32_DEV
ESPAsync_WiFiManager v1.14.0
AsyncTCP_SSL v1.3.1
AsyncHTTPSRequest_Generic v2.1.2
Stored: SSID = HueNet1, Pass = 12345678
Got stored Credentials. Timeout 120s
ConnectMultiWiFi in setup
After waiting 11.38 secs more in setup(), connection result is connected. Local IP: 192.168.2.232
H
**************************************
abbreviation: EDT
client_ip: aaa.bbb.ccc.ddd
datetime: 2022-09-18T01:38:31.571698-04:00
day_of_week: 0
day_of_year: 261
dst: true
dst_from: 2022-03-13T07:00:00+00:00
dst_offset: 3600
dst_until: 2022-11-06T06:00:00+00:00
raw_offset: -18000
timezone: America/Toronto
unixtime: 1663479511
utc_datetime: 2022-09-18T05:38:31.571698+00:00
utc_offset: -04:00
week_number: 37
**************************************
H
Following is the debug terminal when running example AsyncHTTPSRequest_WT32_ETH01 on WT32_ETH01 to demonstrate the operation of SSL Async HTTPS request, using AsyncTCP_SSL Library and ESP32 core v2.0.0
Starting AsyncHTTPSRequest_WT32_ETH01 using ESP32_DEV with ETH_PHY_LAN8720
WebServer_WT32_ETH01 v1.5.0 for core v2.0.0+
AsyncTCP_SSL v1.3.1
AsyncHTTPSRequest_Generic v2.1.2
ETH MAC: A8:03:2A:A1:61:73, IPv4: 192.168.2.82, FULL_DUPLEX, 100Mbps
HTTP WebClient is @ IP : 192.168.2.82
**************************************
abbreviation: EDT
client_ip: aaa.bbb.ccc.ddd
datetime: 2022-09-18T01:39:31.717889-04:00
day_of_week: 0
day_of_year: 261
dst: true
dst_from: 2022-03-13T07:00:00+00:00
dst_offset: 3600
dst_until: 2022-11-06T06:00:00+00:00
raw_offset: -18000
timezone: America/Toronto
unixtime: 1663479571
utc_datetime: 2022-09-18T05:39:31.717889+00:00
utc_offset: -04:00
week_number: 37
**************************************
Following is the debug terminal when running example AsyncHTTPSRequest_WT32_ETH01 on WT32_ETH01 to demonstrate the operation of SSL Async HTTPS request, using AsyncTCP_SSL Library and ESP32 core v1.0.6
Starting AsyncHTTPSRequest_WT32_ETH01 using ESP32_DEV with ETH_PHY_LAN8720
WebServer_WT32_ETH01 v1.5.0 for core v1.0.6-
AsyncTCP_SSL v1.3.1
AsyncHTTPSRequest_Generic v2.1.2
ETH MAC: A8:03:2A:A1:61:73, IPv4: 192.168.2.232, FULL_DUPLEX, 100Mbps
HTTP WebClient is @ IP : 192.168.2.232
**************************************
abbreviation: EDT
client_ip: aaa.bbb.ccc.ddd
datetime: 2022-09-18T01:41:32.014336-04:00
day_of_week: 0
day_of_year: 261
dst: true
dst_from: 2022-03-13T07:00:00+00:00
dst_offset: 3600
dst_until: 2022-11-06T06:00:00+00:00
raw_offset: -18000
timezone: America/Toronto
unixtime: 1663479692
utc_datetime: 2022-09-18T05:41:32.014336+00:00
utc_offset: -04:00
week_number: 37
**************************************
Following is the debug terminal when running example AsyncHTTPSRequest_ESP_WiFiManager on ESP32C3_DEV to demonstrate the operation of SSL Async HTTPS request, using AsyncTCP_SSL Library, and ESPAsync_WiFiManager Library
Starting AsyncHTTPSRequest_ESP_WiFiManager using LittleFS on ESP32C3_DEV
ESPAsync_WiFiManager v1.14.0
AsyncHTTPSRequest_Generic v2.1.2
Stored: SSID = HueNet1, Pass = password
Got stored Credentials. Timeout 120s
ConnectMultiWiFi in setup
After waiting 8.75 secs more in setup(), connection result is connected. Local IP: 192.168.2.85
H
**************************************
abbreviation: EDT
client_ip: aaa.bbb.ccc.ddd
datetime: 2022-09-18T01:42:31.838322-04:00
day_of_week: 0
day_of_year: 261
dst: true
dst_from: 2022-03-13T07:00:00+00:00
dst_offset: 3600
dst_until: 2022-11-06T06:00:00+00:00
raw_offset: -18000
timezone: America/Toronto
unixtime: 1663479751
utc_datetime: 2022-09-18T05:42:31.838322+00:00
utc_offset: -04:00
week_number: 37
**************************************
HHHHHH
**************************************
[AHTTPS] Response Code = HTTP OK
**************************************
abbreviation: EDT
client_ip: aaa.bbb.ccc.ddd
datetime: 2022-09-18T01:43:31.847679-04:00
day_of_week: 0
day_of_year: 261
dst: true
dst_from: 2022-03-13T07:00:00+00:00
dst_offset: 3600
dst_until: 2022-11-06T06:00:00+00:00
raw_offset: -18000
timezone: America/Toronto
unixtime: 1663479811
utc_datetime: 2022-09-18T05:43:31.847679+00:00
utc_offset: -04:00
week_number: 37
**************************************
HH
Following is the debug terminal when running example AsyncHTTPSRequest_ESP_WiFiManager on ESP32S3_DEV to demonstrate the operation of SSL Async HTTPS request, using AsyncTCP_SSL Library, and ESPAsync_WiFiManager Library
Starting AsyncHTTPSRequest_ESP_WiFiManager using LittleFS on ESP32S3_DEV
ESPAsync_WiFiManager v1.14.0
AsyncHTTPSRequest_Generic v2.1.2
Stored: SSID = HueNet1, Pass = password
Got stored Credentials. Timeout 120s
ConnectMultiWiFi in setup
After waiting 8.26 secs more in setup(), connection result is connected. Local IP: 192.168.2.83
H
**************************************
abbreviation: EDT
client_ip: aaa.bbb.ccc.ddd
datetime: 2022-09-18T01:45:31.779638-04:00
day_of_week: 0
day_of_year: 261
dst: true
dst_from: 2022-03-13T07:00:00+00:00
dst_offset: 3600
dst_until: 2022-11-06T06:00:00+00:00
raw_offset: -18000
timezone: America/Toronto
unixtime: 1663479931
utc_datetime: 2022-09-18T05:45:31.779638+00:00
utc_offset: -04:00
week_number: 37
**************************************
HHHH
The terminal output of AsyncHTTPSRequest_ESP_Multi example running on ESP32_DEV to demonstrate how to send requests to multiple addresses and receive responses from them.
Starting AsyncHTTPSRequest_ESP_Multi on ESP32_DEV
AsyncTCP_SSL v1.3.1
AsyncHTTPSRequest_Generic v2.1.2
Connecting to WiFi SSID: HueNet1
...
AsyncHTTPSRequest @ IP : 192.168.2.187
Sending request: https://worldtimeapi.org/api/timezone/Europe/Prague.txt
Sending request: https://www.myexternalip.com/raw
[AHTTPS] _onError handler SSL error = OK
[AHTTPS] _onError handler SSL error = OK
**************************************
[AHTTPS] Response Code = HTTP OK
**************************************
aaa.bbb.ccc.ddd
**************************************
**************************************
[AHTTPS] Response Code = HTTP OK
**************************************
abbreviation: CEST
client_ip: aaa.bbb.ccc.ddd
datetime: 2022-09-18T07:50:04.395849+02:00
day_of_week: 0
day_of_year: 261
dst: true
dst_from: 2022-03-27T01:00:00+00:00
dst_offset: 3600
dst_until: 2022-10-30T01:00:00+00:00
raw_offset: 3600
timezone: Europe/Prague
unixtime: 1663480204
utc_datetime: 2022-09-18T05:50:04.395849+00:00
utc_offset: +02:00
week_number: 37
**************************************
Sending request: https://worldtimeapi.org/api/timezone/America/Toronto.txt
**************************************
[AHTTPS] Response Code = HTTP OK
**************************************
abbreviation: EDT
client_ip: aaa.bbb.ccc.ddd
datetime: 2022-09-18T01:50:05.382100-04:00
day_of_week: 0
day_of_year: 261
dst: true
dst_from: 2022-03-13T07:00:00+00:00
dst_offset: 3600
dst_until: 2022-11-06T06:00:00+00:00
raw_offset: -18000
timezone: America/Toronto
unixtime: 1663480205
utc_datetime: 2022-09-18T05:50:05.382100+00:00
utc_offset: -04:00
week_number: 37
**************************************
H
The terminal output of AsyncHTTP_HTTPSRequest_ESP example running on ESP32_DEV to demonstrate how to send HTTP and HTTPS requests to multiple addresses and receive responses from them.
21:49:19.090 -> Starting AsyncHTTP_HTTPSRequest_ESP on ESP32_DEV
21:49:19.090 -> AsyncTCP_SSL v1.3.1
21:49:19.090 -> AsyncHTTPSRequest_Generic v2.1.2
21:49:19.090 -> AsyncHTTPRequest_Generic v1.9.1
21:49:19.190 -> Connecting to WiFi SSID: HueNet1
21:49:19.686 -> ...
21:49:20.713 -> AsyncHTTPSRequest @ IP : 192.168.2.186
21:49:20.713 ->
21:49:20.713 -> Sending HTTPS request: https://worldtimeapi.org/api/timezone/Europe/Prague.txt
21:49:21.907 ->
21:49:21.907 -> Sending HTTP request: http://worldtimeapi.org/api/timezone/America/Vancouver.txt
21:49:21.907 -> [AHTTPS] _onError handler SSL error = OK
21:49:21.940 ->
21:49:21.940 -> **************************************
21:49:21.940 -> abbreviation: PDT
21:49:21.940 -> client_ip: aaa.bbb.ccc.ddd
21:49:21.940 -> datetime: 2022-09-02T18:49:21.890939-07:00
21:49:21.940 -> day_of_week: 5
21:49:21.940 -> day_of_year: 245
21:49:21.940 -> dst: true
21:49:21.940 -> dst_from: 2022-03-13T10:00:00+00:00
21:49:21.940 -> dst_offset: 3600
21:49:21.940 -> dst_until: 2022-11-06T09:00:00+00:00
21:49:21.973 -> raw_offset: -28800
21:49:21.973 -> timezone: America/Vancouver
21:49:21.973 -> unixtime: 1662169761
21:49:21.973 -> utc_datetime: 2022-09-03T01:49:21.890939+00:00
21:49:21.973 -> utc_offset: -07:00
21:49:21.973 -> week_number: 35
21:49:21.973 -> **************************************
21:49:21.973 ->
21:49:21.973 -> **************************************
21:49:21.973 -> [AHTTPS] Response Code = HTTP OK
21:49:21.973 ->
21:49:21.973 -> **************************************
21:49:21.973 -> abbreviation: CEST
21:49:21.973 -> client_ip: aaa.bbb.ccc.ddd
21:49:21.973 -> datetime: 2022-09-03T03:49:21.903031+02:00
21:49:21.973 -> day_of_week: 6
21:49:21.973 -> day_of_year: 246
21:49:21.973 -> dst: true
21:49:21.973 -> dst_from: 2022-03-27T01:00:00+00:00
21:49:21.973 -> dst_offset: 3600
21:49:21.973 -> dst_until: 2022-10-30T01:00:00+00:00
21:49:22.006 -> raw_offset: 3600
21:49:22.006 -> timezone: Europe/Prague
21:49:22.006 -> unixtime: 1662169761
21:49:22.006 -> utc_datetime: 2022-09-03T01:49:21.903031+00:00
21:49:22.006 -> utc_offset: +02:00
21:49:22.006 -> week_number: 35
21:49:22.006 -> **************************************
21:49:22.006 ->
21:49:22.006 -> Sending HTTP request: http://www.myexternalip.com/raw
21:49:22.105 ->
21:49:22.105 -> **************************************
21:49:22.105 -> aaa.bbb.ccc.ddd
21:49:22.105 -> **************************************
21:49:22.105 ->
21:49:22.105 -> Sending HTTPS request: https://worldtimeapi.org/api/timezone/America/Toronto.txt
21:49:22.138 ->
21:49:22.138 -> **************************************
21:49:22.138 -> [AHTTPS] Response Code = HTTP OK
21:49:22.138 ->
21:49:22.138 -> **************************************
21:49:22.138 -> abbreviation: EDT
21:49:22.138 -> client_ip: aaa.bbb.ccc.ddd
21:49:22.138 -> datetime: 2022-09-02T21:49:22.102346-04:00
21:49:22.138 -> day_of_week: 5
21:49:22.138 -> day_of_year: 245
21:49:22.138 -> dst: true
21:49:22.138 -> dst_from: 2022-03-13T07:00:00+00:00
21:49:22.172 -> dst_offset: 3600
21:49:22.172 -> dst_until: 2022-11-06T06:00:00+00:00
21:49:22.172 -> raw_offset: -18000
21:49:22.172 -> timezone: America/Toronto
21:49:22.172 -> unixtime: 1662169762
21:49:22.172 -> utc_datetime: 2022-09-03T01:49:22.102346+00:00
21:49:22.172 -> utc_offset: -04:00
21:49:22.172 -> week_number: 35
21:49:22.172 -> **************************************
21:49:22.205 ->
21:49:22.205 -> Sending HTTP request: http://worldtimeapi.org/api/timezone/Europe/London.txt
21:49:22.238 ->
21:49:22.238 -> **************************************
21:49:22.238 -> abbreviation: BST
21:49:22.238 -> client_ip: aaa.bbb.ccc.ddd
21:49:22.238 -> datetime: 2022-09-03T02:49:22.199791+01:00
21:49:22.238 -> day_of_week: 6
21:49:22.238 -> day_of_year: 246
21:49:22.238 -> dst: true
21:49:22.238 -> dst_from: 2022-03-27T01:00:00+00:00
21:49:22.238 -> dst_offset: 3600
21:49:22.238 -> dst_until: 2022-10-30T01:00:00+00:00
21:49:22.271 -> raw_offset: 0
21:49:22.271 -> timezone: Europe/London
21:49:22.271 -> unixtime: 1662169762
21:49:22.271 -> utc_datetime: 2022-09-03T01:49:22.199791+00:00
21:49:22.271 -> utc_offset: +01:00
21:49:22.271 -> week_number: 35
21:49:22.271 -> **************************************
21:49:30.692 -> H
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_TCP_SSL_LOGLEVEL_ 1
#define _ASYNC_HTTPS_LOGLEVEL_ 2If 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.
Submit issues to: AsyncHTTPSRequest_Generic issues
- Fix bug. Add enhancement
- Add support to more Ethernet / WiFi shields
- Add support to RP2040W, ESP8266, Portenta_H7, STM32 and many more boards
- Add many more examples.
- Initially add support to ESP32 using built-in WiFi
- Support
breakingESP32 core v2.0.0+ as well as v1.0.6- - Auto detect ESP32 core v1.0.6- or v2.0.0+ to use correct settings
- Fix
multiple-definitionslinker error and weird bug related tosrc_cpp. - Enable compatibility with old code to include only
AsyncHTTPSRequest_Generic.h - Modify to be compatible with AsyncTCP_SSL releases v1.2.0+
- Add complex example AsyncHTTPSRequest_ESP_WiFiManager
- Add support to ESP32-S3 (ESP32S3_DEV, ESP32_S3_BOX, UM TINYS3, UM PROS3, UM FEATHERS3, etc.) using EEPROM, SPIFFS or LittleFS
- Add
LittleFSsupport to ESP32-C3 - Use
ESP32-core's LittleFSlibrary instead ofLorol's LITTLEFSlibrary for ESP32 core v2.0.0+ - Add example AsyncHTTPSRequest_ESP_Multi to demonstrate how to send requests to multiple addresses and receive responses from them.
- Permit coexisting with AsyncHTTPRequest library to send and receive both HTTP and HTTPS
- Add example AsyncHTTP_HTTPSRequest_ESP to demonstrate how to send HTTP and HTTPS requests to multiple addresses and receive responses from them.
- Increase
DEFAULT_RX_TIMEOUTto30sfrom3sfor slower networks. - Fix long timeout if using bad or unreachable
IPAddress - Display only successful
responseTextin examples - Improve debug messages by adding functions to display
error messagesinstead ofcryptic error number - Fix ESP32 chipID for example
AsyncHTTPSRequest_ESP_WiFiManager
This library is based on, modified, bug-fixed and improved from:
- Bob Lemaire's asyncHTTPrequest Library to use the better asynchronous features of the following Async SSL TCP Libraries : (
AsyncTCP_SSL). - Thanks to DavidAntonin
- to report Cannot send requests to different addresses #4 leading to new release v1.4.1 to demonstrate how to send requests to multiple addresses and receive responses from them.
- to raise the idea and request enhancement Pushover https post request #21 leading to new release v2.0.0 to permit coexisting with AsyncHTTPRequest library to send and receive both HTTP and HTTPS.
- Thanks to Glenn West
- to report and propose a fix in No result from github https query #8 leading to new release v2.0.1 to increase
DEFAULT_RX_TIMEOUTto30sfrom3sfor slower networks
![]() ⭐️ Bob Lemaire |
![]() David Antonin |
![]() Glenn West |
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
- The library is licensed under GPLv3
Copyright (C) <2018> <Bob Lemaire, IoTaWatt, Inc.>
Copyright (C) 2021- Khoi Hoang



