Skip to content
This repository has been archived by the owner on Jan 29, 2023. It is now read-only.

Commit

Permalink
v1.6.3 to add optional CONFIG_MODE_LED
Browse files Browse the repository at this point in the history
### Release v1.6.3

1. Add optional `CONFIG_MODE_LED` to be `ON` when in Config Portal mode. Check [Knowing when configuration mode is on or off #26](#26)
2. Add function `isConfigMode()` to signal system is in Config Portal mode.
  • Loading branch information
khoih-prog committed Feb 21, 2022
1 parent 4272985 commit 0c0ee84
Show file tree
Hide file tree
Showing 38 changed files with 612 additions and 223 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Arduino IDE version: 1.8.19
Nano_RP2040_Connect board
ArduinoCore-mbed v2.6.1
OS: Ubuntu 20.04 LTS
Linux xy-Inspiron-3593 5.4.0-99-generic #112-Ubuntu SMP Thu Feb 3 13:50:55 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
Linux xy-Inspiron-3593 5.4.0-100-generic #113-Ubuntu SMP Thu Feb 3 18:43:29 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
Context:
The board couldn't autoreconnect to Local Blynk Server after router power recycling.
Expand Down
71 changes: 50 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
[![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](#Contributing)
[![GitHub issues](https://img.shields.io/github/issues/khoih-prog/WiFiManager_NINA_Lite.svg)](http://github.com/khoih-prog/WiFiManager_NINA_Lite/issues)

<a href="https://www.buymeacoffee.com/khoihprog6" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Buy Me A Coffee" style="height: 50px !important;width: 181px !important;" ></a>
<a href="https://www.buymeacoffee.com/khoihprog6" title="Donate to my libraries using BuyMeACoffee"><img src="https://img.shields.io/badge/buy%20me%20a%20coffee-donate-orange.svg?logo=buy-me-a-coffee&logoColor=FFDD00" style="height: 20px !important;width: 200px !important;" ></a>

<a href="https://www.buymeacoffee.com/khoihprog6" title="Donate to my libraries using BuyMeACoffee"><img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Donate to my libraries using BuyMeACoffee" style="height: 50px !important;width: 181px !important;" ></a>

---
---
Expand Down Expand Up @@ -1072,14 +1074,21 @@ Please be noted that the following **reserved names are already used in library*
#include "Credentials.h"
#include "dynamicParams.h"

WiFiManager_NINA_Lite* WiFiManager_NINA;

void heartBeatPrint(void)
{
static int num = 1;

if (WiFi.status() == WL_CONNECTED)
Serial.print("H"); // H means connected to WiFi
else
Serial.print("F"); // F means not connected to WiFi
{
if (WiFiManager_NINA->isConfigMode())
Serial.print("C"); // C means in Config Mode
else
Serial.print("F"); // F means not connected to WiFi
}

if (num == 80)
{
Expand All @@ -1106,8 +1115,6 @@ void check_status()
}
}

WiFiManager_NINA_Lite* WiFiManager_NINA;

#if USING_CUSTOMS_STYLE
const char NewCustomsStyle[] /*PROGMEM*/ = "<style>div,input{padding:5px;font-size:1em;}input{width:95%;}body{text-align: center;}\
button{background-color:blue;color:white;line-height:2.4rem;font-size:1.2rem;width:100%;}fieldset{border-radius:0.3rem;margin:0px;}</style>";
Expand Down Expand Up @@ -1385,6 +1392,23 @@ void loop()
/////////////////////////////////////////////
// Optional, to use Board Name in Menu
#define USING_CONFIG_MODE_LED true
#if USING_CONFIG_MODE_LED
#if defined(LED_BUILTIN)
#define CONFIG_MODE_LED LED_BUILTIN
#else
// Using default pin 13 for CONFIG_MODE_LED. To be changed as necessary
#define CONFIG_MODE_LED 13
#endif
#define LED_ON HIGH
#define LED_OFF LOW
#endif
/////////////////////////////////////////////
#include <WiFiManager_NINA_Lite_SAMD.h>
#define HOST_NAME "SAMD-Master-Controller"
Expand Down Expand Up @@ -1560,7 +1584,7 @@ This is the terminal output when running [**SAMD_WiFiNINA**](examples/SAMD_WiFiN

```
Starting SAMD_WiFiNINA on SAMD NANO_33_IOT
WiFiManager_NINA_Lite v1.6.2
WiFiManager_NINA_Lite v1.6.3
[WN] Hostname=SAMD-Master-Controller
Flag read = 0xffffffff
No doubleResetDetected
Expand Down Expand Up @@ -1595,7 +1619,7 @@ SetFlag write = 0xd0d01234
[WN] IP=192.168.4.1,CH=10
WiFi-beginAP3: return1 = 7
WiFi-beginAP3: return2 = 7
F
C
Your stored Credentials :
Blynk Server1 = account.duckdns.org
Token1 = token1
Expand All @@ -1605,14 +1629,14 @@ Port = 8080
MQTT Server = mqtt.duckdns.org
Stop doubleResetDetecting
ClearFlag write = 0xd0d04321
FFFFFFFFF
CCCCCCCCC
```

#### 1.2 Received data from Config Portal

```
Start SAMD_WiFiNINA on SAMD NANO_33_IOT
WiFiManager_NINA_Lite v1.6.2
WiFiManager_NINA_Lite v1.6.3
[WN] Hostname=SAMD-WIFININA51F485
[WN] CrCCSum=44880,CrRCSum=-1
[WN] CCSum=53040,RCSum=-1
Expand All @@ -1636,7 +1660,7 @@ Blynk Server2 = blank
Token2 = blank
Port = blank
MQTT Server = blank
FFFFFFFFF
CCCCCCCCC
[WN] h:sv1=BlynkServer1
[WN] h:tk1=Token1
[WN] h:sv2=BlynkServer2
Expand All @@ -1659,7 +1683,7 @@ FFFFFFFFF

```
Start SAMD_WiFiNINA on SAMD NANO_33_IOT
WiFiManager_NINA_Lite v1.6.2
WiFiManager_NINA_Lite v1.6.3
[WN] Hostname=SAMD-Master-Controller
Flag read = 0xd0d04321
No doubleResetDetected
Expand Down Expand Up @@ -1736,7 +1760,7 @@ HHHHHHHHHH HHHHHHHHHH

```
Start SAMD_WiFiNINA on SAMD NANO_33_IOT
WiFiManager_NINA_Lite v1.6.2
WiFiManager_NINA_Lite v1.6.3
[WN] Hostname=SAMD-Master-Controller
Flag read = 0xd0d04321
No doubleResetDetected
Expand Down Expand Up @@ -1785,22 +1809,22 @@ WiFi-beginAP3: return1 = 7
WiFi-beginAP3: return2 = 7
Stop doubleResetDetecting
ClearFlag write = 0xd0d04321
F
C
Your stored Credentials :
Blynk Server1 = new_account.duckdns.org
Token1 = new_token1
Blynk Server2 = new_account.ddns.net
Token2 = new_token2
Port = 8080
MQTT Server = new_mqtt.duckdns.org
FF
CCCC
```

#### 1.6 DRD Not Detected

```
Start SAMD_WiFiNINA on SAMD NANO_33_IOT
WiFiManager_NINA_Lite v1.6.2
WiFiManager_NINA_Lite v1.6.3
[WN] Hostname=SAMD-Master-Controller
Flag read = 0xd0d04321
No doubleResetDetected
Expand Down Expand Up @@ -1856,7 +1880,7 @@ HHHHHHHHH HHHHHHHHHH

```
Start SAMD_WiFiNINA on SAMD NANO_33_IOT
WiFiManager_NINA_Lite v1.6.2
WiFiManager_NINA_Lite v1.6.3
[WN] Hostname=SAMD-Master-Controller
Flag read = 0xd0d01234
doubleResetDetected
Expand Down Expand Up @@ -1891,15 +1915,15 @@ ClearFlag write = 0xd0d04321
[WN] IP=192.168.4.1,CH=10
WiFi-beginAP3: return1 = 7
WiFi-beginAP3: return2 = 7
F
C
Your stored Credentials :
Blynk Server1 = new_account.duckdns.org
Token1 = new_token1
Blynk Server2 = new_account.ddns.net
Token2 = new_token2
Port = 8080
MQTT Server = new_mqtt.duckdns.org
CCCCCC
```

---
Expand All @@ -1912,7 +1936,7 @@ This is the terminal output when running [**RP2040_WiFiNINA_MQTT**](examples/RP2

```
Starting RP2040_WiFiNINA_MQTT on MBED NANO_RP2040_CONNECT
WiFiManager_NINA_Lite v1.6.2
WiFiManager_NINA_Lite v1.6.3
[WN] Hostname=RP2040-Master-Controller
LittleFS size (KB) = 64
LittleFS Mount OK
Expand Down Expand Up @@ -1943,7 +1967,7 @@ SetFlag write = 0xd0d01234
[WN] OK
[WN] SSID=WIFININA_51F485,PW=MyWIFININA_51F485
[WN] IP=192.168.4.1,CH=9
N
C
Your stored Credentials :
AIO_SERVER = io.adafruit.com
AIO_SERVERPORT = 1883
Expand All @@ -1956,15 +1980,15 @@ Saving to DRD file : 0xd0d04321
Saving DRD file OK
LittleFS Flag read = 0xd0d04321
ClearFlag write = 0xd0d04321
N
CCCCCC
```

#### 2.2 Config Data Saved => Connect to AIO


```
Starting RP2040_WiFiNINA_MQTT on MBED NANO_RP2040_CONNECT
WiFiManager_NINA_Lite v1.6.2
WiFiManager_NINA_Lite v1.6.3
[WN] Hostname=RP2040-Master-Controller
LittleFS size (KB) = 64
LittleFS Mount OK
Expand Down Expand Up @@ -2084,6 +2108,9 @@ Sometimes, the library will only work if you update the `WiFiNINA module/shield`
24. Add support to generic SAMD21 boards : `__SAMD21E1xA__`, `__SAMD21G1xA__` and `__SAMD21J1xA__`
25. Optimize code by passing by `reference` instead of `value`
26. Optional `Board_Name` in Config Portal
27. Add optional `CONFIG_MODE_LED` to be `ON` when in Config Portal mode.
28. Add function `isConfigMode()` to signal system is in Config Portal mode


---
---
Expand All @@ -2108,6 +2135,7 @@ Submit issues to: [WiFiManager_NINA_Lite issues](https://github.com/khoih-prog/W
6. Again thanks to [Michael H. "bizprof"](https://github.com/bizprof) to be `collaborator, co-author/maintainer` of this library. With the impressive new introducing feature :
- `Enable scan of WiFi networks for selection in Configuration Portal`. Check [PR for v1.3.0 - Enable scan of WiFi networks #10](https://github.com/khoih-prog/WiFiManager_NINA_Lite/pull/10) leading to v1.3.0
7. Thanks to [tomtobback](https://github.com/tomtobback) to report issue [retries block the main loop #18](https://github.com/khoih-prog/WiFiManager_NINA_Lite/issues/18) leading to version v1.5.0 and v1.6.0 to fix the blocking issue in loop() with `WIFI_RECON_INTERVAL`.
8. Thanks to [nicogou](https://github.com/nicogou) to post enhancement request [Knowing when configuration mode is on or off #26](https://github.com/khoih-prog/WiFiManager_NINA_Lite/issues/26) leading to version v1.6.3 to add optional `CONFIG_MODE_LED` and function `isConfigMode()`



Expand All @@ -2119,6 +2147,7 @@ Submit issues to: [WiFiManager_NINA_Lite issues](https://github.com/khoih-prog/W
<td align="center"><a href="https://github.com/piecol"><img src="https://github.com/piecol.png" width="100px;" alt="piecol"/><br /><sub><b>Pierluigi Colangeli</b></sub></a><br /></td>
<td align="center"><a href="https://github.com/bizprof"><img src="https://github.com/bizprof.png" width="100px;" alt="bizprof"/><br /><sub><b>⭐️⭐️ Michael H. "bizprof"</b></sub></a><br /></td>
<td align="center"><a href="https://github.com/tomtobback"><img src="https://github.com/tomtobback.png" width="100px;" alt="tomtobback"/><br /><sub><b>tomtobback</b></sub></a><br /></td>
<td align="center"><a href="https://github.com/nicogou"><img src="https://github.com/nicogou.png" width="100px;" alt="nicogou"/><br /><sub><b>nicogou</b></sub></a><br /></td>
</tr>
</table>

Expand Down
6 changes: 6 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
## Table of Contents

* [Changelog](#changelog)
* [Release v1.6.3](#release-v163)
* [Release v1.6.2](#release-v162)
* [Release v1.6.1](#release-v161)
* [Major Release v1.6.0](#major-release-v160)
Expand All @@ -38,6 +39,11 @@

## Changelog

### Release v1.6.3

1. Add optional `CONFIG_MODE_LED` to be `ON` when in Config Portal mode. Check [Knowing when configuration mode is on or off #26](https://github.com/khoih-prog/WiFiManager_NINA_Lite/issues/26)
2. Add function `isConfigMode()` to signal system is in Config Portal mode.

### Release v1.6.2

1. Optimize code by passing by `reference` instead of `value`
Expand Down
11 changes: 8 additions & 3 deletions examples/RP2040_WiFiNINA/RP2040_WiFiNINA.ino
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,21 @@
#include "Credentials.h"
#include "dynamicParams.h"

WiFiManager_NINA_Lite* WiFiManager_NINA;

void heartBeatPrint(void)
{
static int num = 1;

if (WiFi.status() == WL_CONNECTED)
Serial.print("H"); // H means connected to WiFi
else
Serial.print("F"); // F means not connected to WiFi
{
if (WiFiManager_NINA->isConfigMode())
Serial.print("C"); // C means in Config Mode
else
Serial.print("F"); // F means not connected to WiFi
}

if (num == 80)
{
Expand All @@ -48,8 +55,6 @@ void check_status()
}
}

WiFiManager_NINA_Lite* WiFiManager_NINA;

#if USING_CUSTOMS_STYLE
const char NewCustomsStyle[] /*PROGMEM*/ = "<style>div,input{padding:5px;font-size:1em;}input{width:95%;}body{text-align: center;}\
button{background-color:blue;color:white;line-height:2.4rem;font-size:1.2rem;width:100%;}fieldset{border-radius:0.3rem;margin:0px;}</style>";
Expand Down
17 changes: 17 additions & 0 deletions examples/RP2040_WiFiNINA/defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,23 @@

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

// Optional, to use Board Name in Menu
#define USING_CONFIG_MODE_LED true

#if USING_CONFIG_MODE_LED
#if defined(LED_BUILTIN)
#define CONFIG_MODE_LED LED_BUILTIN
#else
// Using default pin 13 for CONFIG_MODE_LED. To be changed as necessary
#define CONFIG_MODE_LED 13
#endif

#define LED_ON HIGH
#define LED_OFF LOW
#endif

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

#include <WiFiManager_NINA_Lite_RP2040.h>

#define HOST_NAME "RP2040-Master-Controller"
Expand Down
9 changes: 7 additions & 2 deletions examples/RP2040_WiFiNINA_MQTT/RP2040_WiFiNINA_MQTT.ino
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,14 @@ void heartBeatPrint(void)
static int num = 1;

if (WiFi.status() == WL_CONNECTED)
Serial.print("W"); // W means connected to WiFi
Serial.print("H"); // H means connected to WiFi
else
Serial.print("N"); // N means not connected to WiFi
{
if (WiFiManager_NINA->isConfigMode())
Serial.print("C"); // C means in Config Mode
else
Serial.print("F"); // F means not connected to WiFi
}

if (num == 40)
{
Expand Down
17 changes: 17 additions & 0 deletions examples/RP2040_WiFiNINA_MQTT/defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,23 @@

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

// Optional, to use Board Name in Menu
#define USING_CONFIG_MODE_LED true

#if USING_CONFIG_MODE_LED
#if defined(LED_BUILTIN)
#define CONFIG_MODE_LED LED_BUILTIN
#else
// Using default pin 13 for CONFIG_MODE_LED. To be changed as necessary
#define CONFIG_MODE_LED 13
#endif

#define LED_ON HIGH
#define LED_OFF LOW
#endif

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

#include <WiFiManager_NINA_Lite_RP2040.h>

#define HOST_NAME "RP2040-Master-Controller"
Expand Down
Loading

0 comments on commit 0c0ee84

Please sign in to comment.