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

Commit

Permalink
v1.6.1 for connectMultiWiFi params
Browse files Browse the repository at this point in the history
### 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+
  • Loading branch information
khoih-prog authored Jul 15, 2021
1 parent 67955de commit 751a4be
Show file tree
Hide file tree
Showing 9 changed files with 128 additions and 72 deletions.
10 changes: 5 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ If you don't find anything, please [open a new issue](https://github.com/khoih-p

Please ensure to specify the following:

* Arduino IDE version (e.g. 1.8.13) or Platform.io version
* `ESP8266` or `ESP32` Core Version (e.g. ESP8266 core v3.0.0 or ESP32 v1.0.6)
* Arduino IDE version (e.g. 1.8.15) or Platform.io version
* `ESP8266` or `ESP32` Core Version (e.g. ESP8266 core v3.0.1 or ESP32 v1.0.6)
* Contextual information (e.g. what you were trying to achieve)
* Simplest possible steps to reproduce
* Anything that might be relevant in your opinion, such as:
Expand All @@ -26,10 +26,10 @@ Please ensure to specify the following:
### Example

```
Arduino IDE version: v1.8.13
ESP8266 Core Version v3.0.0
Arduino IDE version: v1.8.15
ESP8266 Core Version v3.0.1
OS: Ubuntu 20.04 LTS
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
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
Context:
The board couldn't autoreconnect to Local Blynk Server after router power recycling.
Expand Down
84 changes: 49 additions & 35 deletions README.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions library.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "Blynk_Async_WM",
"version": "1.6.0",
"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",
"version": "1.6.1",
"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",
"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 ",
"authors":
{
Expand Down
4 changes: 2 additions & 2 deletions library.properties
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name=Blynk_Async_WM
version=1.6.0
version=1.6.1
author=Khoi Hoang
license=MIT
maintainer=Khoi Hoang <[email protected]>
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
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
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.
category=Communication
url=https://github.com/khoih-prog/Blynk_Async_WM
Expand Down
2 changes: 1 addition & 1 deletion platformio/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ board = nodemcuv2

[env:ESP32]
platform = espressif32
framework = arduino
framework = arduino, espidf
; ============================================================
; Board configuration
; choose your board by uncommenting one of the following lines
Expand Down
19 changes: 13 additions & 6 deletions src/BlynkSimpleEsp32_Async_WM.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
@date Jan 2015
@brief
Version: 1.6.0
Version: 1.6.1
Version Modified By Date Comments
------- ----------- ---------- -----------
Expand All @@ -34,6 +34,7 @@
1.4.1 K Hoang 24/04/2021 Fix issue of custom Blynk port (different from 8080 or 9443) not working on ESP32
1.5.0 K Hoang 25/04/2021 Enable scan of WiFi networks for selection in Configuration Portal
1.6.0 K Hoang 19/05/2021 Fix AP connect and SSL issues caused by breaking ESP8266 core v3.0.0
1.6.1 K Hoang 15/07/2021 Add configurable connectMultiWiFi parameters. Update for ESP8266 core v3.0.1
********************************************************************************************************************************/

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

#define BLYNK_ASYNC_WM_VERSION "Blynk_Async_WM for ESP32 v1.6.0"
#define BLYNK_ASYNC_WM_VERSION "Blynk_Async_WM for ESP32 v1.6.1"

//////////////////////////////////////////////
// From v1.6.0 to display correct BLYNK_INFO_DEVICE
Expand Down Expand Up @@ -2224,11 +2225,17 @@ class BlynkWifi

//////////////////////////////////////

#ifndef WIFI_MULTI_CONNECT_WAITING_MS
// For ESP32, this better be 2000 to enable connect the 1st time
#define WIFI_MULTI_CONNECT_WAITING_MS 2000L
#endif

#ifndef WIFI_MULTI_CONNECT_WAITING_TIMES
#define WIFI_MULTI_CONNECT_WAITING_TIMES 10
#endif

uint8_t connectMultiWiFi()
{
// For ESP32, this better be 2000 to enable connect the 1st time
#define WIFI_MULTI_CONNECT_WAITING_MS 2000L

uint8_t status;
BLYNK_LOG1(BLYNK_F("Connecting MultiWifi..."));

Expand All @@ -2240,7 +2247,7 @@ class BlynkWifi
status = wifiMulti.run();
delay(WIFI_MULTI_CONNECT_WAITING_MS);

while ( ( i++ < 10 ) && ( status != WL_CONNECTED ) )
while ( ( i++ < WIFI_MULTI_CONNECT_WAITING_TIMES ) && ( status != WL_CONNECTED ) )
{
status = wifiMulti.run();

Expand Down
19 changes: 13 additions & 6 deletions src/BlynkSimpleEsp32_SSL_Async_WM.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
@date Jan 2015
@brief
Version: 1.6.0
Version: 1.6.1
Version Modified By Date Comments
------- ----------- ---------- -----------
Expand All @@ -34,6 +34,7 @@
1.4.1 K Hoang 24/04/2021 Fix issue of custom Blynk port (different from 8080 or 9443) not working on ESP32
1.5.0 K Hoang 25/04/2021 Enable scan of WiFi networks for selection in Configuration Portal
1.6.0 K Hoang 19/05/2021 Fix AP connect and SSL issues caused by breaking ESP8266 core v3.0.0
1.6.1 K Hoang 15/07/2021 Add configurable connectMultiWiFi parameters. Update for ESP8266 core v3.0.1
********************************************************************************************************************************/

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

#define BLYNK_ASYNC_WM_VERSION "Blynk_Async_WM SSL for ESP32 v1.6.0"
#define BLYNK_ASYNC_WM_VERSION "Blynk_Async_WM SSL for ESP32 v1.6.1"

//////////////////////////////////////////////
// From v1.6.0 to display correct BLYNK_INFO_DEVICE
Expand Down Expand Up @@ -2297,11 +2298,17 @@ class BlynkWifi

//////////////////////////////////////

#ifndef WIFI_MULTI_CONNECT_WAITING_MS
// For ESP32, this better be 2000 to enable connect the 1st time
#define WIFI_MULTI_CONNECT_WAITING_MS 2000L
#endif

#ifndef WIFI_MULTI_CONNECT_WAITING_TIMES
#define WIFI_MULTI_CONNECT_WAITING_TIMES 10
#endif

uint8_t connectMultiWiFi()
{
// For ESP32, this better be 2000 to enable connect the 1st time
#define WIFI_MULTI_CONNECT_WAITING_MS 2000L

uint8_t status;
BLYNK_LOG1(BLYNK_F("Connecting MultiWifi..."));

Expand All @@ -2313,7 +2320,7 @@ class BlynkWifi
status = wifiMulti.run();
delay(WIFI_MULTI_CONNECT_WAITING_MS);

while ( ( i++ < 10 ) && ( status != WL_CONNECTED ) )
while ( ( i++ < WIFI_MULTI_CONNECT_WAITING_TIMES ) && ( status != WL_CONNECTED ) )
{
status = wifiMulti.run();

Expand Down
30 changes: 22 additions & 8 deletions src/BlynkSimpleEsp8266_Async_WM.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
@date Jan 2015
@brief
Version: 1.6.0
Version: 1.6.1
Version Modified By Date Comments
------- ----------- ---------- -----------
Expand All @@ -34,6 +34,7 @@
1.4.1 K Hoang 24/04/2021 Fix issue of custom Blynk port (different from 8080 or 9443) not working on ESP32
1.5.0 K Hoang 25/04/2021 Enable scan of WiFi networks for selection in Configuration Portal
1.6.0 K Hoang 19/05/2021 Fix AP connect and SSL issues caused by breaking ESP8266 core v3.0.0
1.6.1 K Hoang 15/07/2021 Add configurable connectMultiWiFi parameters. Update for ESP8266 core v3.0.1
********************************************************************************************************************************/

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

#define BLYNK_ASYNC_WM_VERSION "Blynk_Async_WM for ESP8266 v1.6.0"
#define BLYNK_ASYNC_WM_VERSION "Blynk_Async_WM for ESP8266 v1.6.1"

#include <version.h>

/////////////////////////////////////////////

#if (ARDUINO_ESP8266_GIT_VER == 0xefb0341a)
#if (ARDUINO_ESP8266_GIT_VER == 0xcbf44fb3)
#define USING_ESP8266_CORE_VERSION 30001
#define ESP8266_CORE_VERSION "ESP8266 core v3.0.1"
#elif (ARDUINO_ESP8266_GIT_VER == 0xefb0341a)
#define USING_ESP8266_CORE_VERSION 30000
#define ESP8266_CORE_VERSION "ESP8266 core v3.0.0"
#warning USING_ESP8266_CORE_VERSION "3.0.0"
Expand Down Expand Up @@ -99,6 +103,10 @@
#define USING_ESP8266_CORE_VERSION 0
#define ESP8266_CORE_VERSION "ESP8266 core too old"
#warning USING_ESP8266_CORE_VERSION "0.0.0"
#else
#define USING_ESP8266_CORE_VERSION 80808
#define ESP8266_CORE_VERSION "ESP8266 core too new"
#warning USING_ESP8266_CORE_VERSION "8.8.8"
#endif

//////////////////////////////////////////////
Expand Down Expand Up @@ -2252,12 +2260,18 @@ class BlynkWifi
}

//////////////////////////////////////

#ifndef WIFI_MULTI_CONNECT_WAITING_MS
// For ESP8266, this better be 3000 to enable connect the 1st time
#define WIFI_MULTI_CONNECT_WAITING_MS 3000L
#endif

#ifndef WIFI_MULTI_CONNECT_WAITING_TIMES
#define WIFI_MULTI_CONNECT_WAITING_TIMES 10
#endif

uint8_t connectMultiWiFi()
{
// For ESP8266, this better be 3000 to enable connect the 1st time
#define WIFI_MULTI_CONNECT_WAITING_MS 3000L

{
uint8_t status;
BLYNK_LOG1(BLYNK_F("Connecting MultiWifi..."));

Expand All @@ -2269,7 +2283,7 @@ class BlynkWifi
status = wifiMulti.run();
delay(WIFI_MULTI_CONNECT_WAITING_MS);

while ( ( i++ < 10 ) && ( status != WL_CONNECTED ) )
while ( ( i++ < WIFI_MULTI_CONNECT_WAITING_TIMES ) && ( status != WL_CONNECTED ) )
{
status = wifiMulti.run();

Expand Down
28 changes: 21 additions & 7 deletions src/BlynkSimpleEsp8266_SSL_Async_WM.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
@date Jan 2015
@brief
Version: 1.6.0
Version: 1.6.1
Version Modified By Date Comments
------- ----------- ---------- -----------
Expand All @@ -34,6 +34,7 @@
1.4.1 K Hoang 24/04/2021 Fix issue of custom Blynk port (different from 8080 or 9443) not working on ESP32
1.5.0 K Hoang 25/04/2021 Enable scan of WiFi networks for selection in Configuration Portal
1.6.0 K Hoang 19/05/2021 Fix AP connect and SSL issues caused by breaking ESP8266 core v3.0.0
1.6.1 K Hoang 15/07/2021 Add configurable connectMultiWiFi parameters. Update for ESP8266 core v3.0.1
********************************************************************************************************************************/

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

#define BLYNK_ASYNC_WM_VERSION "Blynk_Async_WM SSL for ESP8266 v1.6.0"
#define BLYNK_ASYNC_WM_VERSION "Blynk_Async_WM SSL for ESP8266 v1.6.1"

#include <version.h>

/////////////////////////////////////////////

#if (ARDUINO_ESP8266_GIT_VER == 0xefb0341a)
#if (ARDUINO_ESP8266_GIT_VER == 0xcbf44fb3)
#define USING_ESP8266_CORE_VERSION 30001
#define ESP8266_CORE_VERSION "ESP8266 core v3.0.1"
#elif (ARDUINO_ESP8266_GIT_VER == 0xefb0341a)
#define USING_ESP8266_CORE_VERSION 30000
#define ESP8266_CORE_VERSION "ESP8266 core v3.0.0"
#warning USING_ESP8266_CORE_VERSION "3.0.0"
Expand Down Expand Up @@ -99,6 +103,10 @@
#define USING_ESP8266_CORE_VERSION 0
#define ESP8266_CORE_VERSION "ESP8266 core too old"
#warning USING_ESP8266_CORE_VERSION "0.0.0"
#else
#define USING_ESP8266_CORE_VERSION 80808
#define ESP8266_CORE_VERSION "ESP8266 core too new"
#warning USING_ESP8266_CORE_VERSION "8.8.8"
#endif

//////////////////////////////////////////////
Expand Down Expand Up @@ -2382,11 +2390,17 @@ class BlynkWifi

//////////////////////////////////////

#ifndef WIFI_MULTI_CONNECT_WAITING_MS
// For ESP8266, this better be 3000 to enable connect the 1st time
#define WIFI_MULTI_CONNECT_WAITING_MS 3000L
#endif

#ifndef WIFI_MULTI_CONNECT_WAITING_TIMES
#define WIFI_MULTI_CONNECT_WAITING_TIMES 10
#endif

uint8_t connectMultiWiFi()
{
// For ESP8266, this better be 3000 to enable connect the 1st time
#define WIFI_MULTI_CONNECT_WAITING_MS 3000L

uint8_t status;
BLYNK_LOG1(BLYNK_F("Connecting MultiWifi..."));

Expand All @@ -2398,7 +2412,7 @@ class BlynkWifi
status = wifiMulti.run();
delay(WIFI_MULTI_CONNECT_WAITING_MS);

while ( ( i++ < 10 ) && ( status != WL_CONNECTED ) )
while ( ( i++ < WIFI_MULTI_CONNECT_WAITING_TIMES ) && ( status != WL_CONNECTED ) )
{
status = wifiMulti.run();

Expand Down

0 comments on commit 751a4be

Please sign in to comment.