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

Commit cedaea1

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 e9f42df commit cedaea1

File tree

1 file changed

+45
-7
lines changed

1 file changed

+45
-7
lines changed

README.md

Lines changed: 45 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -606,6 +606,33 @@ BlynkTimer timer;
606606
#include <Ticker.h>
607607
Ticker led_ticker;
608608

609+
#define BLYNK_PIN_FORCED_CONFIG V10
610+
#define BLYNK_PIN_FORCED_PERS_CONFIG V20
611+
612+
// Use button V10 (BLYNK_PIN_FORCED_CONFIG) to forced Config Portal
613+
BLYNK_WRITE(BLYNK_PIN_FORCED_CONFIG)
614+
{
615+
if (param.asInt())
616+
{
617+
Serial.println( F("\nCP Button Hit. Rebooting") );
618+
619+
// This will keep CP once, clear after reset, even you didn't enter CP at all.
620+
Blynk.resetAndEnterConfigPortal();
621+
}
622+
}
623+
624+
// Use button V20 (BLYNK_PIN_FORCED_PERS_CONFIG) to forced Persistent Config Portal
625+
BLYNK_WRITE(BLYNK_PIN_FORCED_PERS_CONFIG)
626+
{
627+
if (param.asInt())
628+
{
629+
Serial.println( F("\nPersistent CP Button Hit. Rebooting") );
630+
631+
// This will keep CP forever, until you successfully enter CP, and Save data to clear the flag.
632+
Blynk.resetAndEnterConfigPortalPersistent();
633+
}
634+
}
635+
609636
void set_led(byte status)
610637
{
611638
digitalWrite(LED_BUILTIN, status);
@@ -671,6 +698,8 @@ void setup()
671698
Serial.begin(115200);
672699
while (!Serial);
673700

701+
delay(200);
702+
674703
#if (USE_LITTLEFS)
675704
Serial.print(F("\nStarting ESP32_BLE_WF using LITTLEFS"));
676705
#elif (USE_SPIFFS)
@@ -680,11 +709,12 @@ void setup()
680709
#endif
681710

682711
#if USE_SSL
683-
Serial.println(" with SSL on " + String(ARDUINO_BOARD));
712+
Serial.print(F(" with SSL on "));
684713
#else
685-
Serial.println(" without SSL on " + String(ARDUINO_BOARD));
714+
Serial.print(F(" without SSL on "));
686715
#endif
687716

717+
Serial.println(ARDUINO_BOARD);
688718
Serial.println(BLYNK_ESP32_BT_WF_VERSION);
689719

690720
#if USE_BLYNK_WM
@@ -783,13 +813,15 @@ void setup()
783813
}
784814

785815
#if (USE_BLYNK_WM && USE_DYNAMIC_PARAMETERS)
786-
void displayCredentials(void)
816+
void displayCredentials()
787817
{
788818
Serial.println(F("\nYour stored Credentials :"));
789819

790-
for (int i = 0; i < NUM_MENU_ITEMS; i++)
820+
for (uint16_t i = 0; i < NUM_MENU_ITEMS; i++)
791821
{
792-
Serial.println(String(myMenuItems[i].displayName) + " = " + myMenuItems[i].pdata);
822+
Serial.print(myMenuItems[i].displayName);
823+
Serial.print(F(" = "));
824+
Serial.println(myMenuItems[i].pdata);
793825
}
794826
}
795827
#endif
@@ -813,7 +845,7 @@ void loop()
813845

814846
if (!displayedCredentials)
815847
{
816-
for (int i = 0; i < NUM_MENU_ITEMS; i++)
848+
for (uint16_t i = 0; i < NUM_MENU_ITEMS; i++)
817849
{
818850
if (!strlen(myMenuItems[i].pdata))
819851
{
@@ -885,6 +917,8 @@ void loop()
885917
886918
#if !BLYNK_USE_BLE_ONLY
887919
#if USE_BLYNK_WM
920+
#define USE_DYNAMIC_PARAMETERS true
921+
888922
#warning Please select 1.3MB+ for APP (Minimal SPIFFS (1.9MB APP, OTA), HugeAPP(3MB APP, NoOTA) or NoOA(2MB APP)
889923
#include <BlynkSimpleEsp32_WFM.h>
890924
#else
@@ -1008,7 +1042,11 @@ void loop()
10081042

10091043
#if USE_BLYNK_WM
10101044

1011-
#define USE_DYNAMIC_PARAMETERS true
1045+
#if (USE_DYNAMIC_PARAMETERS)
1046+
#warning USE_DYNAMIC_PARAMETERS
1047+
#endif
1048+
1049+
// USE_DYNAMIC_PARAMETERS defined in defined.h
10121050

10131051
/////////////// Start dynamic Credentials ///////////////
10141052

0 commit comments

Comments
 (0)