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

Commit 79f62c3

Browse files
authored
v1.9.2 not to reconnect after connected
### 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`
1 parent dcdf3dc commit 79f62c3

File tree

23 files changed

+150
-90
lines changed

23 files changed

+150
-90
lines changed

CONTRIBUTING.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ If you don't find anything, please [open a new issue](https://github.com/khoih-p
1515
Please ensure to specify the following:
1616

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

2828
```
2929
Arduino IDE version: 1.8.19
30-
ESP32 Core Version 2.0.4
30+
ESP32 Core Version 2.0.5
3131
OS: Ubuntu 20.04 LTS
32-
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
32+
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
3333
3434
Context:
35-
I encountered an endless loop while trying to connect to Local WiFi.
35+
I encountered a crash when using this library
3636
3737
Steps to reproduce:
3838
1. ...

changelog.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
## Table of Contents
1313

1414
* [Changelog](#changelog)
15+
* [Releases v1.9.2](#releases-v192)
1516
* [Releases v1.9.1](#releases-v191)
1617
* [Releases v1.9.0](#releases-v190)
1718
* [Releases v1.8.2](#releases-v182)
@@ -41,6 +42,11 @@
4142

4243
## Changelog
4344

45+
### Releases v1.9.2
46+
47+
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)
48+
2. Update `Packages' Patches`
49+
4450
### Releases v1.9.1
4551

4652
1. Fix ESP32 chipID for example `AsyncHTTPRequest_ESP_WiFiManager`

examples/AsyncCustomHeader_STM32/AsyncCustomHeader_STM32.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
//char GET_ServerAddress[] = "192.168.2.110/";
2525
char GET_ServerAddress[] = "http://worldtimeapi.org/api/timezone/America/Toronto.txt";
2626

27-
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN_TARGET "AsyncHTTPRequest_Generic v1.9.1"
28-
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN 1009001
27+
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN_TARGET "AsyncHTTPRequest_Generic v1.9.2"
28+
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN 1009002
2929

3030
// 600s = 10 minutes to not flooding, 60s in testing
3131
#define HTTP_REQUEST_INTERVAL_MS 60000 //600000

examples/AsyncDweetGet_STM32/AsyncDweetGet_STM32.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ const char GET_ServerAddress[] = "dweet.io";
3535
// use your own thing name here
3636
String dweetName = "/dweet/for/currentSecond?second=";
3737

38-
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN_TARGET "AsyncHTTPRequest_Generic v1.9.1"
39-
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN 1009001
38+
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN_TARGET "AsyncHTTPRequest_Generic v1.9.2"
39+
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN 1009002
4040

4141
// 600s = 10 minutes to not flooding, 60s in testing
4242
#define HTTP_REQUEST_INTERVAL_MS 60000 //600000

examples/AsyncDweetPost_STM32/AsyncDweetPost_STM32.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ const char POST_ServerAddress[] = "dweet.io";
2929
// use your own thing name here
3030
String dweetName = "/dweet/for/pinA0-Read?";
3131

32-
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN_TARGET "AsyncHTTPRequest_Generic v1.9.1"
33-
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN 1009001
32+
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN_TARGET "AsyncHTTPRequest_Generic v1.9.2"
33+
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN 1009002
3434

3535
// 600s = 10 minutes to not flooding, 60s in testing
3636
#define HTTP_REQUEST_INTERVAL_MS 60000 //600000

examples/AsyncHTTPMultiRequests_ESP/AsyncHTTPMultiRequests_ESP.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@
4444
#error This code is intended to run on the ESP8266 or ESP32 platform! Please check your Tools->Board setting.
4545
#endif
4646

47-
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN_TARGET "AsyncHTTPRequest_Generic v1.9.1"
48-
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN 1009001
47+
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN_TARGET "AsyncHTTPRequest_Generic v1.9.2"
48+
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN 1009002
4949

5050
// Level from 0-4
5151
#define ASYNC_HTTP_DEBUG_PORT Serial

examples/AsyncHTTPRequest_ESP/AsyncHTTPRequest_ESP.ino

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646

4747
// Level from 0-4
4848
#define ASYNC_HTTP_DEBUG_PORT Serial
49-
#define _ASYNC_HTTP_LOGLEVEL_ 1
49+
#define _ASYNC_HTTP_LOGLEVEL_ 3
5050

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

68-
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN_TARGET "AsyncHTTPRequest_Generic v1.9.1"
69-
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN 1009001
68+
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN_TARGET "AsyncHTTPRequest_Generic v1.9.2"
69+
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN 1009002
7070

7171
// To be included only in main(), .ino with setup() to avoid `Multiple Definitions` Linker Error
7272
#include <AsyncHTTPRequest_Generic.h> // https://github.com/khoih-prog/AsyncHTTPRequest_Generic

examples/AsyncHTTPRequest_ESP8266_Ethernet/AsyncHTTPRequest_ESP8266_Ethernet.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@ using TCPClient = WiFiClient;
9595

9696
//////////////////////////////////////////////////////////
9797

98-
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN_TARGET "AsyncHTTPRequest_Generic v1.9.1"
99-
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN 1009001
98+
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN_TARGET "AsyncHTTPRequest_Generic v1.9.2"
99+
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN 1009002
100100

101101
// To be included only in main(), .ino with setup() to avoid `Multiple Definitions` Linker Error
102102
#include <AsyncHTTPRequest_Generic.h> // https://github.com/khoih-prog/AsyncHTTPRequest_Generic

examples/AsyncHTTPRequest_ESP_Multi/AsyncHTTPRequest_ESP_Multi.ino

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -139,15 +139,14 @@ void sendRequests()
139139
reqCount[1] = NUM_ENTRIES_SITE_1;
140140
}
141141

142-
143142
void requestCB0(void* optParm, AsyncHTTPRequest* thisRequest, int readyState)
144143
{
145144
(void) optParm;
146145

147146
if (readyState == readyStateDone)
148147
{
149-
AHTTP_LOGERROR(F("\n**************************************"));
150-
AHTTP_LOGERROR1(F("Response Code = "), request->responseHTTPString());
148+
AHTTP_LOGWARN(F("\n**************************************"));
149+
AHTTP_LOGWARN1(F("Response Code = "), request->responseHTTPString());
151150

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

172171
if (readyState == readyStateDone)
173172
{
174-
AHTTP_LOGERROR(F("\n**************************************"));
175-
AHTTP_LOGERROR1(F("Response Code = "), request->responseHTTPString());
173+
AHTTP_LOGWARN(F("\n**************************************"));
174+
AHTTP_LOGWARN1(F("Response Code = "), request->responseHTTPString());
176175

177176
if (request->responseHTTPcode() == 200)
178177
{
@@ -207,7 +206,7 @@ void setup()
207206

208207
while (WiFi.status() != WL_CONNECTED)
209208
{
210-
delay(500);
209+
delay(1000);
211210
Serial.print(".");
212211
}
213212

@@ -231,12 +230,11 @@ void loop()
231230
for (int index = 0; index < NUM_DIFFERENT_SITES; index++)
232231
{
233232
if ((reqCount[index] > 0) && readySend[index])
234-
// OK but have to use delay(100)
235-
//if ( reqCount[index] > 0 )
236233
{
237234
sendRequestCB[index]();
238-
239-
//delay(100);
235+
236+
// Don't send too fast
237+
delay(1000);
240238
}
241239
}
242240
}

examples/AsyncHTTPRequest_ESP_WiFiManager/AsyncHTTPRequest_ESP_WiFiManager.ino

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,11 @@
4646
#error This code is intended to run on the ESP8266 or ESP32 platform! Please check your Tools->Board setting.
4747
#endif
4848

49-
#define ESP_ASYNC_WIFIMANAGER_VERSION_MIN_TARGET "ESPAsync_WiFiManager v1.14.0"
50-
#define ESP_ASYNC_WIFIMANAGER_VERSION_MIN 1014000
49+
#define ESP_ASYNC_WIFIMANAGER_VERSION_MIN_TARGET "ESPAsync_WiFiManager v1.15.0"
50+
#define ESP_ASYNC_WIFIMANAGER_VERSION_MIN 1015000
5151

52-
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN_TARGET "AsyncHTTPRequest_Generic v1.9.1"
53-
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN 1009001
52+
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN_TARGET "AsyncHTTPRequest_Generic v1.9.2"
53+
#define ASYNC_HTTP_REQUEST_GENERIC_VERSION_MIN 1009002
5454

5555
// Level from 0-4
5656
#define ASYNC_HTTP_DEBUG_PORT Serial

0 commit comments

Comments
 (0)