Skip to content
This repository was archived by the owner on Dec 5, 2021. It is now read-only.

Commit aa6dcbf

Browse files
authored
Major Releases v1.2.0
### Major Releases v1.2.0 1. Enable scan of WiFi networks for selection in Configuration Portal. Check [PR for v1.3.0 - Enable scan of WiFi networks #10](khoih-prog/WiFiManager_NINA_Lite#10). Now you can select optional **SCAN_WIFI_NETWORKS**, **MANUAL_SSID_INPUT_ALLOWED** to be able to manually input SSID, not only from a scanned SSID lists and **MAX_SSID_IN_LIST** (from 2-15) 2. Fix invalid "blank" Config Data treated as Valid. 3. Permit optionally inputting one set of WiFi SSID/PWD by using `REQUIRE_ONE_SET_SSID_PW == true` 4. Enforce WiFi PWD minimum length of 8 chars 5. Minor enhancement to not display garbage when data is invalid 6. Fix issue of custom Blynk port (different from 8080 or 9443) not working on ESP32. Check [Custom Blynk port not working for BlynkSimpleEsp32_Async_WM.h #4](khoih-prog/Blynk_Async_WM#4) 7. To permit auto-reset after configurable timeout if DRD/MRD or non-persistent forced-CP. Check [**Good new feature: Blynk.resetAndEnterConfigPortal() Thanks & question #27**](khoih-prog/Blynk_WM#27) 8. Fix rare Config Portal bug not updating Config and dynamic Params data successfully in very noisy or weak WiFi situation 9. Tested with [**Latest ESP32 Core 1.0.6**](https://github.com/espressif/arduino-esp32) for ESP32-based boards. 10. Update examples
1 parent f97288f commit aa6dcbf

29 files changed

+1544
-318
lines changed

CONTRIBUTING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ 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.13) or Platform.io version
18-
* `ESP32` Core Version (e.g. ESP32 core v1.0.4)
18+
* `ESP32` Core Version (e.g. ESP32 core 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:
@@ -27,9 +27,9 @@ Please ensure to specify the following:
2727

2828
```
2929
Arduino IDE version: 1.8.13
30-
ESP32 Core Version 1.0.4
30+
ESP32 Core Version 1.0.6
3131
OS: Ubuntu 20.04 LTS
32-
Linux xy-Inspiron-3593 5.4.0-64-generic #72-Ubuntu SMP Fri Jan 15 10:27:54 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
32+
Linux xy-Inspiron-3593 5.4.0-72-generic #80-Ubuntu SMP Mon Apr 12 17:35:00 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

Lines changed: 292 additions & 54 deletions
Large diffs are not rendered by default.

examples/Async_ESP32_BLE_WF/Async_ESP32_BLE_WF.ino

Lines changed: 45 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
Built by Khoi Hoang https://github.com/khoih-prog/Blynk_Async_ESP32_BT_WF
1010
Licensed under MIT license
1111
12-
Version: 1.1.1
12+
Version: 1.2.0
1313
1414
Version Modified By Date Comments
1515
------- ----------- ---------- -----------
@@ -18,6 +18,7 @@
1818
1.1.0 K Hoang 30/12/2020 Add support to LittleFS. Remove possible compiler warnings. Update examples
1919
1.1.1 K Hoang 31/01/2021 Add functions to control Config Portal (CP) from software or Virtual Switches
2020
Fix CP and Dynamic Params bugs. To permit autoreset after timeout if DRD/MRD or forced CP
21+
1.2.0 K Hoang 24/04/2021 Enable scan of WiFi networks for selection in Configuration Portal and many new features.
2122
*****************************************************************************************************************************/
2223
/****************************************************************************************************************************
2324
Important Notes:
@@ -135,6 +136,11 @@ void checkStatus()
135136

136137
char BLE_Device_Name[] = "GeigerCounter-BLE";
137138

139+
#if USING_CUSTOMS_STYLE
140+
const char NewCustomsStyle[] /*PROGMEM*/ = "<style>div,input{padding:5px;font-size:1em;}input{width:95%;}body{text-align: center;}\
141+
button{background-color:blue;color:white;line-height:2.4rem;font-size:1.2rem;width:100%;}fieldset{border-radius:0.3rem;margin:0px;}</style>";
142+
#endif
143+
138144
void setup()
139145
{
140146
Serial.begin(115200);
@@ -198,6 +204,22 @@ void setup()
198204
//Blynk.setSTAStaticIPConfig(IPAddress(192, 168, 2, 232), IPAddress(192, 168, 2, 1), IPAddress(255, 255, 255, 0),
199205
// IPAddress(4, 4, 4, 4), IPAddress(8, 8, 8, 8));
200206

207+
//////////////////////////////////////////////
208+
209+
#if USING_CUSTOMS_STYLE
210+
Blynk.setCustomsStyle(NewCustomsStyle);
211+
#endif
212+
213+
#if USING_CUSTOMS_HEAD_ELEMENT
214+
Blynk.setCustomsHeadElement("<style>html{filter: invert(10%);}</style>");
215+
#endif
216+
217+
#if USING_CORS_FEATURE
218+
Blynk.setCORSHeader("Your Access-Control-Allow-Origin");
219+
#endif
220+
221+
//////////////////////////////////////////////
222+
201223
// Use this to default DHCP hostname to ESP8266-XXXXXX or ESP32-XXXXXX
202224
//Blynk.begin();
203225
// Use this to personalize DHCP hostname (RFC952 conformed)
@@ -266,23 +288,9 @@ void displayCredentials()
266288
Serial.println(myMenuItems[i].pdata);
267289
}
268290
}
269-
#endif
270291

271-
void loop()
292+
void displayCredentialsInLoop()
272293
{
273-
#if BLYNK_USE_BLE_ONLY
274-
Blynk_BLE.run();
275-
#else
276-
if (USE_BLE)
277-
Blynk_BLE.run();
278-
else
279-
Blynk_WF.run();
280-
#endif
281-
282-
timer.run();
283-
checkStatus();
284-
285-
#if (USE_BLYNK_WM && USE_DYNAMIC_PARAMETERS)
286294
static bool displayedCredentials = false;
287295

288296
if (!displayedCredentials)
@@ -301,5 +309,25 @@ void loop()
301309
}
302310
}
303311
}
304-
#endif
312+
}
313+
314+
#endif
315+
316+
void loop()
317+
{
318+
#if BLYNK_USE_BLE_ONLY
319+
Blynk_BLE.run();
320+
#else
321+
if (USE_BLE)
322+
Blynk_BLE.run();
323+
else
324+
Blynk_WF.run();
325+
#endif
326+
327+
timer.run();
328+
checkStatus();
329+
330+
#if (USE_BLYNK_WM && USE_DYNAMIC_PARAMETERS)
331+
displayCredentialsInLoop();
332+
#endif
305333
}

examples/Async_ESP32_BLE_WF/defines.h

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#define ESP32_BLE_WF_DEBUG true
2323

2424
#define DOUBLERESETDETECTOR_DEBUG true
25-
#define BLYNK_WM_DEBUG 3
25+
#define BLYNK_WM_DEBUG 1
2626

2727
// Not use #define USE_LITTLEFS and #define USE_SPIFFS => using SPIFFS for configuration data in WiFiManager
2828
// (USE_LITTLEFS == false) and (USE_SPIFFS == false) => using EEPROM for configuration data in WiFiManager
@@ -42,6 +42,15 @@
4242
#define EEPROM_START 0
4343
#endif
4444

45+
/////////////////////////////////////////////
46+
47+
// Add customs headers from v1.2.0
48+
#define USING_CUSTOMS_STYLE true
49+
#define USING_CUSTOMS_HEAD_ELEMENT true
50+
#define USING_CORS_FEATURE true
51+
52+
/////////////////////////////////////////////
53+
4554
// Force some params in Blynk, only valid for library version 1.0.1 and later
4655
#define TIMEOUT_RECONNECT_WIFI 10000L
4756
#define RESET_IF_CONFIG_TIMEOUT true
@@ -61,6 +70,20 @@
6170
#if !BLYNK_USE_BLE_ONLY
6271
#if USE_BLYNK_WM
6372
#define USE_DYNAMIC_PARAMETERS true
73+
74+
/////////////////////////////////////////////
75+
76+
#define REQUIRE_ONE_SET_SSID_PW false
77+
78+
#define SCAN_WIFI_NETWORKS true
79+
80+
// To be able to manually input SSID, not from a scanned SSID lists
81+
#define MANUAL_SSID_INPUT_ALLOWED true
82+
83+
// From 2-15
84+
#define MAX_SSID_IN_LIST 8
85+
86+
/////////////////////////////////////////////
6487

6588
#warning Please select 1.3MB+ for APP (Minimal SPIFFS (1.9MB APP, OTA), HugeAPP(3MB APP, NoOTA) or NoOA(2MB APP)
6689
#include <BlynkSimpleEsp32_Async_WFM.h>

examples/Async_ESP32_BT_WF/Async_ESP32_BT_WF.ino

Lines changed: 45 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
Built by Khoi Hoang https://github.com/khoih-prog/Blynk_Async_ESP32_BT_WF
1010
Licensed under MIT license
1111
12-
Version: 1.1.1
12+
Version: 1.2.0
1313
1414
Version Modified By Date Comments
1515
------- ----------- ---------- -----------
@@ -18,6 +18,7 @@
1818
1.1.0 K Hoang 30/12/2020 Add support to LittleFS. Remove possible compiler warnings. Update examples
1919
1.1.1 K Hoang 31/01/2021 Add functions to control Config Portal (CP) from software or Virtual Switches
2020
Fix CP and Dynamic Params bugs. To permit autoreset after timeout if DRD/MRD or forced CP
21+
1.2.0 K Hoang 24/04/2021 Enable scan of WiFi networks for selection in Configuration Portal and many new features.
2122
*****************************************************************************************************************************/
2223
/****************************************************************************************************************************
2324
Important Notes:
@@ -135,6 +136,11 @@ void checkStatus()
135136

136137
char BT_Device_Name[] = "GeigerCounter-BT";
137138

139+
#if USING_CUSTOMS_STYLE
140+
const char NewCustomsStyle[] /*PROGMEM*/ = "<style>div,input{padding:5px;font-size:1em;}input{width:95%;}body{text-align: center;}\
141+
button{background-color:blue;color:white;line-height:2.4rem;font-size:1.2rem;width:100%;}fieldset{border-radius:0.3rem;margin:0px;}</style>";
142+
#endif
143+
138144
void setup()
139145
{
140146
Serial.begin(115200);
@@ -197,6 +203,22 @@ void setup()
197203
//Blynk.setSTAStaticIPConfig(IPAddress(192, 168, 2, 232), IPAddress(192, 168, 2, 1), IPAddress(255, 255, 255, 0),
198204
// IPAddress(4, 4, 4, 4), IPAddress(8, 8, 8, 8));
199205

206+
//////////////////////////////////////////////
207+
208+
#if USING_CUSTOMS_STYLE
209+
Blynk.setCustomsStyle(NewCustomsStyle);
210+
#endif
211+
212+
#if USING_CUSTOMS_HEAD_ELEMENT
213+
Blynk.setCustomsHeadElement("<style>html{filter: invert(10%);}</style>");
214+
#endif
215+
216+
#if USING_CORS_FEATURE
217+
Blynk.setCORSHeader("Your Access-Control-Allow-Origin");
218+
#endif
219+
220+
//////////////////////////////////////////////
221+
200222
// Use this to default DHCP hostname to ESP8266-XXXXXX or ESP32-XXXXXX
201223
//Blynk.begin();
202224
// Use this to personalize DHCP hostname (RFC952 conformed)
@@ -265,23 +287,9 @@ void displayCredentials()
265287
Serial.println(myMenuItems[i].pdata);
266288
}
267289
}
268-
#endif
269290

270-
void loop()
291+
void displayCredentialsInLoop()
271292
{
272-
#if BLYNK_USE_BT_ONLY
273-
Blynk_BT.run();
274-
#else
275-
if (USE_BT)
276-
Blynk_BT.run();
277-
else
278-
Blynk_WF.run();
279-
#endif
280-
281-
timer.run();
282-
checkStatus();
283-
284-
#if (USE_BLYNK_WM && USE_DYNAMIC_PARAMETERS)
285293
static bool displayedCredentials = false;
286294

287295
if (!displayedCredentials)
@@ -300,5 +308,25 @@ void loop()
300308
}
301309
}
302310
}
303-
#endif
311+
}
312+
313+
#endif
314+
315+
void loop()
316+
{
317+
#if BLYNK_USE_BT_ONLY
318+
Blynk_BT.run();
319+
#else
320+
if (USE_BT)
321+
Blynk_BT.run();
322+
else
323+
Blynk_WF.run();
324+
#endif
325+
326+
timer.run();
327+
checkStatus();
328+
329+
#if (USE_BLYNK_WM && USE_DYNAMIC_PARAMETERS)
330+
displayCredentialsInLoop();
331+
#endif
304332
}

examples/Async_ESP32_BT_WF/defines.h

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,15 @@
4242
#define EEPROM_START 0
4343
#endif
4444

45+
/////////////////////////////////////////////
46+
47+
// Add customs headers from v1.2.0
48+
#define USING_CUSTOMS_STYLE true
49+
#define USING_CUSTOMS_HEAD_ELEMENT true
50+
#define USING_CORS_FEATURE true
51+
52+
/////////////////////////////////////////////
53+
4554
// Force some params in Blynk, only valid for library version 1.0.1 and later
4655
#define TIMEOUT_RECONNECT_WIFI 10000L
4756
#define RESET_IF_CONFIG_TIMEOUT true
@@ -59,6 +68,20 @@
5968
#if !BLYNK_USE_BT_ONLY
6069
#if USE_BLYNK_WM
6170
#define USE_DYNAMIC_PARAMETERS true
71+
72+
/////////////////////////////////////////////
73+
74+
#define REQUIRE_ONE_SET_SSID_PW false
75+
76+
#define SCAN_WIFI_NETWORKS true
77+
78+
// To be able to manually input SSID, not from a scanned SSID lists
79+
#define MANUAL_SSID_INPUT_ALLOWED true
80+
81+
// From 2-15
82+
#define MAX_SSID_IN_LIST 8
83+
84+
/////////////////////////////////////////////
6285

6386
#warning Please select 1.3MB+ for APP (Minimal SPIFFS (1.9MB APP, OTA), HugeAPP(3MB APP, NoOTA) or NoOA(2MB APP)
6487
#include <BlynkSimpleEsp32_Async_WFM.h>

0 commit comments

Comments
 (0)