Skip to content
This repository has been archived by the owner on Feb 4, 2023. It is now read-only.

Commit

Permalink
v1.9.2 not to reconnect after connected
Browse files Browse the repository at this point in the history
### Releases v1.9.2

1. Not try to reconnect to the same host:port after connected. Check [setReuse feature #12](khoih-prog/AsyncHTTPSRequest_Generic#12)
2. Update `Packages' Patches`
  • Loading branch information
khoih-prog authored Oct 19, 2022
1 parent dcdf3dc commit 79f62c3
Show file tree
Hide file tree
Showing 23 changed files with 150 additions and 90 deletions.
8 changes: 4 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ If you don't find anything, please [open a new issue](https://github.com/khoih-p
Please ensure to specify the following:

* Arduino IDE version (e.g. 1.8.19) or Platform.io version
* `ESP8266`,`ESP32` or `STM32` Core Version (e.g. ESP8266 core v3.0.2, ESP32 v2.0.4 or STM32 v2.3.0)
* `ESP8266`,`ESP32` or `STM32` Core Version (e.g. ESP8266 core v3.0.2, ESP32 v2.0.5 or STM32 v2.3.0)
* Contextual information (e.g. what you were trying to achieve)
* Simplest possible steps to reproduce
* Anything that might be relevant in your opinion, such as:
Expand All @@ -27,12 +27,12 @@ Please ensure to specify the following:

```
Arduino IDE version: 1.8.19
ESP32 Core Version 2.0.4
ESP32 Core Version 2.0.5
OS: Ubuntu 20.04 LTS
Linux xy-Inspiron-3593 5.15.0-46-generic #49~20.04.1-Ubuntu SMP Thu Aug 4 19:15:44 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
Linux xy-Inspiron-3593 5.15.0-50-generic #56~20.04.1-Ubuntu SMP Tue Sep 27 15:51:29 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
Context:
I encountered an endless loop while trying to connect to Local WiFi.
I encountered a crash when using this library
Steps to reproduce:
1. ...
Expand Down
6 changes: 6 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
## Table of Contents

* [Changelog](#changelog)
* [Releases v1.9.2](#releases-v192)
* [Releases v1.9.1](#releases-v191)
* [Releases v1.9.0](#releases-v190)
* [Releases v1.8.2](#releases-v182)
Expand Down Expand Up @@ -41,6 +42,11 @@

## Changelog

### Releases v1.9.2

1. Not try to reconnect to the same host:port after connected. Check [setReuse feature #12](https://github.com/khoih-prog/AsyncHTTPSRequest_Generic/issues/12)
2. Update `Packages' Patches`

### Releases v1.9.1

1. Fix ESP32 chipID for example `AsyncHTTPRequest_ESP_WiFiManager`
Expand Down
4 changes: 2 additions & 2 deletions examples/AsyncCustomHeader_STM32/AsyncCustomHeader_STM32.ino
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
//char GET_ServerAddress[] = "192.168.2.110/";
char GET_ServerAddress[] = "http://worldtimeapi.org/api/timezone/America/Toronto.txt";

#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN_TARGET "AsyncHTTPRequest_Generic v1.9.1"
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN 1009001
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN_TARGET "AsyncHTTPRequest_Generic v1.9.2"
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN 1009002

// 600s = 10 minutes to not flooding, 60s in testing
#define HTTP_REQUEST_INTERVAL_MS 60000 //600000
Expand Down
4 changes: 2 additions & 2 deletions examples/AsyncDweetGet_STM32/AsyncDweetGet_STM32.ino
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ const char GET_ServerAddress[] = "dweet.io";
// use your own thing name here
String dweetName = "/dweet/for/currentSecond?second=";

#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN_TARGET "AsyncHTTPRequest_Generic v1.9.1"
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN 1009001
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN_TARGET "AsyncHTTPRequest_Generic v1.9.2"
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN 1009002

// 600s = 10 minutes to not flooding, 60s in testing
#define HTTP_REQUEST_INTERVAL_MS 60000 //600000
Expand Down
4 changes: 2 additions & 2 deletions examples/AsyncDweetPost_STM32/AsyncDweetPost_STM32.ino
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ const char POST_ServerAddress[] = "dweet.io";
// use your own thing name here
String dweetName = "/dweet/for/pinA0-Read?";

#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN_TARGET "AsyncHTTPRequest_Generic v1.9.1"
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN 1009001
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN_TARGET "AsyncHTTPRequest_Generic v1.9.2"
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN 1009002

// 600s = 10 minutes to not flooding, 60s in testing
#define HTTP_REQUEST_INTERVAL_MS 60000 //600000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@
#error This code is intended to run on the ESP8266 or ESP32 platform! Please check your Tools->Board setting.
#endif

#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN_TARGET "AsyncHTTPRequest_Generic v1.9.1"
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN 1009001
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN_TARGET "AsyncHTTPRequest_Generic v1.9.2"
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN 1009002

// Level from 0-4
#define ASYNC_HTTP_DEBUG_PORT Serial
Expand Down
6 changes: 3 additions & 3 deletions examples/AsyncHTTPRequest_ESP/AsyncHTTPRequest_ESP.ino
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@

// Level from 0-4
#define ASYNC_HTTP_DEBUG_PORT Serial
#define _ASYNC_HTTP_LOGLEVEL_ 1
#define _ASYNC_HTTP_LOGLEVEL_ 3

// 300s = 5 minutes to not flooding
#define HTTP_REQUEST_INTERVAL 60 //300
Expand All @@ -65,8 +65,8 @@ const char* password = "your_pass";
#include <WiFi.h>
#endif

#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN_TARGET "AsyncHTTPRequest_Generic v1.9.1"
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN 1009001
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN_TARGET "AsyncHTTPRequest_Generic v1.9.2"
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN 1009002

// To be included only in main(), .ino with setup() to avoid `Multiple Definitions` Linker Error
#include <AsyncHTTPRequest_Generic.h> // https://github.com/khoih-prog/AsyncHTTPRequest_Generic
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ using TCPClient = WiFiClient;

//////////////////////////////////////////////////////////

#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN_TARGET "AsyncHTTPRequest_Generic v1.9.1"
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN 1009001
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN_TARGET "AsyncHTTPRequest_Generic v1.9.2"
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN 1009002

// To be included only in main(), .ino with setup() to avoid `Multiple Definitions` Linker Error
#include <AsyncHTTPRequest_Generic.h> // https://github.com/khoih-prog/AsyncHTTPRequest_Generic
Expand Down
18 changes: 8 additions & 10 deletions examples/AsyncHTTPRequest_ESP_Multi/AsyncHTTPRequest_ESP_Multi.ino
Original file line number Diff line number Diff line change
Expand Up @@ -139,15 +139,14 @@ void sendRequests()
reqCount[1] = NUM_ENTRIES_SITE_1;
}


void requestCB0(void* optParm, AsyncHTTPRequest* thisRequest, int readyState)
{
(void) optParm;

if (readyState == readyStateDone)
{
AHTTP_LOGERROR(F("\n**************************************"));
AHTTP_LOGERROR1(F("Response Code = "), request->responseHTTPString());
AHTTP_LOGWARN(F("\n**************************************"));
AHTTP_LOGWARN1(F("Response Code = "), request->responseHTTPString());

if (request->responseHTTPcode() == 200)
{
Expand All @@ -171,8 +170,8 @@ void requestCB1(void* optParm, AsyncHTTPRequest* thisRequest, int readyState)

if (readyState == readyStateDone)
{
AHTTP_LOGERROR(F("\n**************************************"));
AHTTP_LOGERROR1(F("Response Code = "), request->responseHTTPString());
AHTTP_LOGWARN(F("\n**************************************"));
AHTTP_LOGWARN1(F("Response Code = "), request->responseHTTPString());

if (request->responseHTTPcode() == 200)
{
Expand Down Expand Up @@ -207,7 +206,7 @@ void setup()

while (WiFi.status() != WL_CONNECTED)
{
delay(500);
delay(1000);
Serial.print(".");
}

Expand All @@ -231,12 +230,11 @@ void loop()
for (int index = 0; index < NUM_DIFFERENT_SITES; index++)
{
if ((reqCount[index] > 0) && readySend[index])
// OK but have to use delay(100)
//if ( reqCount[index] > 0 )
{
sendRequestCB[index]();

//delay(100);

// Don't send too fast
delay(1000);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@
#error This code is intended to run on the ESP8266 or ESP32 platform! Please check your Tools->Board setting.
#endif

#define ESP_ASYNC_WIFIMANAGER_VERSION_MIN_TARGET "ESPAsync_WiFiManager v1.14.0"
#define ESP_ASYNC_WIFIMANAGER_VERSION_MIN 1014000
#define ESP_ASYNC_WIFIMANAGER_VERSION_MIN_TARGET "ESPAsync_WiFiManager v1.15.0"
#define ESP_ASYNC_WIFIMANAGER_VERSION_MIN 1015000

#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN_TARGET "AsyncHTTPRequest_Generic v1.9.1"
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN 1009001
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN_TARGET "AsyncHTTPRequest_Generic v1.9.2"
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN 1009002

// Level from 0-4
#define ASYNC_HTTP_DEBUG_PORT Serial
Expand Down
4 changes: 2 additions & 2 deletions examples/AsyncHTTPRequest_STM32/AsyncHTTPRequest_STM32.ino
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@

#include "defines.h"

#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN_TARGET "AsyncHTTPRequest_Generic v1.9.1"
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN 1009001
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN_TARGET "AsyncHTTPRequest_Generic v1.9.2"
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN 1009002

// 600s = 10 minutes to not flooding, 60s in testing
#define HTTP_REQUEST_INTERVAL_MS 60000 //600000
Expand Down
4 changes: 2 additions & 2 deletions examples/AsyncSimpleGET_STM32/AsyncSimpleGET_STM32.ino
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
//char GET_ServerAddress[] = "ipv4bot.whatismyipaddress.com/";
char GET_ServerAddress[] = "http://worldtimeapi.org/api/timezone/America/Toronto.txt";

#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN_TARGET "AsyncHTTPRequest_Generic v1.9.1"
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN 1009001
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN_TARGET "AsyncHTTPRequest_Generic v1.9.2"
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN 1009002

// 600s = 10 minutes to not flooding, 60s in testing
#define HTTP_REQUEST_INTERVAL_MS 60000 //600000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ const char GET_ServerAddress[] = "arduino.tips";
// GET location
String GET_Location = "/asciilogo.txt";

#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN_TARGET "AsyncHTTPRequest_Generic v1.9.1"
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN 1009001
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN_TARGET "AsyncHTTPRequest_Generic v1.9.2"
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN 1009002

// 600s = 10 minutes to not flooding, 60s in testing
#define HTTP_REQUEST_INTERVAL_MS 60000 //600000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@

#include <WebServer_WT32_ETH01.h> // https://github.com/khoih-prog/WebServer_WT32_ETH01

#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN_TARGET "AsyncHTTPRequest_Generic v1.9.1"
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN 1009001
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN_TARGET "AsyncHTTPRequest_Generic v1.9.2"
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN 1009002

// To be included only in main(), .ino with setup() to avoid `Multiple Definitions` Linker Error
#include <AsyncHTTPRequest_Generic.h> // https://github.com/khoih-prog/AsyncHTTPRequest_Generic
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@

#include <WebServer_WT32_ETH01.h> // https://github.com/khoih-prog/WebServer_WT32_ETH01

#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN_TARGET "AsyncHTTPRequest_Generic v1.9.1"
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN 1009001
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN_TARGET "AsyncHTTPRequest_Generic v1.9.2"
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN 1009002

// To be included only in main(), .ino with setup() to avoid `Multiple Definitions` Linker Error
#include <AsyncHTTPRequest_Generic.h> // https://github.com/khoih-prog/AsyncHTTPRequest_Generic
Expand Down
4 changes: 2 additions & 2 deletions examples/multiFileProject/multiFileProject.ino
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
#error This code is intended to run on the ESP8266, ESP32 or STM32 platform! Please check your Tools->Board setting.
#endif

#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN_TARGET "AsyncHTTPRequest_Generic v1.9.1"
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN 1009001
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN_TARGET "AsyncHTTPRequest_Generic v1.9.2"
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN 1009002

#include "multiFileProject.h"

Expand Down
9 changes: 5 additions & 4 deletions library.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name":"AsyncHTTPRequest_Generic",
"version": "1.9.1",
"version": "1.9.2",
"description":"Simple Async HTTP Request library, supporting GET, POST, PUT, PATCH, DELETE and HEAD, on top of AsyncTCP libraries, such as AsyncTCP, ESPAsyncTCP, AsyncTCP_STM32, etc.. for ESP32 (including ESP32_S2, ESP32_S3 and ESP32_C3), WT32_ETH01 (ESP32 + LAN8720), ESP8266 (WiFi, W5x00 or ENC28J60) and currently STM32 with built-in LAN8742A Ethernet.",
"keywords":"communication, async, tcp, http, ESP8266, ESP32, ESP32-S2, ESP32-S3, ESP32-C3, wt32-eth01, stm32, ethernet, wifi, lan8742a, nucleo-144, stm32f7, W5x00, ENC28J60",
"authors": [
Expand Down Expand Up @@ -45,7 +45,7 @@
{
"owner": "khoih-prog",
"name": "ESPAsync_WiFiManager",
"version": ">=1.14.0",
"version": ">=1.15.0",
"platforms": ["espressif8266", "espressif32"]
},
{
Expand All @@ -63,12 +63,13 @@
{
"owner": "khoih-prog",
"name": "WebServer_WT32_ETH01",
"version": ">=1.5.0",
"version": ">=1.5.1",
"platforms": ["espressif32"]
},
{
"name": "STM32AsyncTCP",
"version": "https://github.com/khoih-prog/STM32AsyncTCP"
"version": "https://github.com/khoih-prog/STM32AsyncTCP",
"platforms": "ststm32"
}
],
"license": "LGPL-3.0",
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=AsyncHTTPRequest_Generic
version=1.9.1
version=1.9.2
author=Bob Lemaire,Khoi Hoang <khoih.prog@gmail.com>
maintainer=Khoi Hoang <khoih.prog@gmail.com>
license=GPLv3
Expand Down
50 changes: 43 additions & 7 deletions platformio/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -45,20 +45,20 @@ lib_deps =
; https://github.com/khoih-prog/STM32AsyncTCP.git
; STM32duino LwIP@>=2.1.2
; STM32duino STM32Ethernet@>=1.3.0
; ESPAsync_WiFiManager@>=1.14.0
; ESPAsync_WiFiManager@>=1.15.0
; LittleFS_esp32@>=1.0.6
; WebServer_WT32_ETH01@>=1.5.0

; WebServer_WT32_ETH01@>=1.5.1
;
; PlatformIO 5.x
me-no-dev/AsyncTCP@>=1.1.1
me-no-dev/ESPAsyncTCP@>=1.2.2
; me-no-dev/AsyncTCP@>=1.1.1
; me-no-dev/ESPAsyncTCP@>=1.2.2
; philbowles/STM32AsyncTCP
; https://github.com/khoih-prog/STM32AsyncTCP.git
; stm32duino/STM32duino LwIP@>=2.1.2
; stm32duino/STM32duino STM32Ethernet@>=1.3.0
khoih-prog/ESPAsync_WiFiManager@>=1.14.0
; khoih-prog/ESPAsync_WiFiManager@>=1.15.0
; lorol/LittleFS_esp32@>=1.0.6
; khoih-prog/WebServer_WT32_ETH01@>=1.5.0
; khoih-prog/WebServer_WT32_ETH01@>=1.5.1

build_flags =
; set your debug output (default=Serial)
Expand All @@ -69,6 +69,16 @@ build_flags =
[env:ESP8266]
platform = espressif8266
framework = arduino

lib_deps =
; PlatformIO 4.x
; ESPAsyncTCP@>=1.2.2
; ESPAsync_WiFiManager@>=1.15.0
;
; PlatformIO 5.x
me-no-dev/ESPAsyncTCP@>=1.2.2
khoih-prog/ESPAsync_WiFiManager@>=1.15.0

; ============================================================
; Board configuration
; choose your board by uncommenting one of the following lines
Expand Down Expand Up @@ -114,6 +124,20 @@ board = nodemcuv2
[env:ESP32]
platform = espressif32
framework = arduino

lib_deps =
; PlatformIO 4.x
; AsyncTCP@>=1.1.1
; ESPAsync_WiFiManager@>=1.15.0
; LittleFS_esp32@>=1.0.6
; WebServer_WT32_ETH01@>=1.5.1
;
; PlatformIO 5.x
me-no-dev/AsyncTCP@>=1.1.1
khoih-prog/ESPAsync_WiFiManager@>=1.15.0
; lorol/LittleFS_esp32@>=1.0.6
khoih-prog/WebServer_WT32_ETH01@>=1.5.1

; ============================================================
; Board configuration
; choose your board by uncommenting one of the following lines
Expand Down Expand Up @@ -250,6 +274,18 @@ board = feather52840
platform = ststm32
framework = arduino

lib_deps =
; PlatformIO 4.x
; https://github.com/khoih-prog/STM32AsyncTCP.git
; STM32duino LwIP@>=2.1.2
; STM32duino STM32Ethernet@>=1.3.0
;
; PlatformIO 5.x
philbowles/STM32AsyncTCP
https://github.com/khoih-prog/STM32AsyncTCP.git
stm32duino/STM32duino LwIP@>=2.1.2
stm32duino/STM32duino STM32Ethernet@>=1.3.0

; ============================================================
; Choose your board by uncommenting one of the following lines
; ============================================================
Expand Down
3 changes: 2 additions & 1 deletion src/AsyncHTTPRequest_Debug_Generic.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
You should have received a copy of the GNU General Public License along with this program.
If not, see <https://www.gnu.org/licenses/>.
Version: 1.9.1
Version: 1.9.2
Version Modified By Date Comments
------- ----------- ---------- -----------
Expand All @@ -31,6 +31,7 @@
1.8.2 K Hoang 10/08/2022 Fix library.properties to remove unavailable items from depends
1.9.0 K Hoang 30/08/2022 Fix bug. Improve debug messages. Optimize code
1.9.1 K Hoang 09/09/2022 Fix ESP32 chipID for example `AsyncHTTPRequest_ESP_WiFiManager`
1.9.2 K Hoang 18/10/2022 Not try to reconnect to the same host:port after connected
*****************************************************************************************************************************/

#pragma once
Expand Down
Loading

0 comments on commit 79f62c3

Please sign in to comment.