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

Commit cb4b4b8

Browse files
authored
v1.1.0 to fix bug
### Releases v1.1.0 1. Fix duplication bug when using `src_h` 2. Enable coexistence with AsyncTCP
1 parent bcc3f7e commit cb4b4b8

19 files changed

+547
-97
lines changed

README.md

Lines changed: 180 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,20 @@
2222
* [Use Arduino Library Manager](#use-arduino-library-manager)
2323
* [Manual Install](#manual-install)
2424
* [VS Code & PlatformIO](#vs-code--platformio)
25+
* [Note for Platform IO using ESP32 LittleFS](#note-for-platform-io-using-esp32-littlefs)
26+
* [HOWTO Fix `Multiple Definitions` Linker Error](#howto-fix-multiple-definitions-linker-error)
27+
* [Note for Platform IO using ESP32 LittleFS](#note-for-platform-io-using-esp32-littlefs)
28+
* [HOWTO Use analogRead() with ESP32 running WiFi and/or BlueTooth (BT/BLE)](#howto-use-analogread-with-esp32-running-wifi-andor-bluetooth-btble)
29+
* [1. ESP32 has 2 ADCs, named ADC1 and ADC2](#1--esp32-has-2-adcs-named-adc1-and-adc2)
30+
* [2. ESP32 ADCs functions](#2-esp32-adcs-functions)
31+
* [3. ESP32 WiFi uses ADC2 for WiFi functions](#3-esp32-wifi-uses-adc2-for-wifi-functions)
2532
* [Orignal documentation](#Orignal-documentation)
2633
* [AsyncSSLClient](#AsyncSSLClient)
2734
* [Debug Terminal Output Samples](#debug-terminal-output-samples)
2835
* [1. AsyncHTTPSRequest_ESP on ESP32_DEV](#1-AsyncHTTPSRequest_ESP-on-ESP32_DEV)
2936
* [2. AsyncHTTPSRequest_ESP on ESP32S2_DEV](#2-AsyncHTTPSRequest_ESP-on-ESP32S2_DEV)
37+
* [3. AsyncHTTPSRequest_ESP on ESP32C3_DEV](#3-AsyncHTTPSRequest_ESP-on-ESP32C3_DEV)
38+
* [4. AsyncHTTPSRequest_ESP_WiFiManager on ESP32_DEV](#4-AsyncHTTPSRequest_ESP_WiFiManager-on-ESP32_DEV)
3039
* [Debug](#debug)
3140
* [Troubleshooting](#troubleshooting)
3241
* [Issues](#issues)
@@ -114,6 +123,105 @@ Another way to install is to:
114123
---
115124

116125

126+
### Note for Platform IO using ESP32 LittleFS
127+
128+
In Platform IO, to fix the error when using [`LittleFS_esp32 v1.0`](https://github.com/lorol/LITTLEFS) for ESP32-based boards with ESP32 core v1.0.4- (ESP-IDF v3.2-), uncomment the following line
129+
130+
from
131+
132+
```
133+
//#define CONFIG_LITTLEFS_FOR_IDF_3_2 /* For old IDF - like in release 1.0.4 */
134+
```
135+
136+
to
137+
138+
```
139+
#define CONFIG_LITTLEFS_FOR_IDF_3_2 /* For old IDF - like in release 1.0.4 */
140+
```
141+
142+
It's advisable to use the latest [`LittleFS_esp32 v1.0.5+`](https://github.com/lorol/LITTLEFS) to avoid the issue.
143+
144+
Thanks to [Roshan](https://github.com/solroshan) to report the issue in [Error esp_littlefs.c 'utime_p'](https://github.com/khoih-prog/ESPAsync_WiFiManager/issues/28)
145+
146+
---
147+
---
148+
149+
### HOWTO Fix `Multiple Definitions` Linker Error
150+
151+
The current library implementation, using xyz-Impl.h instead of standard xyz.cpp, possibly creates certain `Multiple Definitions` Linker error in certain use cases. Although it's simple to just modify several lines of code, either in the library or in the application, the library is adding a separate source directory, named src_cpp, besides the standard src directory.
152+
153+
To use the old standard cpp way, just
154+
155+
1. **Rename the h-only src directory into src_h.**
156+
2. **Then rename the cpp src_cpp directory into src.**
157+
3. Close then reopen the application code in Arduino IDE, etc. to recompile from scratch.
158+
159+
---
160+
---
161+
162+
### Note for Platform IO using ESP32 LittleFS
163+
164+
In Platform IO, to fix the error when using [`LittleFS_esp32 v1.0`](https://github.com/lorol/LITTLEFS) for ESP32-based boards with ESP32 core v1.0.4- (ESP-IDF v3.2-), uncomment the following line
165+
166+
from
167+
168+
```
169+
//#define CONFIG_LITTLEFS_FOR_IDF_3_2 /* For old IDF - like in release 1.0.4 */
170+
```
171+
172+
to
173+
174+
```
175+
#define CONFIG_LITTLEFS_FOR_IDF_3_2 /* For old IDF - like in release 1.0.4 */
176+
```
177+
178+
It's advisable to use the latest [`LittleFS_esp32 v1.0.5+`](https://github.com/lorol/LITTLEFS) to avoid the issue.
179+
180+
Thanks to [Roshan](https://github.com/solroshan) to report the issue in [Error esp_littlefs.c 'utime_p'](https://github.com/khoih-prog/ESPAsync_WiFiManager/issues/28)
181+
182+
---
183+
---
184+
185+
### HOWTO Use analogRead() with ESP32 running WiFi and/or BlueTooth (BT/BLE)
186+
187+
Please have a look at [**ESP_WiFiManager Issue 39: Not able to read analog port when using the autoconnect example**](https://github.com/khoih-prog/ESP_WiFiManager/issues/39) to have more detailed description and solution of the issue.
188+
189+
#### 1. ESP32 has 2 ADCs, named ADC1 and ADC2
190+
191+
#### 2. ESP32 ADCs functions
192+
193+
- ADC1 controls ADC function for pins **GPIO32-GPIO39**
194+
- ADC2 controls ADC function for pins **GPIO0, 2, 4, 12-15, 25-27**
195+
196+
#### 3.. ESP32 WiFi uses ADC2 for WiFi functions
197+
198+
Look in file [**adc_common.c**](https://github.com/espressif/esp-idf/blob/master/components/driver/adc_common.c#L61)
199+
200+
> In ADC2, there're two locks used for different cases:
201+
> 1. lock shared with app and Wi-Fi:
202+
> ESP32:
203+
> When Wi-Fi using the ADC2, we assume it will never stop, so app checks the lock and returns immediately if failed.
204+
> ESP32S2:
205+
> The controller's control over the ADC is determined by the arbiter. There is no need to control by lock.
206+
>
207+
> 2. lock shared between tasks:
208+
> when several tasks sharing the ADC2, we want to guarantee
209+
> all the requests will be handled.
210+
> Since conversions are short (about 31us), app returns the lock very soon,
211+
> we use a spinlock to stand there waiting to do conversions one by one.
212+
>
213+
> adc2_spinlock should be acquired first, then adc2_wifi_lock or rtc_spinlock.
214+
215+
216+
- In order to use ADC2 for other functions, we have to **acquire complicated firmware locks and very difficult to do**
217+
- So, it's not advisable to use ADC2 with WiFi/BlueTooth (BT/BLE).
218+
- Use ADC1, and pins GPIO32-GPIO39
219+
- If somehow it's a must to use those pins serviced by ADC2 (**GPIO0, 2, 4, 12, 13, 14, 15, 25, 26 and 27**), use the **fix mentioned at the end** of [**ESP_WiFiManager Issue 39: Not able to read analog port when using the autoconnect example**](https://github.com/khoih-prog/ESP_WiFiManager/issues/39) to work with ESP32 WiFi/BlueTooth (BT/BLE).
220+
221+
---
222+
---
223+
224+
117225
## Orignal documentation
118226

119227
For ESP32, check [AsyncTCP Library](https://github.com/me-no-dev/AsyncTCP)
@@ -132,11 +240,11 @@ The base classes on which everything else is built. They expose all possible sce
132240

133241
#### 1. AsyncHTTPSRequest_ESP on ESP32_DEV
134242

135-
Following is the debug terminal when running example [AsyncHTTPSRequest_ESP](https://github.com/khoih-prog/AsyncHTTPSRequest_Generic/tree/main/examples/AsyncHTTPSRequest_ESP) on ESP32_DEV to demonstrate the operation of SSL Async HTTPS request, based on this [AsyncTCP_SSL Library](https://github.com/khoih-prog/AsyncTCP_SSL).
243+
Following is the debug terminal when running example [AsyncHTTPSRequest_ESP](https://github.com/khoih-prog/AsyncHTTPSRequest_Generic/tree/main/examples/AsyncHTTPSRequest_ESP) on ESP32_DEV to demonstrate the operation of SSL Async HTTPS request, using [AsyncTCP_SSL Library](https://github.com/khoih-prog/AsyncTCP_SSL).
136244

137245
```
138246
Starting AsyncHTTPSRequest_ESP using ESP32_DEV
139-
AsyncTCP_SSL v1.0.0
247+
AsyncTCP_SSL v1.1.0
140248
AsyncHTTPSRequest_Generic v1.0.0
141249
Connecting to WiFi SSID: HueNet1
142250
.......
@@ -182,12 +290,11 @@ week_number: 42
182290

183291
#### 2. AsyncHTTPSRequest_ESP on ESP32S2_DEV
184292

185-
Following is the debug terminal when running example [AsyncHTTPSRequest_ESP](https://github.com/khoih-prog/AsyncHTTPSRequest_Generic/tree/main/examples/AsyncHTTPSRequest_ESP) on ESP32S2_DEV to demonstrate the operation of SSL Async HTTPS request, based on this [AsyncTCP_SSL Library](https://github.com/khoih-prog/AsyncTCP_SSL).
293+
Following is the debug terminal when running example [AsyncHTTPSRequest_ESP](https://github.com/khoih-prog/AsyncHTTPSRequest_Generic/tree/main/examples/AsyncHTTPSRequest_ESP) on ESP32S2_DEV to demonstrate the operation of SSL Async HTTPS request, using [AsyncTCP_SSL Library](https://github.com/khoih-prog/AsyncTCP_SSL).
186294

187295
```
188-
189296
Starting AsyncHTTPSRequest_ESP using ESP32S2_DEV
190-
AsyncTCP_SSL v1.0.0
297+
AsyncTCP_SSL v1.1.0
191298
AsyncHTTPSRequest_Generic v1.0.0
192299
Connecting to WiFi SSID: HueNet1
193300
.......
@@ -234,7 +341,75 @@ utc_datetime: 2021-10-22T03:19:43.835205+00:00
234341
utc_offset: -04:00
235342
week_number: 42
236343
**************************************
344+
```
345+
346+
---
347+
348+
#### 3. AsyncHTTPSRequest_ESP on ESP32C3_DEV
349+
350+
Following is the debug terminal when running example [AsyncHTTPSRequest_ESP](https://github.com/khoih-prog/AsyncHTTPSRequest_Generic/tree/main/examples/AsyncHTTPSRequest_ESP) on ESP32C3_DEV to demonstrate the operation of SSL Async HTTPS request, using [AsyncTCP_SSL Library](https://github.com/khoih-prog/AsyncTCP_SSL).
351+
352+
```
353+
Starting AsyncHTTPSRequest_ESP using ESP32C3_DEV
354+
AsyncTCP_SSL v1.1.0
355+
AsyncHTTPSRequest_Generic v1.0.0
356+
Connecting to WiFi SSID: HueNet1
357+
.........
358+
AsyncHTTPSRequest @ IP : 192.168.2.80
359+
360+
**************************************
361+
abbreviation: EDT
362+
client_ip: aaa.bbb.ccc.ddd
363+
datetime: 2021-10-22T02:00:44.009661-04:00
364+
day_of_week: 5
365+
day_of_year: 295
366+
dst: true
367+
dst_from: 2021-03-14T07:00:00+00:00
368+
dst_offset: 3600
369+
dst_until: 2021-11-07T06:00:00+00:00
370+
raw_offset: -18000
371+
timezone: America/Toronto
372+
unixtime: 1634882444
373+
utc_datetime: 2021-10-22T06:00:44.009661+00:00
374+
utc_offset: -04:00
375+
week_number: 42
376+
**************************************
377+
```
237378

379+
---
380+
381+
#### 4. AsyncHTTPSRequest_ESP_WiFiManager on ESP32_DEV
382+
383+
Following is the debug terminal when running example [AsyncHTTPSRequest_ESP_WiFiManager](https://github.com/khoih-prog/AsyncHTTPSRequest_Generic/tree/main/examples/AsyncHTTPSRequest_ESP_WiFiManager) on ESP32_DEV to demonstrate the operation of SSL Async HTTPS request, using [AsyncTCP_SSL Library](https://github.com/khoih-prog/AsyncTCP_SSL), and [ESPAsync_WiFiManager Library](https://github.com/khoih-prog/ESPAsync_WiFiManager)
384+
385+
```
386+
Starting AsyncHTTPSRequest_ESP_WiFiManager using LittleFS on ESP32_DEV
387+
ESPAsync_WiFiManager v1.9.4
388+
AsyncTCP_SSL v1.1.0
389+
AsyncHTTPSRequest_Generic v1.0.0
390+
Stored: SSID = HueNet1, Pass = 12345678
391+
Got stored Credentials. Timeout 120s
392+
ConnectMultiWiFi in setup
393+
After waiting 11.38 secs more in setup(), connection result is connected. Local IP: 192.168.2.232
394+
H
395+
**************************************
396+
abbreviation: EDT
397+
client_ip: 216.154.33.167
398+
datetime: 2021-10-22T02:38:12.722777-04:00
399+
day_of_week: 5
400+
day_of_year: 295
401+
dst: true
402+
dst_from: 2021-03-14T07:00:00+00:00
403+
dst_offset: 3600
404+
dst_until: 2021-11-07T06:00:00+00:00
405+
raw_offset: -18000
406+
timezone: America/Toronto
407+
unixtime: 1634884692
408+
utc_datetime: 2021-10-22T06:38:12.722777+00:00
409+
utc_offset: -04:00
410+
week_number: 42
411+
**************************************
412+
H
238413
```
239414

240415
---

changelog.md

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

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

1617
---
1718
---
1819

1920
## Changelog
2021

22+
### Releases v1.1.0
23+
24+
1. Fix duplication bug when using `src_h`
25+
2. Enable coexistence with AsyncTCP
2126

2227
### Initial Releases v1.0.0
2328

library.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name":"AsyncTCP_SSL",
3-
"version": "1.0.0",
3+
"version": "1.1.0",
44
"keywords":"communication, async, tcp, ssl, tls, mbed, free-rtos",
55
"description":"Asynchronous SSL TCP Library for ESP32. This library is the base for future and more advanced Async SSL libraries, such as AsyncSSLWebServer, AsyncHTTPSRequest",
66
"authors":

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=AsyncTCP_SSL
2-
version=1.0.0
2+
version=1.1.0
33
author=Hristo Gochkov, Maarten Fremouw, Thorsten von Eicken, Khoi Hoang
44
maintainer=Khoi Hoang <[email protected]>
55
sentence=Asynchronous SSL TCP Library for ESP32.

0 commit comments

Comments
 (0)