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

Commit b5831c3

Browse files
authored
v1.0.2
### Releases v1.0.2 1. Make Mutex Lock and delete more reliable and error-proof to prevent random crash.
1 parent 2d31dc2 commit b5831c3

33 files changed

+2832
-230
lines changed

CONTRIBUTING.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
## Contributing to ESP_WiFiManager
1+
## Contributing to AsyncHTTPRequest_Generic
22

33
### Reporting Bugs
44

5-
Please report bugs in ESP_WiFiManager if you find them.
5+
Please report bugs in [AsyncHTTPRequest_Generic](https://github.com/khoih-prog/AsyncHTTPRequest_Generic/issues/new) if you find them.
66

77
However, before reporting a bug please check through the following:
88

9-
* [Existing Open Issues](https://github.com/khoih-prog/ESP_WiFiManager/issues) - someone might have already encountered this.
9+
* [Existing Open Issues](https://github.com/khoih-prog/AsyncHTTPRequest_Generic/issues) - someone might have already encountered this.
1010

11-
If you don't find anything, please [open a new issue](https://github.com/khoih-prog/ESP_WiFiManager/issues/new).
11+
If you don't find anything, please [open a new issue](https://github.com/khoih-prog/AsyncHTTPRequest_Generic/issues/new).
1212

1313
### How to submit a bug report
1414

1515
Please ensure to specify the following:
1616

17-
* Arduino IDE version (e.g. 1.8.11) or Platform.io version
18-
* `ESP8266` or `ESP32` Core Version (e.g. ESP8266 core v2.6.3 or ESP32 v1.0.4)
17+
* Arduino IDE version (e.g. 1.8.13) or Platform.io version
18+
* `ESP8266`,`ESP32` or `STM32` Core Version (e.g. ESP8266 core v2.7.4, ESP32 v1.0.4 or STM32 v1.9.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:
@@ -26,10 +26,10 @@ Please ensure to specify the following:
2626
### Example
2727

2828
```
29-
Arduino IDE version: 1.8.11
30-
ESP8266 Core Version 2.6.3
31-
OS: Ubuntu 16.04 LTS
32-
Linux Inspiron 4.4.0-170-generic #199-Ubuntu SMP Thu Nov 14 01:45:04 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
29+
Arduino IDE version: 1.8.13
30+
ESP32 Core Version 1.0.4
31+
OS: Ubuntu 20.04 LTS
32+
Linux xy-Inspiron-3593 5.4.0-51-generic #56-Ubuntu SMP Mon Oct 5 14:28:49 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
3333
3434
Context:
3535
I encountered an endless loop while trying to connect to Local WiFi.
@@ -44,7 +44,7 @@ Steps to reproduce:
4444

4545
Feel free to post feature requests. It's helpful if you can explain exactly why the feature would be useful.
4646

47-
There are usually some outstanding feature requests in the [existing issues list](https://github.com/khoih-prog/ESP_WiFiManager/issues?q=is%3Aopen+is%3Aissue+label%3Aenhancement), feel free to add comments to them.
47+
There are usually some outstanding feature requests in the [existing issues list](https://github.com/khoih-prog/AsyncHTTPRequest_Generic/issues?q=is%3Aopen+is%3Aissue+label%3Aenhancement), feel free to add comments to them.
4848

4949
### Sending Pull Requests
5050

README.md

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ Chunked responses are recognized and handled transparently.
4545
---
4646
---
4747

48+
### Releases v1.0.2
49+
50+
1. Make Mutex Lock and delete more reliable and error-proof to prevent random crash.
51+
4852
### Releases v1.0.1
4953

5054
1. Restore cpp code besides Impl.h code to use in case of `multiple definition` linker error. Thanks to [Daniel Brunner](https://github.com/0xFEEDC0DE64) to report and make PR in [**Fixed linker errors when included in multiple .cpp files**](https://github.com/khoih-prog/AsyncHTTPRequest_Generic/pull/1). See [**HOWTO Fix `Multiple Definitions` Linker Error**](https://github.com/khoih-prog/AsyncHTTPRequest_Generic#HOWTO-Fix-Multiple-Definitions-Linker-Error)
@@ -293,12 +297,12 @@ Please take a look at other examples, as well.
293297
```cpp
294298
#include "defines.h"
295299

296-
// 600s = 10 minutes to not flooding
297-
#define HTTP_REQUEST_INTERVAL_MS 600000
300+
// 600s = 10 minutes to not flooding, 10s in testing
301+
#define HTTP_REQUEST_INTERVAL_MS 10000 // 600000
298302

299-
#include <AsyncHTTPRequest_Generic.h> // https://github.com/khoih-prog/AsyncHTTPRequest_Generic
303+
#include <AsyncHTTPRequest_Generic.h> // https://github.com/khoih-prog/AsyncHTTPRequest_Generic
300304

301-
#include <Ticker.h> // https://github.com/sstaub/Ticker
305+
#include <Ticker.h> // https://github.com/sstaub/Ticker
302306

303307
AsyncHTTPRequest request;
304308

@@ -748,6 +752,10 @@ Submit issues to: [AsyncHTTPRequest_Generic issues](https://github.com/khoih-pro
748752
---
749753
---
750754

755+
### Releases v1.0.2
756+
757+
1. Make Mutex Lock and delete more reliable and error-proof to prevent random crash.
758+
751759
### Releases v1.0.1
752760

753761
1. Restore cpp code besides Impl.h code to use in case of `multiple definition` linker error. Thanks to [Daniel Brunner](https://github.com/0xFEEDC0DE64) to report and make PR in [**Fixed linker errors when included in multiple .cpp files**](https://github.com/khoih-prog/AsyncHTTPRequest_Generic/pull/1). See [**HOWTO Fix `Multiple Definitions` Linker Error**](https://github.com/khoih-prog/AsyncHTTPRequest_Generic#HOWTO-Fix-Multiple-Definitions-Linker-Error)

examples/AsyncCustomHeader_STM32/AsyncCustomHeader_STM32.ino

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,22 +17,23 @@
1717
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
1818
You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
1919
20-
Version: 1.0.1
20+
Version: 1.0.2
2121
2222
Version Modified By Date Comments
2323
------- ----------- ---------- -----------
2424
1.0.0 K Hoang 14/09/2020 Initial coding to add support to STM32 using built-in Ethernet (Nucleo-144, DISCOVERY, etc).
2525
1.0.1 K Hoang 09/10/2020 Restore cpp code besides Impl.h code.
26+
1.0.2 K Hoang 09/11/2020 Make Mutex Lock and delete more reliable and error-proof
2627
*****************************************************************************************************************************/
2728

2829
#include "defines.h"
2930

3031
// Select a test server address
31-
char GET_ServerAddress[] = "192.168.2.110/";
32-
//char GET_ServerAddress[] = "http://worldtimeapi.org/api/timezone/America/Toronto.txt";
32+
//char GET_ServerAddress[] = "192.168.2.110/";
33+
char GET_ServerAddress[] = "http://worldtimeapi.org/api/timezone/America/Toronto.txt";
3334

34-
// 600s = 10 minutes to not flooding
35-
#define HTTP_REQUEST_INTERVAL_MS 600000
35+
// 600s = 10 minutes to not flooding, 10s in testing
36+
#define HTTP_REQUEST_INTERVAL_MS 10000 //600000
3637

3738
#include <AsyncHTTPRequest_Generic.h> // https://github.com/khoih-prog/AsyncHTTPRequest_Generic
3839

@@ -52,7 +53,7 @@ void sendRequest(void)
5253
Serial.println("\nSending GET Request to " + String(GET_ServerAddress));
5354

5455
request.open("GET", GET_ServerAddress);
55-
request.setReqHeader("X-CUSTOM-HEADER", "custom_value");
56+
//request.setReqHeader("X-CUSTOM-HEADER", "custom_value");
5657
request.send();
5758
}
5859
}

examples/AsyncCustomHeader_STM32/defines.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,13 @@
1919
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
2020
You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
2121
22-
Version: 1.0.1
22+
Version: 1.0.2
2323
2424
Version Modified By Date Comments
2525
------- ----------- ---------- -----------
2626
1.0.0 K Hoang 14/09/2020 Initial coding to add support to STM32 using built-in Ethernet (Nucleo-144, DISCOVERY, etc).
2727
1.0.1 K Hoang 09/10/2020 Restore cpp code besides Impl.h code.
28+
1.0.2 K Hoang 09/11/2020 Make Mutex Lock and delete more reliable and error-proof
2829
*****************************************************************************************************************************/
2930
/*
3031
Currently support

examples/AsyncDweetGet_STM32/AsyncDweetGet_STM32.ino

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,13 @@
1717
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
1818
You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
1919
20-
Version: 1.0.1
20+
Version: 1.0.2
2121
2222
Version Modified By Date Comments
2323
------- ----------- ---------- -----------
2424
1.0.0 K Hoang 14/09/2020 Initial coding to add support to STM32 using built-in Ethernet (Nucleo-144, DISCOVERY, etc).
2525
1.0.1 K Hoang 09/10/2020 Restore cpp code besides Impl.h code.
26+
1.0.2 K Hoang 09/11/2020 Make Mutex Lock and delete more reliable and error-proof
2627
*****************************************************************************************************************************/
2728

2829
/**

examples/AsyncDweetGet_STM32/defines.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,13 @@
1919
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
2020
You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
2121
22-
Version: 1.0.0
22+
Version: 1.0.2
2323
2424
Version Modified By Date Comments
2525
------- ----------- ---------- -----------
2626
1.0.0 K Hoang 14/09/2020 Initial coding to add support to STM32 using built-in Ethernet (Nucleo-144, DISCOVERY, etc).
27+
1.0.1 K Hoang 09/10/2020 Restore cpp code besides Impl.h code.
28+
1.0.2 K Hoang 09/11/2020 Make Mutex Lock and delete more reliable and error-proof
2729
*****************************************************************************************************************************/
2830
/*
2931
Currently support

examples/AsyncDweetPost_STM32/AsyncDweetPost_STM32.ino

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,13 @@
1717
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
1818
You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
1919
20-
Version: 1.0.1
20+
Version: 1.0.2
2121
2222
Version Modified By Date Comments
2323
------- ----------- ---------- -----------
2424
1.0.0 K Hoang 14/09/2020 Initial coding to add support to STM32 using built-in Ethernet (Nucleo-144, DISCOVERY, etc).
2525
1.0.1 K Hoang 09/10/2020 Restore cpp code besides Impl.h code.
26+
1.0.2 K Hoang 09/11/2020 Make Mutex Lock and delete more reliable and error-proof
2627
*****************************************************************************************************************************/
2728

2829
// Dweet.io POST client. Connects to dweet.io once every ten seconds, sends a POST request and a request body.

examples/AsyncDweetPost_STM32/defines.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,13 @@
1919
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
2020
You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
2121
22-
Version: 1.0.0
22+
Version: 1.0.2
2323
2424
Version Modified By Date Comments
2525
------- ----------- ---------- -----------
2626
1.0.0 K Hoang 14/09/2020 Initial coding to add support to STM32 using built-in Ethernet (Nucleo-144, DISCOVERY, etc).
27+
1.0.1 K Hoang 09/10/2020 Restore cpp code besides Impl.h code.
28+
1.0.2 K Hoang 09/11/2020 Make Mutex Lock and delete more reliable and error-proof
2729
*****************************************************************************************************************************/
2830
/*
2931
Currently support

examples/AsyncHTTPRequest_ESP/AsyncHTTPRequest_ESP.ino

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,13 @@
1717
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
1818
You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
1919
20-
Version: 1.0.1
20+
Version: 1.0.2
2121
2222
Version Modified By Date Comments
2323
------- ----------- ---------- -----------
2424
1.0.0 K Hoang 14/09/2020 Initial coding to add support to STM32 using built-in Ethernet (Nucleo-144, DISCOVERY, etc).
2525
1.0.1 K Hoang 09/10/2020 Restore cpp code besides Impl.h code.
26+
1.0.2 K Hoang 09/11/2020 Make Mutex Lock and delete more reliable and error-proof
2627
*****************************************************************************************************************************/
2728
//************************************************************************************************************
2829
//
@@ -56,7 +57,7 @@
5657
#define _ASYNC_HTTP_LOGLEVEL_ 1
5758

5859
// 300s = 5 minutes to not flooding
59-
#define HTTP_REQUEST_INTERVAL 300
60+
#define HTTP_REQUEST_INTERVAL 30 //300
6061

6162
// 10s
6263
#define HEARTBEAT_INTERVAL 10
@@ -77,6 +78,7 @@ const char* password = "your_pass";
7778

7879
AsyncHTTPRequest request;
7980
Ticker ticker;
81+
Ticker ticker1;
8082

8183
void heartBeatPrint(void)
8284
{
@@ -106,6 +108,10 @@ void sendRequest()
106108
request.open("GET", "http://worldtimeapi.org/api/timezone/America/Toronto.txt");
107109
request.send();
108110
}
111+
else
112+
{
113+
Serial.println("Can't send request");
114+
}
109115
}
110116

111117
void requestCB(void* optParm, AsyncHTTPRequest* request, int readyState)
@@ -130,13 +136,6 @@ void setup()
130136

131137
WiFi.mode(WIFI_STA);
132138

133-
if (WiFi.status() == WL_NO_SHIELD)
134-
{
135-
Serial.println(F("WiFi shield not present"));
136-
// don't continue
137-
while (true);
138-
}
139-
140139
WiFi.begin(ssid, password);
141140

142141
Serial.println("Connecting to WiFi SSID: " + String(ssid));
@@ -155,7 +154,7 @@ void setup()
155154
request.onReadyStateChange(requestCB);
156155
ticker.attach(HTTP_REQUEST_INTERVAL, sendRequest);
157156

158-
ticker.attach(HEARTBEAT_INTERVAL, heartBeatPrint);
157+
ticker1.attach(HEARTBEAT_INTERVAL, heartBeatPrint);
159158

160159
// Send first request now
161160
sendRequest();

examples/AsyncHTTPRequest_ESP_WiFiManager/AsyncHTTPRequest_ESP_WiFiManager.ino

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,13 @@
1717
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
1818
You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
1919
20-
Version: 1.0.1
20+
Version: 1.0.2
2121
2222
Version Modified By Date Comments
2323
------- ----------- ---------- -----------
2424
1.0.0 K Hoang 14/09/2020 Initial coding to add support to STM32 using built-in Ethernet (Nucleo-144, DISCOVERY, etc).
2525
1.0.1 K Hoang 09/10/2020 Restore cpp code besides Impl.h code.
26+
1.0.2 K Hoang 09/11/2020 Make Mutex Lock and delete more reliable and error-proof
2627
*****************************************************************************************************************************/
2728
//************************************************************************************************************
2829
//
@@ -55,8 +56,8 @@
5556
#define ASYNC_HTTP_DEBUG_PORT Serial
5657
#define _ASYNC_HTTP_LOGLEVEL_ 1
5758

58-
// 300s = 5 minutes to not flooding
59-
#define HTTP_REQUEST_INTERVAL 300
59+
// 300s = 5 minutes to not flooding, 10s in testing
60+
#define HTTP_REQUEST_INTERVAL 10 //300
6061

6162
//Ported to ESP32
6263
#ifdef ESP32

0 commit comments

Comments
 (0)