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

Commit fa55285

Browse files
authored
v1.8.0 to fix bug and optimize code
### Releases v1.8.0 1. Fix long timeout if using bad `IPAddress` 2. Optimize code 3. Display only successful `responseText` in examples 4. Improve debug messages by adding functions to display error messages instead of `cryptic error number`
1 parent 79c8439 commit fa55285

11 files changed

+304
-217
lines changed

CONTRIBUTING.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ 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-
* `Teensyduino` Core Version (e.g. `Teensyduino core v1.56`)
19-
* `QNEthernet` library version (e.g. `QNEthernet v0.13.0`)
18+
* `Teensyduino` Core Version (e.g. `Teensyduino core v1.57`)
19+
* `QNEthernet` library version (e.g. `QNEthernet v0.15.0`)
2020
* Board type and relevant info
2121
* Contextual information (e.g. what you were trying to achieve)
2222
* Simplest possible steps to reproduce
@@ -29,10 +29,10 @@ Please ensure to specify the following:
2929

3030
```
3131
Arduino IDE version: 1.8.19
32-
Teensyduino core v1.56
33-
Teensy 4.1 using QNEthernet v0.13.0
32+
Teensyduino core v1.57
33+
Teensy 4.1 using QNEthernet v0.15.0
3434
OS: Ubuntu 20.04 LTS
35-
Linux xy-Inspiron-3593 5.13.0-35-generic #40~20.04.1-Ubuntu SMP Mon Mar 7 09:18:32 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
35+
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
3636
3737
Context:
3838
I encountered an endless loop while trying to connect to Local WiFi.

README.md

Lines changed: 47 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,8 @@ This library is based on, modified from:
105105
## Prerequisites
106106

107107
1. [`Arduino IDE 1.8.19+` for Arduino](https://github.com/arduino/Arduino). [![GitHub release](https://img.shields.io/github/release/arduino/Arduino.svg)](https://github.com/arduino/Arduino/releases/latest)
108-
2. [`Teensy core v1.56+`](https://www.pjrc.com/teensy/td_download.html) for Teensy 4.1
109-
3. [`QNEthernet Library version v0.13.0+`](https://github.com/ssilverman/QNEthernet) for Teensy 4.1 built-in Ethernet.
108+
2. [`Teensy core v1.57+`](https://www.pjrc.com/teensy/td_download.html) for Teensy 4.1
109+
3. [`QNEthernet Library version v0.15.0+`](https://github.com/ssilverman/QNEthernet) for Teensy 4.1 built-in Ethernet.
110110
4. [`Teensy41_AsyncTCP library v1.0.0+`](https://github.com/khoih-prog/Teensy41_AsyncTCP) to use **Teensy 4.1 using QNEthernet Library**. To install, check [![arduino-library-badge](https://www.ardu-badge.com/badge/Teensy41_AsyncTCP.svg?)](https://www.ardu-badge.com/Teensy41_AsyncTCP)
111111

112112
---
@@ -224,43 +224,43 @@ https://github.com/khoih-prog/AsyncHTTPRequest_Teensy41/blob/92e7b27f5520da53b61
224224

225225
```
226226
Start AsyncHTTPRequest on TEENSY 4.1
227-
AsyncHTTPRequest_Teensy41 v1.7.1
227+
AsyncHTTPRequest_Teensy41 v1.8.0
228228
Initialize Ethernet using DHCP => Connected! IP address:192.168.2.107
229229
230230
**************************************
231231
abbreviation: EDT
232232
client_ip: aaa.bbb.ccc.ddd
233-
datetime: 2022-03-18T14:56:13.784882-04:00
234-
day_of_week: 5
235-
day_of_year: 77
233+
datetime: 2022-09-01T22:21:28.831047-04:00
234+
day_of_week: 4
235+
day_of_year: 244
236236
dst: true
237237
dst_from: 2022-03-13T07:00:00+00:00
238238
dst_offset: 3600
239239
dst_until: 2022-11-06T06:00:00+00:00
240240
raw_offset: -18000
241241
timezone: America/Toronto
242-
unixtime: 1647629773
243-
utc_datetime: 2022-03-18T18:56:13.784882+00:00
242+
unixtime: 1662085288
243+
utc_datetime: 2022-09-02T02:21:28.831047+00:00
244244
utc_offset: -04:00
245-
week_number: 11
245+
week_number: 35
246246
**************************************
247247
248248
**************************************
249249
abbreviation: EDT
250250
client_ip: aaa.bbb.ccc.ddd
251-
datetime: 2022-03-18T14:57:13.711131-04:00
252-
day_of_week: 5
253-
day_of_year: 77
251+
datetime: 2022-09-01T22:22:28.779577-04:00
252+
day_of_week: 4
253+
day_of_year: 244
254254
dst: true
255255
dst_from: 2022-03-13T07:00:00+00:00
256256
dst_offset: 3600
257257
dst_until: 2022-11-06T06:00:00+00:00
258258
raw_offset: -18000
259259
timezone: America/Toronto
260-
unixtime: 1647629833
261-
utc_datetime: 2022-03-18T18:57:13.711131+00:00
260+
unixtime: 1662085348
261+
utc_datetime: 2022-09-02T02:22:28.779577+00:00
262262
utc_offset: -04:00
263-
week_number: 11
263+
week_number: 35
264264
**************************************
265265
```
266266

@@ -271,47 +271,47 @@ week_number: 11
271271

272272
```
273273
Start AsyncCustomHeader on TEENSY 4.1
274-
AsyncHTTPRequest_Teensy41 v1.7.1
274+
AsyncHTTPRequest_Teensy41 v1.8.0
275275
Initialize Ethernet using DHCP => Connected! IP address:192.168.2.107
276276
277277
Sending GET Request to http://worldtimeapi.org/api/timezone/America/Toronto.txt
278278
279279
**************************************
280280
abbreviation: EDT
281281
client_ip: aaa.bbb.ccc.ddd
282-
datetime: 2022-03-18T15:48:07.200911-04:00
283-
day_of_week: 5
284-
day_of_year: 77
282+
datetime: 2022-09-01T22:21:28.831047-04:00
283+
day_of_week: 4
284+
day_of_year: 244
285285
dst: true
286286
dst_from: 2022-03-13T07:00:00+00:00
287287
dst_offset: 3600
288288
dst_until: 2022-11-06T06:00:00+00:00
289289
raw_offset: -18000
290290
timezone: America/Toronto
291-
unixtime: 1647632887
292-
utc_datetime: 2022-03-18T19:48:07.200911+00:00
291+
unixtime: 1662085288
292+
utc_datetime: 2022-09-02T02:21:28.831047+00:00
293293
utc_offset: -04:00
294-
week_number: 11
294+
week_number: 35
295295
**************************************
296296
297297
Sending GET Request to http://worldtimeapi.org/api/timezone/America/Toronto.txt
298298
299299
**************************************
300300
abbreviation: EDT
301301
client_ip: aaa.bbb.ccc.ddd
302-
datetime: 2022-03-18T15:48:57.186738-04:00
303-
day_of_week: 5
304-
day_of_year: 77
302+
datetime: 2022-09-01T22:22:28.779577-04:00
303+
day_of_week: 4
304+
day_of_year: 244
305305
dst: true
306306
dst_from: 2022-03-13T07:00:00+00:00
307307
dst_offset: 3600
308308
dst_until: 2022-11-06T06:00:00+00:00
309309
raw_offset: -18000
310310
timezone: America/Toronto
311-
unixtime: 1647632937
312-
utc_datetime: 2022-03-18T19:48:57.186738+00:00
311+
unixtime: 1662085348
312+
utc_datetime: 2022-09-02T02:22:28.779577+00:00
313313
utc_offset: -04:00
314-
week_number: 11
314+
week_number: 35
315315
**************************************
316316
```
317317

@@ -322,7 +322,7 @@ week_number: 11
322322

323323
```
324324
Start AsyncDweetGET on TEENSY 4.1
325-
AsyncHTTPRequest_Teensy41 v1.7.1
325+
AsyncHTTPRequest_Teensy41 v1.8.0
326326
Initialize Ethernet using DHCP => Connected! IP address:192.168.2.107
327327
328328
**************************************
@@ -339,7 +339,7 @@ Actual value: 66
339339

340340
```
341341
Start AsyncDweetPOST on TEENSY 4.1
342-
AsyncHTTPRequest_Teensy41 v1.7.1
342+
AsyncHTTPRequest_Teensy41 v1.8.0
343343
Initialize Ethernet using DHCP => Connected! IP address:192.168.2.107
344344
345345
Making new POST request
@@ -359,43 +359,43 @@ Actual value: 1007
359359

360360
```
361361
Start AsyncSimpleGET on TEENSY 4.1
362-
AsyncHTTPRequest_Teensy41 v1.7.1
362+
AsyncHTTPRequest_Teensy41 v1.8.0
363363
Initialize Ethernet using DHCP => Connected! IP address:192.168.2.107
364364
365365
**************************************
366366
abbreviation: EDT
367367
client_ip: aaa.bbb.ccc.ddd
368-
datetime: 2022-03-18T15:32:24.054049-04:00
369-
day_of_week: 5
370-
day_of_year: 77
368+
datetime: 2022-09-01T22:21:28.831047-04:00
369+
day_of_week: 4
370+
day_of_year: 244
371371
dst: true
372372
dst_from: 2022-03-13T07:00:00+00:00
373373
dst_offset: 3600
374374
dst_until: 2022-11-06T06:00:00+00:00
375375
raw_offset: -18000
376376
timezone: America/Toronto
377-
unixtime: 1647631944
378-
utc_datetime: 2022-03-18T19:32:24.054049+00:00
377+
unixtime: 1662085288
378+
utc_datetime: 2022-09-02T02:21:28.831047+00:00
379379
utc_offset: -04:00
380-
week_number: 11
380+
week_number: 35
381381
**************************************
382382
383383
**************************************
384384
abbreviation: EDT
385385
client_ip: aaa.bbb.ccc.ddd
386-
datetime: 2022-03-18T15:33:14.041502-04:00
387-
day_of_week: 5
388-
day_of_year: 77
386+
datetime: 2022-09-01T22:22:28.779577-04:00
387+
day_of_week: 4
388+
day_of_year: 244
389389
dst: true
390390
dst_from: 2022-03-13T07:00:00+00:00
391391
dst_offset: 3600
392392
dst_until: 2022-11-06T06:00:00+00:00
393393
raw_offset: -18000
394394
timezone: America/Toronto
395-
unixtime: 1647631994
396-
utc_datetime: 2022-03-18T19:33:14.041502+00:00
395+
unixtime: 1662085348
396+
utc_datetime: 2022-09-02T02:22:28.779577+00:00
397397
utc_offset: -04:00
398-
week_number: 11
398+
week_number: 35
399399
**************************************
400400
```
401401

@@ -444,6 +444,10 @@ Submit issues to: [AsyncHTTPRequest_Teensy41 issues](https://github.com/khoih-pr
444444
2. Add debugging features.
445445
3. Add PUT, PATCH, DELETE and HEAD besides GET and POST.
446446
4. Optimize library code by using `reference-passing` instead of `value-passing`
447+
5. Fix long timeout if using `IPAddress`
448+
6. Display only successful responseText in examples
449+
7. Improve debug messages by adding functions to display error messages instead of `cryptic error number`
450+
447451

448452
---
449453
---

changelog.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,21 @@
1313

1414
* [Table of contents](#table-of-contents)
1515
* [Changelog](#changelog)
16+
* [Releases v1.8.0](#releases-v180)
1617
* [Releases v1.7.1](#releases-v171)
1718

1819
---
1920
---
2021

2122
## Changelog
2223

24+
### Releases v1.8.0
25+
26+
1. Fix long timeout if using bad `IPAddress`
27+
2. Optimize code
28+
3. Display only successful responseText in examples
29+
4. Improve debug messages by adding functions to display error messages instead of `cryptic error number`
30+
2331
### Releases v1.7.1
2432

2533
1. Initial porting and coding for **Teensy 4.1 using built-in QNEthernet**

examples/AsyncHTTPRequest/AsyncHTTPRequest.ino

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,12 @@
3737

3838
#include "defines.h"
3939

40-
#define ASYNC_HTTP_REQUEST_TEENSY41_VERSION_MIN_TARGET "AsyncHTTPRequest_Teensy41 v1.7.1"
41-
#define ASYNC_HTTP_REQUEST_TEENSY41_VERSION_MIN 1007001
40+
#define ASYNC_HTTP_REQUEST_TEENSY41_VERSION_MIN_TARGET "AsyncHTTPRequest_Teensy41 v1.8.0"
41+
#define ASYNC_HTTP_REQUEST_TEENSY41_VERSION_MIN 1008000
42+
43+
// Level from 0-4
44+
#define ASYNC_HTTP_DEBUG_PORT Serial
45+
#define _ASYNC_HTTP_LOGLEVEL_ 4
4246

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

keywords.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ onData KEYWORD2
3131
available KEYWORD2
3232
responseLength KEYWORD2
3333
responseHTTPcode KEYWORD2
34+
responseHTTPString KEYWORD2
3435
responseRead KEYWORD2
3536
elapsedTime KEYWORD2
3637
version KEYWORD2

library.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name":"AsyncHTTPRequest_Teensy41",
3-
"version": "1.7.1",
3+
"version": "1.8.0",
44
"description":"Simple Async HTTP Request library, supporting GET, POST, PUT, PATCH, DELETE and HEAD, on top of Teensy41_AsyncTCP for Teensy 4.1 using QNEthernet. This library is one of the current or future Async libraries to support Teensy 4.1 using QNEthernet, such as AsyncHTTPRequest_Generic, AsyncHTTPSRequest_Generic, AsyncMQTT_Generic, Teensy41_AsyncWebServer, Teensy41_AsyncUDP, Teensy41_AsyncDNSServer, AsyncHTTPRequest_Teensy41_SSL, etc.",
55
"keywords":"communication, async, tcp, http, async-tcp, async-http, teensy, teensy41, teensy-41, qnethernet, lwip",
66
"authors": [

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=AsyncHTTPRequest_Teensy41
2-
version=1.7.1
2+
version=1.8.0
33
author=Bob Lemaire, Khoi Hoang <[email protected]>
44
maintainer=Khoi Hoang <[email protected]>
55
sentence=Simple Async HTTP Request library, supporting GET, POST, PUT, PATCH, DELETE and HEAD, on top of Teensy41_AsyncTCP for Teensy 4.1 using QNEthernet.

src/AsyncHTTPRequest_Teensy41.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,16 @@
1717
as published bythe Free Software Foundation, either version 3 of the License, or (at your option) any later version.
1818
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
1919
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
20-
You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
20+
You should have received a copy of the GNU General Public License along with this program.
21+
If not, see <https://www.gnu.org/licenses/>.
2122
22-
Version: 1.7.1
23+
Version: 1.8.0
2324
2425
Version Modified By Date Comments
2526
------- ----------- ---------- -----------
2627
1.7.1 K Hoang 18/03/2022 Initial coding for Teensy 4.1 using built-in QNEthernet.
2728
Bump up version to v1.7.1 to sync with AsyncHTTPRequest_Generic v1.7.1
29+
1.9.0 K Hoang 01/09/2022 Fix bug. Improve debug messages. Optimize code
2830
*****************************************************************************************************************************/
2931

3032
#pragma once

0 commit comments

Comments
 (0)