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

Commit 840dd20

Browse files
authored
v1.2.0 to reduce v1.1.0 breaking effect
### Releases v1.2.0 1. Reduce the breaking effect of v1.5.0 by enabling compatibility with old code to include only `Portenta_H7_AsyncHTTPRequest.h` 2. Add example [multiFileProject](examples/multiFileProject) to demo for multiple-file project 3. Update `Packages' Patches`
1 parent 94648db commit 840dd20

File tree

24 files changed

+592
-513
lines changed

24 files changed

+592
-513
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Arduino IDE version: 1.8.19
3131
`ArduinoCore-mbed` mbed_portenta core v2.6.1
3232
Portenta_H7 Rev2 ABX00042
3333
OS: Ubuntu 20.04 LTS
34-
Linux xy-Inspiron-3593 5.4.0-91-generic #102-Ubuntu SMP Fri Nov 5 16:31:28 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
34+
Linux xy-Inspiron-3593 5.4.0-96-generic #109-Ubuntu SMP Wed Jan 12 16:49:16 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
3535
3636
Context:
3737
I encountered an endless loop while trying to connect to Local WiFi.

README.md

Lines changed: 64 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
## Table of Contents
1212

13-
* [Important Breaking Change from v1.1.0](#Important-Breaking-Change-from-v110)
13+
* [Important Change from v1.2.0](#Important-Change-from-v120)
1414
* [Why do we need the new Async Portenta_H7_AsyncHTTPRequest library](#why-do-we-need-this-async-Portenta_H7_AsyncHTTPRequest-library)
1515
* [Features](#features)
1616
* [Supports](#supports)
@@ -41,6 +41,8 @@
4141
* [4. AsyncDweetPost](examples/WiFi/AsyncDweetPost)
4242
* [5. AsyncSimpleGET](examples/WiFi/AsyncSimpleGET)
4343
* [6. AsyncWebClientRepeating](examples/WiFi/AsyncWebClientRepeating)
44+
* [3. For Portenta_H7](#3-For-Portenta_H7)
45+
* [1. **multiFileProject**](examples/multiFileProject) **New**
4446
* [Example AsyncHTTPRequest](#example-asynchttprequest)
4547
* [1. File AsyncHTTPRequest.ino](#1-file-asynchttprequestino)
4648
* [2. File defines.h](#2-file-definesh)
@@ -64,25 +66,10 @@
6466
---
6567
---
6668

67-
### Important Breaking Change from v1.1.0
69+
### Important Change from v1.2.0
6870

6971
Please have a look at [HOWTO Fix `Multiple Definitions` Linker Error](#howto-fix-multiple-definitions-linker-error)
7072

71-
From v1.1.0, you must use
72-
73-
```
74-
#include <Portenta_H7_AsyncHTTPRequest.h> //https://github.com/khoih-prog/Portenta_H7_AsyncHTTPRequest
75-
76-
// To be included only in main(), .ino with setup() to avoid `Multiple Definitions` Linker Error
77-
#include <Portenta_H7_AsyncHTTPRequest_Impl.h> // https://github.com/khoih-prog/Portenta_H7_AsyncHTTPRequest
78-
```
79-
80-
instead of only
81-
82-
```
83-
#include <Portenta_H7_AsyncHTTPRequest.h> //https://github.com/khoih-prog/Portenta_H7_AsyncHTTPRequest
84-
```
85-
8673

8774
---
8875
---
@@ -139,7 +126,7 @@ This library is based on, modified from:
139126

140127
## Prerequisites
141128

142-
1. [`Arduino IDE 1.8.19+` for Arduino](https://www.arduino.cc/en/Main/Software)
129+
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)
143130
2. [`ArduinoCore-mbed mbed_portenta core 2.6.1+`](https://github.com/arduino/ArduinoCore-mbed) for Arduino **Portenta_H7** boards, such as **Portenta_H7 Rev2 ABX00042, etc.**. [![GitHub release](https://img.shields.io/github/release/arduino/ArduinoCore-mbed.svg)](https://github.com/arduino/ArduinoCore-mbed/releases/latest)
144131
3. [`Portenta_H7_AsyncTCP library v1.3.0+`](https://github.com/khoih-prog/Portenta_H7_AsyncTCP) for Portenta_H7 using `Vision-shield Ethernet` or `Murata WiFi`. [To install. check [![arduino-library-badge](https://www.ardu-badge.com/badge/Portenta_H7_AsyncTCP.svg?)](https://www.ardu-badge.com/Portenta_H7_AsyncTCP)
145132

@@ -172,12 +159,12 @@ The best and easiest way is to use `Arduino Library Manager`. Search for `Porten
172159

173160
#### 1. For Portenta_H7 boards using Arduino IDE in Linux
174161

175-
**To be able to upload firmware to Portenta_H7 using Arduino IDE in Linux (Ubuntu, etc.)**, you have to copy the file [portenta_post_install.sh](Packages_Patches/arduino/hardware/mbed_portenta/2.5.2/portenta_post_install.sh) into mbed_portenta directory (~/.arduino15/packages/arduino/hardware/mbed_portenta/2.5.2/portenta_post_install.sh).
162+
**To be able to upload firmware to Portenta_H7 using Arduino IDE in Linux (Ubuntu, etc.)**, you have to copy the file [portenta_post_install.sh](Packages_Patches/arduino/hardware/mbed_portenta/2.6.1/portenta_post_install.sh) into mbed_portenta directory (~/.arduino15/packages/arduino/hardware/mbed_portenta/2.6.1/portenta_post_install.sh).
176163

177164
Then run the following command using `sudo`
178165

179166
```
180-
$ cd ~/.arduino15/packages/arduino/hardware/mbed_portenta/2.5.2
167+
$ cd ~/.arduino15/packages/arduino/hardware/mbed_portenta/2.6.1
181168
$ chmod 755 portenta_post_install.sh
182169
$ sudo ./portenta_post_install.sh
183170
```
@@ -190,9 +177,9 @@ This will create the file `/etc/udev/rules.d/49-portenta_h7.rules` as follows:
190177
SUBSYSTEMS=="usb", ATTRS{idVendor}=="2341", ATTRS{idProduct}=="035b", GROUP="plugdev", MODE="0666"
191178
```
192179

193-
Supposing the ArduinoCore-mbed core version is 2.5.2. Now only one file must be copied into the directory:
180+
Supposing the ArduinoCore-mbed core version is 2.6.1. Now only one file must be copied into the directory:
194181

195-
- `~/.arduino15/packages/arduino/hardware/mbed_portenta/2.5.2/portenta_post_install.sh`
182+
- `~/.arduino15/packages/arduino/hardware/mbed_portenta/2.6.1/portenta_post_install.sh`
196183

197184
Whenever a new version is installed, remember to copy this files into the new version directory. For example, new version is x.yy.zz
198185

@@ -202,13 +189,13 @@ This file must be copied into the directory:
202189

203190
#### 2. To fix compile error relating to dns_gethostbyname and LwIP stack
204191

205-
**To be able to compile, run on Portenta_H7 boards**, you have to copy the whole [mbed_portenta Packages_Patches](Packages_Patches/arduino/hardware/mbed_portenta/2.5.2) directory into Arduino mbed_portenta directory (~/.arduino15/packages/arduino/hardware/mbed_portenta/2.5.2).
192+
**To be able to compile, run on Portenta_H7 boards**, you have to copy the whole [mbed_portenta Packages_Patches](Packages_Patches/arduino/hardware/mbed_portenta/2.6.1) directory into Arduino mbed_portenta directory (~/.arduino15/packages/arduino/hardware/mbed_portenta/2.6.1).
206193

207-
Supposing the Arduino mbed_portenta version is 2.5.2. These file must be copied into the directory:
194+
Supposing the Arduino mbed_portenta version is 2.6.1. These file must be copied into the directory:
208195

209-
- `~/.arduino15/packages/arduino/hardware/mbed_portenta/2.5.2/libraries/SocketWrapper/src/MbedUdp.h`
210-
- `~/.arduino15/packages/arduino/hardware/mbed_portenta/2.5.2/libraries/SocketWrapper/src/MbedUdp.cpp`
211-
- `~/.arduino15/packages/arduino/hardware/mbed_portenta/2.5.2/cores/arduino/src/mbed/connectivity/lwipstack/include/lwipstack/lwipopts.h`
196+
- `~/.arduino15/packages/arduino/hardware/mbed_portenta/2.6.1/libraries/SocketWrapper/src/MbedUdp.h`
197+
- `~/.arduino15/packages/arduino/hardware/mbed_portenta/2.6.1/libraries/SocketWrapper/src/MbedUdp.cpp`
198+
- `~/.arduino15/packages/arduino/hardware/mbed_portenta/2.6.1/cores/arduino/src/mbed/connectivity/lwipstack/include/lwipstack/lwipopts.h`
212199

213200
---
214201
---
@@ -217,19 +204,22 @@ Supposing the Arduino mbed_portenta version is 2.5.2. These file must be copied
217204

218205
The current library implementation, using `xyz-Impl.h` instead of standard `xyz.cpp`, possibly creates certain `Multiple Definitions` Linker error in certain use cases.
219206

220-
You can use
207+
You can include this `.hpp` file
221208

222209
```
223-
#include <Portenta_H7_AsyncHTTPRequest.h> //https://github.com/khoih-prog/Portenta_H7_AsyncHTTPRequest
210+
// Can be included as many times as necessary, without `Multiple Definitions` Linker Error
211+
#include "Portenta_H7_AsyncHTTPRequest.hpp" //https://github.com/khoih-prog/Portenta_H7_AsyncHTTPRequest
224212
```
225213

226-
in many files. But be sure to use the following `#include <Portenta_H7_AsyncHTTPRequest_Impl.h>` **in just 1 `.h`, `.cpp` or `.ino` file**, which must **not be included in any other file**, to avoid `Multiple Definitions` Linker Error
214+
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
227215

228216
```
229217
// To be included only in main(), .ino with setup() to avoid `Multiple Definitions` Linker Error
230-
#include <Portenta_H7_AsyncHTTPRequest_Impl.h> // https://github.com/khoih-prog/Portenta_H7_AsyncHTTPRequest
218+
#include "Portenta_H7_AsyncHTTPRequest.h" //https://github.com/khoih-prog/Portenta_H7_AsyncHTTPRequest
231219
```
232220

221+
Check the new [**multiFileProject** example](examples/multiFileProject) for a `HOWTO` demo.
222+
233223
Have a look at the discussion in [Different behaviour using the src_cpp or src_h lib #80](https://github.com/khoih-prog/ESPAsync_WiFiManager/discussions/80)
234224

235225

@@ -256,7 +246,11 @@ Have a look at the discussion in [Different behaviour using the src_cpp or src_h
256246
5. [AsyncSimpleGET](examples/WiFi/AsyncSimpleGET)
257247
6. [AsyncWebClientRepeating](examples/WiFi/AsyncWebClientRepeating)
258248

249+
#### 3. For Portenta_H7
259250

251+
1. [**multiFileProject**](examples/multiFileProject) **New**
252+
253+
260254
---
261255

262256
### Example [AsyncHTTPRequest](examples/Ethernet/AsyncHTTPRequest)
@@ -268,13 +262,11 @@ Please take a look at other examples, as well.
268262
```cpp
269263
#include "defines.h"
270264

271-
#define PORTENTA_H7_ASYNC_HTTP_REQUEST_VERSION_MIN_TARGET "Portenta_H7_AsyncHTTPRequest v1.1.0"
272-
#define PORTENTA_H7_ASYNC_HTTP_REQUEST_VERSION_MIN 1001000
273-
274-
#include <Portenta_H7_AsyncHTTPRequest.h> // https://github.com/khoih-prog/Portenta_H7_AsyncHTTPRequest
265+
#define PORTENTA_H7_ASYNC_HTTP_REQUEST_VERSION_MIN_TARGET "Portenta_H7_AsyncHTTPRequest v1.2.0"
266+
#define PORTENTA_H7_ASYNC_HTTP_REQUEST_VERSION_MIN 1002000
275267

276268
// To be included only in main(), .ino with setup() to avoid `Multiple Definitions` Linker Error
277-
#include "Portenta_H7_AsyncHTTPRequest_Impl.h" // https://github.com/khoih-prog/Portenta_H7_AsyncHTTPRequest
269+
#include <Portenta_H7_AsyncHTTPRequest.h> // https://github.com/khoih-prog/Portenta_H7_AsyncHTTPRequest
278270

279271
AsyncHTTPRequest request;
280272

@@ -461,46 +453,45 @@ byte mac[][NUMBER_OF_MAC] =
461453
```
462454
Start AsyncHTTPRequest on PORTENTA_H7_M7
463455
Portenta_H7_AsyncTCP v1.3.0
464-
Portenta_H7_AsyncHTTPRequest v1.1.0
456+
Portenta_H7_AsyncHTTPRequest v1.2.0
465457
Using mac index = 15
466458
Connected! IP address: 192.168.2.101
467459
Request sent
468-
469460
**************************************
470461
abbreviation: EST
471462
client_ip: aaa.bbb.ccc.ddd
472-
datetime: 2021-12-30T21:59:53.472764-05:00
473-
day_of_week: 4
474-
day_of_year: 364
463+
datetime: 2022-01-23T19:06:29.846071-05:00
464+
day_of_week: 0
465+
day_of_year: 23
475466
dst: false
476467
dst_from:
477468
dst_offset: 0
478469
dst_until:
479470
raw_offset: -18000
480471
timezone: America/Toronto
481-
unixtime: 1640919593
482-
utc_datetime: 2021-12-31T02:59:53.472764+00:00
472+
unixtime: 1642982789
473+
utc_datetime: 2022-01-24T00:06:29.846071+00:00
483474
utc_offset: -05:00
484-
week_number: 52
475+
week_number: 3
485476
**************************************
486477
Request sent
487478
488479
**************************************
489480
abbreviation: EST
490481
client_ip: aaa.bbb.ccc.ddd
491-
datetime: 2021-12-30T22:00:52.995098-05:00
492-
day_of_week: 4
493-
day_of_year: 364
482+
datetime: 2022-01-23T19:08:29.871390-05:00
483+
day_of_week: 0
484+
day_of_year: 23
494485
dst: false
495486
dst_from:
496487
dst_offset: 0
497488
dst_until:
498489
raw_offset: -18000
499490
timezone: America/Toronto
500-
unixtime: 1640919652
501-
utc_datetime: 2021-12-31T03:00:52.995098+00:00
491+
unixtime: 1642982909
492+
utc_datetime: 2022-01-24T00:08:29.871390+00:00
502493
utc_offset: -05:00
503-
week_number: 52
494+
week_number: 3
504495
**************************************
505496
```
506497

@@ -511,7 +502,7 @@ week_number: 52
511502
```
512503
Start AsyncDweetPOST on PORTENTA_H7_M7
513504
Portenta_H7_AsyncTCP v1.3.0
514-
Portenta_H7_AsyncHTTPRequest v1.1.0
505+
Portenta_H7_AsyncHTTPRequest v1.2.0
515506
Connecting to SSID: HueNet1
516507
SSID: HueNet1
517508
Local IP Address: 192.168.2.94
@@ -534,7 +525,7 @@ Actual value: 88
534525
```
535526
Start AsyncWebClientRepeating on PORTENTA_H7_M7
536527
Portenta_H7_AsyncTCP v1.3.0
537-
Portenta_H7_AsyncHTTPRequest v1.1.0
528+
Portenta_H7_AsyncHTTPRequest v1.2.0
538529
Connecting to SSID: HueNet1
539530
SSID: HueNet1
540531
Local IP Address: 192.168.2.94
@@ -592,7 +583,7 @@ signal strength (RSSI):-26 dBm
592583
```
593584
Start AsyncCustomHeader on PORTENTA_H7_M7
594585
Portenta_H7_AsyncTCP v1.3.0
595-
Portenta_H7_AsyncHTTPRequest v1.1.0
586+
Portenta_H7_AsyncHTTPRequest v1.2.0
596587
Using mac index = 15
597588
Connected! IP address: 192.168.2.87
598589
@@ -601,19 +592,19 @@ Sending GET Request to http://worldtimeapi.org/api/timezone/America/Toronto.txt
601592
**************************************
602593
abbreviation: EST
603594
client_ip: aaa.bbb.ccc.ddd
604-
datetime: 2021-12-30T22:03:51.798061-05:00
605-
day_of_week: 4
606-
day_of_year: 364
595+
datetime: 2022-01-23T19:08:29.871390-05:00
596+
day_of_week: 0
597+
day_of_year: 23
607598
dst: false
608599
dst_from:
609600
dst_offset: 0
610601
dst_until:
611602
raw_offset: -18000
612603
timezone: America/Toronto
613-
unixtime: 1640919831
614-
utc_datetime: 2021-12-31T03:03:51.798061+00:00
604+
unixtime: 1642982909
605+
utc_datetime: 2022-01-24T00:08:29.871390+00:00
615606
utc_offset: -05:00
616-
week_number: 52
607+
week_number: 3
617608
**************************************
618609
```
619610

@@ -625,7 +616,7 @@ week_number: 52
625616
```
626617
Start AsyncWebClientRepeating on PORTENTA_H7_M7
627618
Portenta_H7_AsyncTCP v1.3.0
628-
Portenta_H7_AsyncHTTPRequest v1.1.0
619+
Portenta_H7_AsyncHTTPRequest v1.2.0
629620
Using mac index = 16
630621
Connected! IP address: 192.168.2.87
631622
@@ -682,45 +673,44 @@ Connected! IP address: 192.168.2.87
682673
```
683674
Start AsyncSimpleGET on PORTENTA_H7_M7
684675
Portenta_H7_AsyncTCP v1.3.0
685-
Portenta_H7_AsyncHTTPRequest v1.1.0
676+
Portenta_H7_AsyncHTTPRequest v1.2.0
686677
Using mac index = 7
687678
Connected! IP address: 192.168.2.87
688679
689680
**************************************
690681
abbreviation: EST
691682
client_ip: aaa.bbb.ccc.ddd
692-
datetime: 2021-12-30T22:07:34.904535-05:00
693-
day_of_week: 4
694-
day_of_year: 364
683+
datetime: 2022-01-23T19:06:29.846071-05:00
684+
day_of_week: 0
685+
day_of_year: 23
695686
dst: false
696687
dst_from:
697688
dst_offset: 0
698689
dst_until:
699690
raw_offset: -18000
700691
timezone: America/Toronto
701-
unixtime: 1640920054
702-
utc_datetime: 2021-12-31T03:07:34.904535+00:00
692+
unixtime: 1642982789
693+
utc_datetime: 2022-01-24T00:06:29.846071+00:00
703694
utc_offset: -05:00
704-
week_number: 52
695+
week_number: 3
705696
**************************************
706697
Request sent
707-
708698
**************************************
709699
abbreviation: EST
710700
client_ip: aaa.bbb.ccc.ddd
711-
datetime: 2021-12-30T22:08:34.580278-05:00
712-
day_of_week: 4
713-
day_of_year: 364
701+
datetime: 2022-01-23T19:08:29.871390-05:00
702+
day_of_week: 0
703+
day_of_year: 23
714704
dst: false
715705
dst_from:
716706
dst_offset: 0
717707
dst_until:
718708
raw_offset: -18000
719709
timezone: America/Toronto
720-
unixtime: 1640920114
721-
utc_datetime: 2021-12-31T03:08:34.580278+00:00
710+
unixtime: 1642982909
711+
utc_datetime: 2022-01-24T00:08:29.871390+00:00
722712
utc_offset: -05:00
723-
week_number: 52
713+
week_number: 3
724714
**************************************
725715
```
726716

changelog.md

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

1313
* [Changelog](#changelog)
14+
* [Releases v1.2.0](#releases-v120)
1415
* [Releases v1.1.0](#releases-v110)
1516
* [Initial Releases v1.0.0](#Initial-Releases-v100)
1617

@@ -19,6 +20,12 @@
1920

2021
## Changelog
2122

23+
### Releases v1.2.0
24+
25+
1. Reduce the breaking effect of v1.5.0 by enabling compatibility with old code to include only `Portenta_H7_AsyncHTTPRequest.h`
26+
2. Add example [multiFileProject](examples/multiFileProject) to demo for multiple-file project
27+
3. Update `Packages' Patches`
28+
2229
### Releases v1.1.0
2330

2431
1. Fix `multiple-definitions` linker error and weird bug related to `src_cpp`. Check [Different behaviour using the src_cpp or src_h lib #80](https://github.com/khoih-prog/ESPAsync_WiFiManager/discussions/80)

examples/Ethernet/AsyncCustomHeader/AsyncCustomHeader.ino

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@
44
For Portenta_H7 (STM32H7) with Vision-Shield Ethernet or Murata WiFi
55
66
Portenta_H7_AsyncHTTPRequest is a library for the Portenta_H7 with with Vision-Shield Ethernet Ethernet or Murata WiFi
7-
8-
Portenta_H7_AsyncHTTPRequest is a library for Portenta_H7
9-
7+
108
Based on and modified from asyncHTTPrequest Library (https://github.com/boblemaire/asyncHTTPrequest)
119
1210
Built by Khoi Hoang https://github.com/khoih-prog/Portenta_H7_AsyncHTTPRequest
@@ -21,17 +19,15 @@
2119

2220
#include "defines.h"
2321

24-
#define PORTENTA_H7_ASYNC_HTTP_REQUEST_VERSION_MIN_TARGET "Portenta_H7_AsyncHTTPRequest v1.1.0"
25-
#define PORTENTA_H7_ASYNC_HTTP_REQUEST_VERSION_MIN 1001000
22+
#define PORTENTA_H7_ASYNC_HTTP_REQUEST_VERSION_MIN_TARGET "Portenta_H7_AsyncHTTPRequest v1.2.0"
23+
#define PORTENTA_H7_ASYNC_HTTP_REQUEST_VERSION_MIN 1002000
2624

2725
// Select a test server address
2826
//char GET_ServerAddress[] = "192.168.2.110/";
2927
char GET_ServerAddress[] = "http://worldtimeapi.org/api/timezone/America/Toronto.txt";
3028

31-
#include <Portenta_H7_AsyncHTTPRequest.h> // https://github.com/khoih-prog/Portenta_H7_AsyncHTTPRequest
32-
3329
// To be included only in main(), .ino with setup() to avoid `Multiple Definitions` Linker Error
34-
#include "Portenta_H7_AsyncHTTPRequest_Impl.h" // https://github.com/khoih-prog/Portenta_H7_AsyncHTTPRequest
30+
#include <Portenta_H7_AsyncHTTPRequest.h> // https://github.com/khoih-prog/Portenta_H7_AsyncHTTPRequest
3531

3632
AsyncHTTPRequest request;
3733

0 commit comments

Comments
 (0)