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

Commit 1cc1675

Browse files
authored
v1.1.1
### Releases v1.1.1 1. Add functions to control Config Portal from software or Virtual Switches. Check [How to trigger a Config Portal from code #25](khoih-prog/Blynk_WM#25) 2. Fix rare Config Portal bug not updating Config and dynamic Params data successfully in very noisy or weak WiFi situation 3. To permit autoreset 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)
1 parent f8572a9 commit 1cc1675

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+1562
-832
lines changed

CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Please ensure to specify the following:
2929
Arduino IDE version: 1.8.13
3030
ESP32 Core Version 1.0.4
3131
OS: Ubuntu 20.04 LTS
32-
Linux xy-Inspiron-3593 5.4.0-51-generic #56-Ubuntu SMP Mon Oct 5 14:28:49 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
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
3333
3434
Context:
3535
The board couldn't autoreconnect to Local Blynk Server after router power recycling.

README.md

+229-14
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
* [Why Async is better](#why-async-is-better)
1717
* [Currently supported Boards](#currently-supported-boards)
1818
* [Changelog](#changelog)
19+
* [Releases v1.1.1](#releases-v111)
1920
* [Major Releases v1.1.0](#major-releases-v110)
2021
* [Releases v1.0.6](#releases-v106)
2122
* [Prerequisites](#prerequisites)
@@ -56,7 +57,9 @@
5657
* [1. Async_ESP32_BLE_WF on ESP32_DEV](#1-async_esp32_ble_wf-on-esp32_dev)
5758
* [1.1. No Config Data => Config Portal. Input valid credentials => reboot](#11-no-config-data--config-portal-input-valid-credentials--reboot)
5859
* [1.2. DRD => Config Portal. Input valid credentials => reboot](#12-drd--config-portal-input-valid-credentials--reboot)
59-
* [1.3. After inputting valid credentials and reboot](#13-after-inputting-valid-credentials-and-reboot)
60+
* [1.3. After inputting valid credentials and reboot](#13-after-inputting-valid-credentials-and-reboot)
61+
* [1.4. Enter non-persistent ConfigPortal](#14-enter-non-persistent-configportal)
62+
* [1.5. Enter persistent ConfigPortal](#15-enter-persistent-configportal)
6063
* [Debug](#debug)
6164
* [Troubleshooting](#troubleshooting)
6265
* [Releases](#releases)
@@ -111,6 +114,12 @@ This [**BlynkESP32_BT_WF** library](https://github.com/khoih-prog/BlynkESP32_BT_
111114

112115
## Changelog
113116

117+
### Releases v1.1.1
118+
119+
1. Add functions to control Config Portal from software or Virtual Switches. Check [How to trigger a Config Portal from code #25](https://github.com/khoih-prog/Blynk_WM/issues/25)
120+
2. Fix rare Config Portal bug not updating Config and dynamic Params data successfully in very noisy or weak WiFi situation
121+
3. To permit autoreset after configurable timeout if DRD/MRD or non-persistent forced-CP. Check [**Good new feature: Blynk.resetAndEnterConfigPortal() Thanks & question #27**](https://github.com/khoih-prog/Blynk_WM/issues/27)
122+
114123
### Major Releases v1.1.0
115124

116125
1. Add support to LittleFS for ESP32 using [LITTLEFS](https://github.com/lorol/LITTLEFS) Library
@@ -557,6 +566,36 @@ BlynkTimer timer;
557566
#include <Ticker.h>
558567
Ticker led_ticker;
559568

569+
#if USE_BLYNK_WM
570+
571+
#define BLYNK_PIN_FORCED_CONFIG V10
572+
#define BLYNK_PIN_FORCED_PERS_CONFIG V20
573+
574+
// Use button V10 (BLYNK_PIN_FORCED_CONFIG) to forced Config Portal
575+
BLYNK_WRITE(BLYNK_PIN_FORCED_CONFIG)
576+
{
577+
if (param.asInt())
578+
{
579+
Serial.println( F("\nCP Button Hit. Rebooting") );
580+
581+
// This will keep CP once, clear after reset, even you didn't enter CP at all.
582+
Blynk.resetAndEnterConfigPortal();
583+
}
584+
}
585+
586+
// Use button V20 (BLYNK_PIN_FORCED_PERS_CONFIG) to forced Persistent Config Portal
587+
BLYNK_WRITE(BLYNK_PIN_FORCED_PERS_CONFIG)
588+
{
589+
if (param.asInt())
590+
{
591+
Serial.println( F("\nPersistent CP Button Hit. Rebooting") );
592+
593+
// This will keep CP forever, until you successfully enter CP, and Save data to clear the flag.
594+
Blynk.resetAndEnterConfigPortalPersistent();
595+
}
596+
}
597+
#endif
598+
560599
void set_led(byte status)
561600
{
562601
digitalWrite(LED_BUILTIN, status);
@@ -622,6 +661,8 @@ void setup()
622661
Serial.begin(115200);
623662
while (!Serial);
624663

664+
delay(200);
665+
625666
#if (USE_LITTLEFS)
626667
Serial.print(F("\nStarting Async_ESP32_BLE_WF using LITTLEFS"));
627668
#elif (USE_SPIFFS)
@@ -631,11 +672,12 @@ void setup()
631672
#endif
632673

633674
#if USE_SSL
634-
Serial.println(" with SSL on " + String(ARDUINO_BOARD));
675+
Serial.print(F(" with SSL on "));
635676
#else
636-
Serial.println(" without SSL on " + String(ARDUINO_BOARD));
677+
Serial.print(F(" without SSL on "));
637678
#endif
638679

680+
Serial.println(ARDUINO_BOARD);
639681
Serial.println(BLYNK_ASYNC_ESP32_BT_WF_VERSION);
640682

641683
#if USE_BLYNK_WM
@@ -734,13 +776,15 @@ void setup()
734776
}
735777

736778
#if (USE_BLYNK_WM && USE_DYNAMIC_PARAMETERS)
737-
void displayCredentials(void)
779+
void displayCredentials()
738780
{
739781
Serial.println(F("\nYour stored Credentials :"));
740782

741-
for (int i = 0; i < NUM_MENU_ITEMS; i++)
783+
for (uint16_t i = 0; i < NUM_MENU_ITEMS; i++)
742784
{
743-
Serial.println(String(myMenuItems[i].displayName) + " = " + myMenuItems[i].pdata);
785+
Serial.print(myMenuItems[i].displayName);
786+
Serial.print(F(" = "));
787+
Serial.println(myMenuItems[i].pdata);
744788
}
745789
}
746790
#endif
@@ -764,7 +808,7 @@ void loop()
764808

765809
if (!displayedCredentials)
766810
{
767-
for (int i = 0; i < NUM_MENU_ITEMS; i++)
811+
for (uint16_t i = 0; i < NUM_MENU_ITEMS; i++)
768812
{
769813
if (!strlen(myMenuItems[i].pdata))
770814
{
@@ -835,6 +879,8 @@ void loop()
835879
836880
#if !BLYNK_USE_BLE_ONLY
837881
#if USE_BLYNK_WM
882+
#define USE_DYNAMIC_PARAMETERS true
883+
838884
#warning Please select 1.3MB+ for APP (Minimal SPIFFS (1.9MB APP, OTA), HugeAPP(3MB APP, NoOTA) or NoOA(2MB APP)
839885
#include <BlynkSimpleEsp32_Async_WFM.h>
840886
#else
@@ -875,7 +921,7 @@ void loop()
875921
/// Start Default Config Data //////////////////
876922

877923
/*
878-
// Defined in <BlynkSimpleEsp32_Async_WFM.h>
924+
// Defined in <BlynkSimpleESP32_Async_WFM.h>
879925

880926
#define SSID_MAX_LEN 32
881927
#define PASS_MAX_LEN 64
@@ -916,7 +962,7 @@ void loop()
916962
Blynk_WM_Configuration defaultConfig =
917963
{
918964
//char header[16], dummy, not used
919-
#if USE_SSL
965+
#if USE_SSL
920966
"SSL",
921967
#else
922968
"NonSSL",
@@ -958,11 +1004,15 @@ void loop()
9581004

9591005
#if USE_BLYNK_WM
9601006

961-
#define USE_DYNAMIC_PARAMETERS true
1007+
#if (USE_DYNAMIC_PARAMETERS)
1008+
#warning USE_DYNAMIC_PARAMETERS
1009+
#endif
1010+
1011+
// USE_DYNAMIC_PARAMETERS defined in defined.h
9621012

9631013
/////////////// Start dynamic Credentials ///////////////
9641014

965-
//Defined in <BlynkSimpleEsp32_Async_WFM.h>
1015+
//Defined in <BlynkSimpleESP32_Async_WFM.h>
9661016
/**************************************
9671017
#define MAX_ID_LEN 5
9681018
#define MAX_DISPLAY_NAME_LEN 16
@@ -1038,7 +1088,7 @@ The following is the sample terminal output when running example [Async_ESP32_BL
10381088

10391089
```
10401090
Starting Async_ESP32_BLE_WF using SPIFFS without SSL on ESP32_DEV
1041-
Blynk_Async_ESP32_BT_WF v1.1.0
1091+
Blynk_Async_ESP32_BT_WF v1.1.1
10421092
ESP_DoubleResetDetector v1.1.1
10431093
GPIO14 HIGH, Use WiFi
10441094
USE_BLYNK_WM: Blynk_WF begin
@@ -1096,7 +1146,7 @@ FF[9799112] id: = HueNet1
10961146

10971147
```
10981148
Starting Async_ESP32_BLE_WF using SPIFFS without SSL on ESP32_DEV
1099-
Blynk_Async_ESP32_BT_WF v1.1.0
1149+
Blynk_Async_ESP32_BT_WF v1.1.1
11001150
ESP_DoubleResetDetector v1.1.1
11011151
GPIO14 HIGH, Use WiFi
11021152
USE_BLYNK_WM: Blynk_WF begin
@@ -1174,7 +1224,7 @@ FFFFF
11741224

11751225
```
11761226
Starting Async_ESP32_BLE_WF using SPIFFS without SSL on ESP32_DEV
1177-
Blynk_Async_ESP32_BT_WF v1.1.0
1227+
Blynk_Async_ESP32_BT_WF v1.1.1
11781228
ESP_DoubleResetDetector v1.1.1
11791229
GPIO14 HIGH, Use WiFi
11801230
USE_BLYNK_WM: Blynk_WF begin
@@ -1242,8 +1292,167 @@ Stop doubleResetDetecting
12421292
Saving config file...
12431293
Saving config file OK
12441294
BBBB
1295+
```
1296+
1297+
---
1298+
1299+
#### 1.4 Enter non-persistent ConfigPortal
1300+
1301+
**Non-Persistent CP will be removed after first reset or time-out, even you didn't enter the CP**. You can optionally enter CP, input and `Save` config data.
1302+
1303+
```
1304+
CP Button Hit. Rebooting
1305+
[13025] setForcedCP non-Persistent
1306+
[13039] SaveCPFile
1307+
[13044] OK
1308+
[13058] SaveBkUpCPFile
1309+
[13063] OK
1310+
ets Jun 8 2016 00:22:57
1311+
1312+
1313+
Starting Async_ESP32_BLE_WF using LITTLEFS without SSL on ESP32_DEV
1314+
Blynk_Async_ESP32_BT_WF v1.1.0
1315+
ESP_DoubleResetDetector v1.1.1
1316+
GPIO14 HIGH, Use WiFi
1317+
USE_BLYNK_WM: Blynk_WF begin
1318+
LittleFS Flag read = 0xD0D04321
1319+
No doubleResetDetected
1320+
Saving config file...
1321+
Saving config file OK
1322+
[481] Hostname=GeigerCounter-BLE
1323+
[501] LoadCfgFile
1324+
[504] OK
1325+
[505] ======= Start Stored Config Data =======
1326+
[505] Hdr=ESP32_WFM,BrdName=ESP32_BT_BLE
1327+
[505] SSID=HueNet1,PW=12345678
1328+
[506] SSID1=HueNet2,PW1=12345678
1329+
[509] Server=account.duckdns.org,Token=token
1330+
[515] Server1=account.duckdns.org,Token1=token1
1331+
[521] BT-Token=bt_token,BLE-Token=ble_token
1332+
[529] Port=8080
1333+
[531] ======= End Config Data =======
1334+
[534] CCSum=0x4b86,RCSum=0x4b86
1335+
[545] LoadCredFile
1336+
[548] CrR:pdata=new-mqtt-server,len=34
1337+
[548] CrR:pdata=1883,len=6
1338+
[548] CrR:pdata=default-mqtt-username,len=34
1339+
[549] CrR:pdata=default-mqtt-password,len=34
1340+
[553] CrR:pdata=default-mqtt-SubTopic,len=34
1341+
[557] CrR:pdata=default-mqtt-PubTopic,len=34
1342+
[561] OK
1343+
[562] CrCCsum=0x280b,CrRCsum=0x280b
1344+
[565] Valid Stored Dynamic Data
1345+
[568] Hdr=ESP32_WFM,BrdName=ESP32_BT_BLE
1346+
[571] SSID=HueNet1,PW=12345678
1347+
[574] SSID1=HueNet2,PW1=12345678
1348+
[577] Server=account.duckdns.org,Token=token
1349+
[583] Server1=account.duckdns.org,Token1=token1
1350+
[589] BT-Token=bt_token,BLE-Token=ble_token
1351+
[597] Port=8080
1352+
[599] ======= End Config Data =======
1353+
[602] Check if isForcedCP
1354+
[612] LoadCPFile
1355+
[615] OK
1356+
[615] bg: isForcedConfigPortal = true
1357+
[615] bg:Stay forever in CP:Forced-non-Persistent
1358+
[615] clearForcedCP
1359+
[624] SaveCPFile
1360+
[628] OK
1361+
[636] SaveBkUpCPFile
1362+
[640] OK
1363+
[1485] stConf:SSID=TestPortal-ESP32,PW=TestPortalPass
1364+
[1485] IP=192.168.232.1,ch=7
1365+
F
1366+
Your stored Credentials :
1367+
MQTT Server = new-mqtt-server
1368+
Port = 1883
1369+
MQTT UserName = default-mqtt-username
1370+
MQTT PWD = default-mqtt-password
1371+
Subs Topics = default-mqtt-SubTopic
1372+
Pubs Topics = default-mqtt-PubTopic
1373+
Stop doubleResetDetecting
1374+
Saving config file...
1375+
Saving config file OK
1376+
F
1377+
```
1378+
1379+
---
1380+
1381+
#### 1.5 Enter persistent ConfigPortal
1382+
1383+
**Persistent CP will remain even after resets or time-out**. The only way to get rid of Config Portal is to enter CP, input (even fake data or none) and `Save` config data. So be careful to use this feature.
12451384

12461385
```
1386+
Persistent CP Button Hit. Rebooting
1387+
[218377] setForcedCP Persistent
1388+
[218390] SaveCPFile
1389+
[218394] OK
1390+
[218408] SaveBkUpCPFile
1391+
[218413] OK
1392+
ets Jun 8 2016 00:22:57
1393+
1394+
1395+
Starting Async_ESP32_BLE_WF using LITTLEFS without SSL on ESP32_DEV
1396+
Blynk_Async_ESP32_BT_WF v1.1.0
1397+
ESP_DoubleResetDetector v1.1.1
1398+
GPIO14 HIGH, Use WiFi
1399+
USE_BLYNK_WM: Blynk_WF begin
1400+
LittleFS Flag read = 0xD0D04321
1401+
No doubleResetDetected
1402+
Saving config file...
1403+
Saving config file OK
1404+
[363] Hostname=GeigerCounter-BLE
1405+
[409] LoadCfgFile
1406+
[416] OK
1407+
[416] ======= Start Stored Config Data =======
1408+
[416] Hdr=ESP32_WFM,BrdName=ESP32_BT_BLE
1409+
[416] SSID=HueNet1,PW=12345678
1410+
[416] SSID1=HueNet2,PW1=12345678
1411+
[419] Server=account.duckdns.org,Token=token
1412+
[425] Server1=account.duckdns.org,Token1=token1
1413+
[432] BT-Token=bt_token,BLE-Token=ble_token
1414+
[440] Port=8080
1415+
[441] ======= End Config Data =======
1416+
[444] CCSum=0x4b86,RCSum=0x4b86
1417+
[467] LoadCredFile
1418+
[473] CrR:pdata=new-mqtt-server,len=34
1419+
[473] CrR:pdata=1883,len=6
1420+
[473] CrR:pdata=default-mqtt-username,len=34
1421+
[473] CrR:pdata=default-mqtt-password,len=34
1422+
[476] CrR:pdata=default-mqtt-SubTopic,len=34
1423+
[480] CrR:pdata=default-mqtt-PubTopic,len=34
1424+
[484] OK
1425+
[485] CrCCsum=0x280b,CrRCsum=0x280b
1426+
[488] Valid Stored Dynamic Data
1427+
[491] Hdr=ESP32_WFM,BrdName=ESP32_BT_BLE
1428+
[494] SSID=HueNet1,PW=12345678
1429+
[497] SSID1=HueNet2,PW1=12345678
1430+
[500] Server=account.duckdns.org,Token=token
1431+
[506] Server1=account.duckdns.org,Token1=token1
1432+
[513] BT-Token=bt_token,BLE-Token=ble_token
1433+
[521] Port=8080
1434+
[522] ======= End Config Data =======
1435+
[526] Check if isForcedCP
1436+
[541] LoadCPFile
1437+
[546] OK
1438+
[546] bg: isForcedConfigPortal = true
1439+
[546] bg:Stay forever in CP:Forced-Persistent
1440+
[1391] stConf:SSID=TestPortal-ESP32,PW=TestPortalPass
1441+
[1391] IP=192.168.232.1,ch=1
1442+
F
1443+
Your stored Credentials :
1444+
MQTT Server = new-mqtt-server
1445+
Port = 1883
1446+
MQTT UserName = default-mqtt-username
1447+
MQTT PWD = default-mqtt-password
1448+
Subs Topics = default-mqtt-SubTopic
1449+
Pubs Topics = default-mqtt-PubTopic
1450+
Stop doubleResetDetecting
1451+
Saving config file...
1452+
Saving config file OK
1453+
FFFF
1454+
```
1455+
12471456
---
12481457
---
12491458

@@ -1275,6 +1484,12 @@ Sometimes, the library will only work if you update the board core to the latest
12751484

12761485
## Releases
12771486

1487+
### Releases v1.1.1
1488+
1489+
1. Add functions to control Config Portal from software or Virtual Switches. Check [How to trigger a Config Portal from code #25](https://github.com/khoih-prog/Blynk_WM/issues/25)
1490+
2. Fix rare Config Portal bug not updating Config and dynamic Params data successfully in very noisy or weak WiFi situation
1491+
3. To permit autoreset after configurable timeout if DRD/MRD or non-persistent forced-CP. Check [**Good new feature: Blynk.resetAndEnterConfigPortal() Thanks & question #27**](https://github.com/khoih-prog/Blynk_WM/issues/27)
1492+
12781493
### Major Releases v1.1.0
12791494

12801495
1. Add support to LittleFS for ESP32 using [LITTLEFS](https://github.com/lorol/LITTLEFS) Library

0 commit comments

Comments
 (0)