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

Commit 751a4be

Browse files
authored
v1.6.1 for connectMultiWiFi params
### Releases v1.6.1 1. Add configurable connectMultiWiFi parameters. Check [Minimize blocking during multi-wifi reconnect #6](#6) 2. Update ESP8266_CORE_VERSION for ESP8266 core v3.0.1+
1 parent 67955de commit 751a4be

9 files changed

+128
-72
lines changed

CONTRIBUTING.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ If you don't find anything, please [open a new issue](https://github.com/khoih-p
1414

1515
Please ensure to specify the following:
1616

17-
* Arduino IDE version (e.g. 1.8.13) or Platform.io version
18-
* `ESP8266` or `ESP32` Core Version (e.g. ESP8266 core v3.0.0 or ESP32 v1.0.6)
17+
* Arduino IDE version (e.g. 1.8.15) or Platform.io version
18+
* `ESP8266` or `ESP32` Core Version (e.g. ESP8266 core v3.0.1 or ESP32 v1.0.6)
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: v1.8.13
30-
ESP8266 Core Version v3.0.0
29+
Arduino IDE version: v1.8.15
30+
ESP8266 Core Version v3.0.1
3131
OS: Ubuntu 20.04 LTS
32-
Linux Inspiron 5.4.0-73-generic #82-Ubuntu SMP Wed Apr 14 17:39:42 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
32+
Linux Inspiron 5.4.0-77-generic #86-Ubuntu SMP Thu Jun 17 02:35:03 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
3333
3434
Context:
3535
The board couldn't autoreconnect to Local Blynk Server after router power recycling.

README.md

+49-35
Large diffs are not rendered by default.

library.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "Blynk_Async_WM",
3-
"version": "1.6.0",
4-
"description": "Library, using AsyncWebServer instead of (ESP8266)WebServer, for configuring/auto(re)connecting ESP32 (including ESP32-S2 and ESP32-C3), ESP8266 modules to best or available MultiWiFi APs and MultiBlynk servers at runtime. Enable adding dynamic custom parameters from sketch and input using the same Config Portal (CP). CP will be auto-adjusted to match the number of dynamic parameters. Optional default Credentials to be autoloaded into CP to use or change instead of manually input. Static STA IP and DHCP Hostname as well as Config Portal AP channel, IP, SSID, Password can be configured. Config. Data saved in ESP8266/ESP32 LittleFS, SPIFFS or EEPROM. Multi, Double DetectDetector or Virtual CP Switch feature permits entering CP as requested. Configurable Customs HTML Headers, including Customs Style, Customs Head Elements, CORS Header. Now with scanning of WiFi networks for selection in Configuration Portal and working with new ESP8266 core v3.0.0 and ESP32 core v1.0.6",
3+
"version": "1.6.1",
4+
"description": "Library, using AsyncWebServer instead of (ESP8266)WebServer, for configuring/auto(re)connecting ESP32 (including ESP32-S2 and ESP32-C3), ESP8266 modules to best or available MultiWiFi APs and MultiBlynk servers at runtime. Enable adding dynamic custom parameters from sketch and input using the same Config Portal (CP). CP will be auto-adjusted to match the number of dynamic parameters. Optional default Credentials to be autoloaded into CP to use or change instead of manually input. Static STA IP and DHCP Hostname as well as Config Portal AP channel, IP, SSID, Password can be configured. Config. Data saved in ESP8266/ESP32 LittleFS, SPIFFS or EEPROM. Multi, Double DetectDetector or Virtual CP Switch feature permits entering CP as requested. Configurable Customs HTML Headers, including Customs Style, Customs Head Elements, CORS Header. Now with scanning of WiFi networks for selection in Configuration Portal and working with new ESP8266 core v3.0.1 and ESP32 core v1.0.6",
55
"keywords": "control, device, communication, blynk, iot, wifi, esp8266, esp32, esp32-s2, esp32-c3, async, drd, mrd, double-reset, multi-reset, config-portal, credentials, dynamic-params, customs-header, smartphone, mobile, app, web, cloud, sensors, m2m, protocol, ble, bluetooth, Manager, DynamicParameters, dynamic, configportal, usb, serial, ethernet, data, http, portal ",
66
"authors":
77
{

library.properties

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
name=Blynk_Async_WM
2-
version=1.6.0
2+
version=1.6.1
33
author=Khoi Hoang
44
license=MIT
55
maintainer=Khoi Hoang <[email protected]>
6-
sentence=Simple Async WiFiManager for Blynk and ESP32 (including ESP32-S2, ESP32-C3), ESP8266 with or without SSL, configuration data saved in either LittleFS, SPIFFS or EEPROM. Now working with new ESP8266 core v3.0.0 and ESP32 core v1.0.6
6+
sentence=Simple Async WiFiManager for Blynk and ESP32 (including ESP32-S2, ESP32-C3), ESP8266 with or without SSL, configuration data saved in either LittleFS, SPIFFS or EEPROM. Now working with new ESP8266 core v3.0.1 and ESP32 core v1.0.6
77
paragraph=Library, using AsyncWebServer instead of (ESP8266)WebServer, for configuring/auto(re)connecting ESP32 (including ESP32-S2, ESP32-C3), ESP8266 modules to best or available MultiWiFi APs and MultiBlynk servers at runtime. Enable adding dynamic custom parameters from sketch and input using the same Config Portal (CP). CP will be auto-adjusted to match the number of dynamic parameters. Optional default Credentials to be autoloaded into CP to use or change instead of manually input. Static STA IP and DHCP Hostname as well as Config Portal AP channel, IP, SSID, Password can be configured. Config. Data saved in ESP8266/ESP32 LittleFS, SPIFFS or EEPROM. Multi, Double DetectDetector or Virtual CP Switch feature permits entering CP as requested. Configurable Customs HTML Headers, including Customs Style, Customs Head Elements, CORS Header. Now with scanning of WiFi networks for selection in Configuration Portal.
88
category=Communication
99
url=https://github.com/khoih-prog/Blynk_Async_WM

platformio/platformio.ini

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ board = nodemcuv2
9898

9999
[env:ESP32]
100100
platform = espressif32
101-
framework = arduino
101+
framework = arduino, espidf
102102
; ============================================================
103103
; Board configuration
104104
; choose your board by uncommenting one of the following lines

src/BlynkSimpleEsp32_Async_WM.h

+13-6
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
@date Jan 2015
1818
@brief
1919
20-
Version: 1.6.0
20+
Version: 1.6.1
2121
2222
Version Modified By Date Comments
2323
------- ----------- ---------- -----------
@@ -34,6 +34,7 @@
3434
1.4.1 K Hoang 24/04/2021 Fix issue of custom Blynk port (different from 8080 or 9443) not working on ESP32
3535
1.5.0 K Hoang 25/04/2021 Enable scan of WiFi networks for selection in Configuration Portal
3636
1.6.0 K Hoang 19/05/2021 Fix AP connect and SSL issues caused by breaking ESP8266 core v3.0.0
37+
1.6.1 K Hoang 15/07/2021 Add configurable connectMultiWiFi parameters. Update for ESP8266 core v3.0.1
3738
********************************************************************************************************************************/
3839

3940
#pragma once
@@ -45,7 +46,7 @@
4546
#error This code is intended to run on the ESP32 platform! Please check your Tools->Board setting.
4647
#endif
4748

48-
#define BLYNK_ASYNC_WM_VERSION "Blynk_Async_WM for ESP32 v1.6.0"
49+
#define BLYNK_ASYNC_WM_VERSION "Blynk_Async_WM for ESP32 v1.6.1"
4950

5051
//////////////////////////////////////////////
5152
// From v1.6.0 to display correct BLYNK_INFO_DEVICE
@@ -2224,11 +2225,17 @@ class BlynkWifi
22242225

22252226
//////////////////////////////////////
22262227

2228+
#ifndef WIFI_MULTI_CONNECT_WAITING_MS
2229+
// For ESP32, this better be 2000 to enable connect the 1st time
2230+
#define WIFI_MULTI_CONNECT_WAITING_MS 2000L
2231+
#endif
2232+
2233+
#ifndef WIFI_MULTI_CONNECT_WAITING_TIMES
2234+
#define WIFI_MULTI_CONNECT_WAITING_TIMES 10
2235+
#endif
2236+
22272237
uint8_t connectMultiWiFi()
22282238
{
2229-
// For ESP32, this better be 2000 to enable connect the 1st time
2230-
#define WIFI_MULTI_CONNECT_WAITING_MS 2000L
2231-
22322239
uint8_t status;
22332240
BLYNK_LOG1(BLYNK_F("Connecting MultiWifi..."));
22342241

@@ -2240,7 +2247,7 @@ class BlynkWifi
22402247
status = wifiMulti.run();
22412248
delay(WIFI_MULTI_CONNECT_WAITING_MS);
22422249

2243-
while ( ( i++ < 10 ) && ( status != WL_CONNECTED ) )
2250+
while ( ( i++ < WIFI_MULTI_CONNECT_WAITING_TIMES ) && ( status != WL_CONNECTED ) )
22442251
{
22452252
status = wifiMulti.run();
22462253

src/BlynkSimpleEsp32_SSL_Async_WM.h

+13-6
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
@date Jan 2015
1818
@brief
1919
20-
Version: 1.6.0
20+
Version: 1.6.1
2121
2222
Version Modified By Date Comments
2323
------- ----------- ---------- -----------
@@ -34,6 +34,7 @@
3434
1.4.1 K Hoang 24/04/2021 Fix issue of custom Blynk port (different from 8080 or 9443) not working on ESP32
3535
1.5.0 K Hoang 25/04/2021 Enable scan of WiFi networks for selection in Configuration Portal
3636
1.6.0 K Hoang 19/05/2021 Fix AP connect and SSL issues caused by breaking ESP8266 core v3.0.0
37+
1.6.1 K Hoang 15/07/2021 Add configurable connectMultiWiFi parameters. Update for ESP8266 core v3.0.1
3738
********************************************************************************************************************************/
3839

3940
#pragma once
@@ -45,7 +46,7 @@
4546
#error This code is intended to run on the ESP32 platform! Please check your Tools->Board setting.
4647
#endif
4748

48-
#define BLYNK_ASYNC_WM_VERSION "Blynk_Async_WM SSL for ESP32 v1.6.0"
49+
#define BLYNK_ASYNC_WM_VERSION "Blynk_Async_WM SSL for ESP32 v1.6.1"
4950

5051
//////////////////////////////////////////////
5152
// From v1.6.0 to display correct BLYNK_INFO_DEVICE
@@ -2297,11 +2298,17 @@ class BlynkWifi
22972298

22982299
//////////////////////////////////////
22992300

2301+
#ifndef WIFI_MULTI_CONNECT_WAITING_MS
2302+
// For ESP32, this better be 2000 to enable connect the 1st time
2303+
#define WIFI_MULTI_CONNECT_WAITING_MS 2000L
2304+
#endif
2305+
2306+
#ifndef WIFI_MULTI_CONNECT_WAITING_TIMES
2307+
#define WIFI_MULTI_CONNECT_WAITING_TIMES 10
2308+
#endif
2309+
23002310
uint8_t connectMultiWiFi()
23012311
{
2302-
// For ESP32, this better be 2000 to enable connect the 1st time
2303-
#define WIFI_MULTI_CONNECT_WAITING_MS 2000L
2304-
23052312
uint8_t status;
23062313
BLYNK_LOG1(BLYNK_F("Connecting MultiWifi..."));
23072314

@@ -2313,7 +2320,7 @@ class BlynkWifi
23132320
status = wifiMulti.run();
23142321
delay(WIFI_MULTI_CONNECT_WAITING_MS);
23152322

2316-
while ( ( i++ < 10 ) && ( status != WL_CONNECTED ) )
2323+
while ( ( i++ < WIFI_MULTI_CONNECT_WAITING_TIMES ) && ( status != WL_CONNECTED ) )
23172324
{
23182325
status = wifiMulti.run();
23192326

src/BlynkSimpleEsp8266_Async_WM.h

+22-8
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
@date Jan 2015
1818
@brief
1919
20-
Version: 1.6.0
20+
Version: 1.6.1
2121
2222
Version Modified By Date Comments
2323
------- ----------- ---------- -----------
@@ -34,6 +34,7 @@
3434
1.4.1 K Hoang 24/04/2021 Fix issue of custom Blynk port (different from 8080 or 9443) not working on ESP32
3535
1.5.0 K Hoang 25/04/2021 Enable scan of WiFi networks for selection in Configuration Portal
3636
1.6.0 K Hoang 19/05/2021 Fix AP connect and SSL issues caused by breaking ESP8266 core v3.0.0
37+
1.6.1 K Hoang 15/07/2021 Add configurable connectMultiWiFi parameters. Update for ESP8266 core v3.0.1
3738
********************************************************************************************************************************/
3839

3940
#pragma once
@@ -45,13 +46,16 @@
4546
#error This code is intended to run on the ESP8266 platform! Please check your Tools->Board setting.
4647
#endif
4748

48-
#define BLYNK_ASYNC_WM_VERSION "Blynk_Async_WM for ESP8266 v1.6.0"
49+
#define BLYNK_ASYNC_WM_VERSION "Blynk_Async_WM for ESP8266 v1.6.1"
4950

5051
#include <version.h>
5152

5253
/////////////////////////////////////////////
5354

54-
#if (ARDUINO_ESP8266_GIT_VER == 0xefb0341a)
55+
#if (ARDUINO_ESP8266_GIT_VER == 0xcbf44fb3)
56+
#define USING_ESP8266_CORE_VERSION 30001
57+
#define ESP8266_CORE_VERSION "ESP8266 core v3.0.1"
58+
#elif (ARDUINO_ESP8266_GIT_VER == 0xefb0341a)
5559
#define USING_ESP8266_CORE_VERSION 30000
5660
#define ESP8266_CORE_VERSION "ESP8266 core v3.0.0"
5761
#warning USING_ESP8266_CORE_VERSION "3.0.0"
@@ -99,6 +103,10 @@
99103
#define USING_ESP8266_CORE_VERSION 0
100104
#define ESP8266_CORE_VERSION "ESP8266 core too old"
101105
#warning USING_ESP8266_CORE_VERSION "0.0.0"
106+
#else
107+
#define USING_ESP8266_CORE_VERSION 80808
108+
#define ESP8266_CORE_VERSION "ESP8266 core too new"
109+
#warning USING_ESP8266_CORE_VERSION "8.8.8"
102110
#endif
103111

104112
//////////////////////////////////////////////
@@ -2252,12 +2260,18 @@ class BlynkWifi
22522260
}
22532261

22542262
//////////////////////////////////////
2263+
2264+
#ifndef WIFI_MULTI_CONNECT_WAITING_MS
2265+
// For ESP8266, this better be 3000 to enable connect the 1st time
2266+
#define WIFI_MULTI_CONNECT_WAITING_MS 3000L
2267+
#endif
22552268

2269+
#ifndef WIFI_MULTI_CONNECT_WAITING_TIMES
2270+
#define WIFI_MULTI_CONNECT_WAITING_TIMES 10
2271+
#endif
2272+
22562273
uint8_t connectMultiWiFi()
2257-
{
2258-
// For ESP8266, this better be 3000 to enable connect the 1st time
2259-
#define WIFI_MULTI_CONNECT_WAITING_MS 3000L
2260-
2274+
{
22612275
uint8_t status;
22622276
BLYNK_LOG1(BLYNK_F("Connecting MultiWifi..."));
22632277

@@ -2269,7 +2283,7 @@ class BlynkWifi
22692283
status = wifiMulti.run();
22702284
delay(WIFI_MULTI_CONNECT_WAITING_MS);
22712285

2272-
while ( ( i++ < 10 ) && ( status != WL_CONNECTED ) )
2286+
while ( ( i++ < WIFI_MULTI_CONNECT_WAITING_TIMES ) && ( status != WL_CONNECTED ) )
22732287
{
22742288
status = wifiMulti.run();
22752289

src/BlynkSimpleEsp8266_SSL_Async_WM.h

+21-7
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
@date Jan 2015
1818
@brief
1919
20-
Version: 1.6.0
20+
Version: 1.6.1
2121
2222
Version Modified By Date Comments
2323
------- ----------- ---------- -----------
@@ -34,6 +34,7 @@
3434
1.4.1 K Hoang 24/04/2021 Fix issue of custom Blynk port (different from 8080 or 9443) not working on ESP32
3535
1.5.0 K Hoang 25/04/2021 Enable scan of WiFi networks for selection in Configuration Portal
3636
1.6.0 K Hoang 19/05/2021 Fix AP connect and SSL issues caused by breaking ESP8266 core v3.0.0
37+
1.6.1 K Hoang 15/07/2021 Add configurable connectMultiWiFi parameters. Update for ESP8266 core v3.0.1
3738
********************************************************************************************************************************/
3839

3940
#pragma once
@@ -45,13 +46,16 @@
4546
#error This code is intended to run on the ESP8266 platform! Please check your Tools->Board setting.
4647
#endif
4748

48-
#define BLYNK_ASYNC_WM_VERSION "Blynk_Async_WM SSL for ESP8266 v1.6.0"
49+
#define BLYNK_ASYNC_WM_VERSION "Blynk_Async_WM SSL for ESP8266 v1.6.1"
4950

5051
#include <version.h>
5152

5253
/////////////////////////////////////////////
5354

54-
#if (ARDUINO_ESP8266_GIT_VER == 0xefb0341a)
55+
#if (ARDUINO_ESP8266_GIT_VER == 0xcbf44fb3)
56+
#define USING_ESP8266_CORE_VERSION 30001
57+
#define ESP8266_CORE_VERSION "ESP8266 core v3.0.1"
58+
#elif (ARDUINO_ESP8266_GIT_VER == 0xefb0341a)
5559
#define USING_ESP8266_CORE_VERSION 30000
5660
#define ESP8266_CORE_VERSION "ESP8266 core v3.0.0"
5761
#warning USING_ESP8266_CORE_VERSION "3.0.0"
@@ -99,6 +103,10 @@
99103
#define USING_ESP8266_CORE_VERSION 0
100104
#define ESP8266_CORE_VERSION "ESP8266 core too old"
101105
#warning USING_ESP8266_CORE_VERSION "0.0.0"
106+
#else
107+
#define USING_ESP8266_CORE_VERSION 80808
108+
#define ESP8266_CORE_VERSION "ESP8266 core too new"
109+
#warning USING_ESP8266_CORE_VERSION "8.8.8"
102110
#endif
103111

104112
//////////////////////////////////////////////
@@ -2382,11 +2390,17 @@ class BlynkWifi
23822390

23832391
//////////////////////////////////////
23842392

2393+
#ifndef WIFI_MULTI_CONNECT_WAITING_MS
2394+
// For ESP8266, this better be 3000 to enable connect the 1st time
2395+
#define WIFI_MULTI_CONNECT_WAITING_MS 3000L
2396+
#endif
2397+
2398+
#ifndef WIFI_MULTI_CONNECT_WAITING_TIMES
2399+
#define WIFI_MULTI_CONNECT_WAITING_TIMES 10
2400+
#endif
2401+
23852402
uint8_t connectMultiWiFi()
23862403
{
2387-
// For ESP8266, this better be 3000 to enable connect the 1st time
2388-
#define WIFI_MULTI_CONNECT_WAITING_MS 3000L
2389-
23902404
uint8_t status;
23912405
BLYNK_LOG1(BLYNK_F("Connecting MultiWifi..."));
23922406

@@ -2398,7 +2412,7 @@ class BlynkWifi
23982412
status = wifiMulti.run();
23992413
delay(WIFI_MULTI_CONNECT_WAITING_MS);
24002414

2401-
while ( ( i++ < 10 ) && ( status != WL_CONNECTED ) )
2415+
while ( ( i++ < WIFI_MULTI_CONNECT_WAITING_TIMES ) && ( status != WL_CONNECTED ) )
24022416
{
24032417
status = wifiMulti.run();
24042418

0 commit comments

Comments
 (0)