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

Commit

Permalink
v1.1.3 to fix invalid "blank" or NULL Config Data treated as Valid
Browse files Browse the repository at this point in the history
### Release v1.1.3

1. Fix invalid "blank" or NULL Config Data treated as Valid. Check [WiFiManager connection attempt to unconfigured ("blank") SSID after restart on SAMD #8](khoih-prog/WiFiManager_NINA_Lite#8)
2. Fix compiler warnings.
  • Loading branch information
khoih-prog committed Apr 12, 2021
1 parent a0acf10 commit 0b7f895
Show file tree
Hide file tree
Showing 34 changed files with 415 additions and 171 deletions.
54 changes: 38 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
* [Currently supported Boards](#currently-supported-boards)
* [Currently supported WiFi shields/modules](#currently-supported-wifi-shieldsmodules)
* [Changelog](#changelog)
* [Release v1.1.3](#release-v113)
* [Release v1.1.2](#release-v112)
* [Major Release v1.1.0](#major-release-v110)
* [Release v1.0.2](#release-v102)
Expand Down Expand Up @@ -178,6 +179,11 @@ This [**WiFiManager_Generic_Lite** library](https://github.com/khoih-prog/WiFiMa

## Changelog

### Release v1.1.3

1. Fix invalid "blank" or NULL Config Data treated as Valid. Check [WiFiManager connection attempt to unconfigured ("blank") SSID after restart on SAMD #8](https://github.com/khoih-prog/WiFiManager_NINA_Lite/issues/8)
2. Fix compiler warnings.

### Release v1.1.2

1. Fix MultiWiFi connection bug. Check [SAMD MultiWiFi issues when first WiFi SSID configured in CP is invalid or not available #6](https://github.com/khoih-prog/WiFiManager_NINA_Lite/issues/6)
Expand Down Expand Up @@ -216,11 +222,11 @@ This [**WiFiManager_Generic_Lite** library](https://github.com/khoih-prog/WiFiMa
3. [`Teensy core 1.51`](https://www.pjrc.com/teensy/td_download.html) for Teensy (4.1, 4.0, 3.6, 3.5, 3,2, 3.1, 3.0, LC) boards
4. [`Arduino SAM DUE core 1.6.12+`](https://github.com/arduino/ArduinoCore-sam) for SAM DUE ARM Cortex-M3 boards
5. [`Arduino SAMD core 1.8.11+`](https://www.arduino.cc/en/Guide/ArduinoM0) for SAMD ARM Cortex-M0+ boards. [![GitHub release](https://img.shields.io/github/release/arduino/ArduinoCore-samd.svg)](https://github.com/arduino/ArduinoCore-samd/releases/latest)
6. [`Adafruit SAMD core 1.6.5+`](https://www.adafruit.com/) for SAMD ARM Cortex-M0+ and M4 boards (Nano 33 IoT, etc.). [![GitHub release](https://img.shields.io/github/release/adafruit/ArduinoCore-samd.svg)](https://github.com/adafruit/ArduinoCore-samd/releases/latest)
6. [`Adafruit SAMD core 1.6.7+`](https://www.adafruit.com/) for SAMD ARM Cortex-M0+ and M4 boards (Nano 33 IoT, etc.). [![GitHub release](https://img.shields.io/github/release/adafruit/ArduinoCore-samd.svg)](https://github.com/adafruit/ArduinoCore-samd/releases/latest)
7. [`Seeeduino SAMD core 1.8.1+`](https://github.com/Seeed-Studio/ArduinoCore-samd) for SAMD21/SAMD51 boards (XIAO M0, Wio Terminal, etc.). [![Latest release](https://img.shields.io/github/release/Seeed-Studio/ArduinoCore-samd.svg)](https://github.com/Seeed-Studio/ArduinoCore-samd/releases/latest/)
8. [`Adafruit nRF52 v0.21.0+`](https://www.adafruit.com) for nRF52 boards such as Adafruit NRF52840_FEATHER, NRF52832_FEATHER, NRF52840_FEATHER_SENSE, NRF52840_ITSYBITSY, NRF52840_CIRCUITPLAY, NRF52840_CLUE, NRF52840_METRO, NRF52840_PCA10056, PARTICLE_XENON, **NINA_B302_ublox**, etc. [![GitHub release](https://img.shields.io/github/release/adafruit/Adafruit_nRF52_Arduino.svg)](https://github.com/adafruit/Adafruit_nRF52_Arduino/releases/latest)
9. [`Functional-VLPP library v1.0.2+`](https://github.com/khoih-prog/functional-vlpp) to use server's lambda function. To install. check [![arduino-library-badge](https://www.ardu-badge.com/badge/Functional-Vlpp.svg?)](https://www.ardu-badge.com/Functional-Vlpp)
10. [`WiFiNINA_Generic library v1.8.2+`](https://github.com/khoih-prog/WiFiNINA_Generic). To install. check [![arduino-library-badge](https://www.ardu-badge.com/badge/WiFiNINA_Generic.svg?)](https://www.ardu-badge.com/WiFiNINA_Generic)
10. [`WiFiNINA_Generic library v1.8.5+`](https://github.com/khoih-prog/WiFiNINA_Generic). To install. check [![arduino-library-badge](https://www.ardu-badge.com/badge/WiFiNINA_Generic.svg?)](https://www.ardu-badge.com/WiFiNINA_Generic)
11. [`WiFiWebServer library v1.1.1+`](https://github.com/khoih-prog/WiFiWebServer). To install. check [![arduino-library-badge](https://www.ardu-badge.com/badge/WiFiWebServer.svg?)](https://www.ardu-badge.com/WiFiWebServer)
12. [`ESP8266_AT_WebServer library v1.1.2+`](https://github.com/khoih-prog/ESP8266_AT_WebServer) to be able to support ESP32-AT shields. To install, check [![arduino-library-badge](https://www.ardu-badge.com/badge/ESP8266_AT_WebServer.svg?)](https://www.ardu-badge.com/ESP8266_AT_WebServer)
13. [`ESP_AT_Lib library v1.0.0+`](https://github.com/khoih-prog/ESP_AT_Lib) if using ESP8288/ESP32-AT shields. To install, check [![arduino-library-badge](https://www.ardu-badge.com/badge/ESP_AT_Lib.svg?)](https://www.ardu-badge.com/ESP_AT_Lib).
Expand Down Expand Up @@ -358,11 +364,11 @@ Whenever the above-mentioned compiler error issue is fixed with the new Arduino

#### 5. For Adafruit SAMD boards

***To be able to automatically detect and display BOARD_NAME on Adafruit SAMD (Itsy-Bitsy M4, etc) boards***, you have to copy the file [Adafruit SAMD platform.txt](Packages_Patches/adafruit/hardware/samd/1.6.5) into Adafruit samd directory (~/.arduino15/packages/adafruit/hardware/samd/1.6.5).
***To be able to automatically detect and display BOARD_NAME on Adafruit SAMD (Itsy-Bitsy M4, etc) boards***, you have to copy the file [Adafruit SAMD platform.txt](Packages_Patches/adafruit/hardware/samd/1.6.6) into Adafruit samd directory (~/.arduino15/packages/adafruit/hardware/samd/1.6.6).

Supposing the Adafruit SAMD core version is 1.6.5. This file must be copied into the directory:
Supposing the Adafruit SAMD core version is 1.6.6. This file must be copied into the directory:

- `~/.arduino15/packages/adafruit/hardware/samd/1.6.5/platform.txt`
- `~/.arduino15/packages/adafruit/hardware/samd/1.6.6/platform.txt`

Whenever a new version is installed, remember to copy this file into the new version directory. For example, new version is x.yy.zz
This file must be copied into the directory:
Expand Down Expand Up @@ -1191,15 +1197,23 @@ void loop()
/////////////////////////////////////////////
// Force some params in Blynk, only valid for library version 1.0.1 and later
#define TIMEOUT_RECONNECT_WIFI 10000L
// Permit running CONFIG_TIMEOUT_RETRYTIMES_BEFORE_RESET times before reset hardware
// to permit user another chance to config. Only if Config Data is valid.
// If Config Data is invalid, this has no effect as Config Portal will persist
#define RESET_IF_CONFIG_TIMEOUT true
// Permitted range of user-defined RETRY_TIMES_RECONNECT_WIFI between 2-5 times
#define RETRY_TIMES_RECONNECT_WIFI 3
// Permitted range of user-defined CONFIG_TIMEOUT_RETRYTIMES_BEFORE_RESET between 2-100
#define CONFIG_TIMEOUT_RETRYTIMES_BEFORE_RESET 5
// Config Timeout 120s (default 60s)
#define CONFIG_TIMEOUT 120000L
// Config Timeout 120s (default 60s). Applicable only if Config Data is Valid
#define CONFIG_TIMEOUT 120000L
#define USE_DYNAMIC_PARAMETERS true
#define USE_DYNAMIC_PARAMETERS true
/////////////////////////////////////////////
#if (USE_WIFI_CUSTOM && USE_ESP_AT_SHIELD)
// ESP-AT can use longer than 2K HTML and DYNAMIC_PARAMETERS
Expand Down Expand Up @@ -1383,7 +1397,7 @@ This is the terminal output when running [**SAMD_WiFi**](examples/SAMD_WiFi) exa

```
Start SAMD_WiFi on SAMD_NANO_33_IOT with WiFiNINA using WiFiNINA_Generic Library
WiFiManager_Generic_Lite v1.1.2
WiFiManager_Generic_Lite v1.1.3
[WG] Hostname=SAMD-Master-Controller
Flag read = 0xffffffff
No doubleResetDetected
Expand Down Expand Up @@ -1484,7 +1498,7 @@ FFFFFFFFF

```
Start SAMD_WiFi on SAMD_NANO_33_IOT with WiFiNINA using WiFiNINA_Generic Library
WiFiManager_Generic_Lite v1.1.2
WiFiManager_Generic_Lite v1.1.3
[WG] Hostname=SAMD-Master-Controller
Flag read = 0xd0d04321
No doubleResetDetected
Expand Down Expand Up @@ -1548,7 +1562,7 @@ HHHHHHHHHH HHHHHHHHHH

```
Start SAMD_WiFi on SAMD_NANO_33_IOT with WiFiNINA using WiFiNINA_Generic Library
WiFiManager_Generic_Lite v1.1.2
WiFiManager_Generic_Lite v1.1.3
[WG] Hostname=SAMD-Master-Controller
Flag read = 0xd0d04321
No doubleResetDetected
Expand Down Expand Up @@ -1612,7 +1626,7 @@ FF

```
Start SAMD_WiFi on SAMD_NANO_33_IOT with WiFiNINA using WiFiNINA_Generic Library
WiFiManager_Generic_Lite v1.1.2
WiFiManager_Generic_Lite v1.1.3
[WG] Hostname=SAMD-Master-Controller
Flag read = 0xd0d04321
No doubleResetDetected
Expand Down Expand Up @@ -1668,7 +1682,7 @@ HHHHHHHHH HHHHHHHHHH

```
Start SAMD_WiFi on SAMD_NANO_33_IOT with WiFiNINA using WiFiNINA_Generic Library
WiFiManager_Generic_Lite v1.1.2
WiFiManager_Generic_Lite v1.1.3
[WG] Hostname=SAMD-Master-Controller
Flag read = 0xd0d01234
doubleResetDetected
Expand Down Expand Up @@ -1743,6 +1757,11 @@ Sometimes, the library will only work if you update the `Generic WiFi module/shi

## Releases

### Release v1.1.3

1. Fix invalid "blank" or NULL Config Data treated as Valid. Check [WiFiManager connection attempt to unconfigured ("blank") SSID after restart on SAMD #8](https://github.com/khoih-prog/WiFiManager_NINA_Lite/issues/8)
2. Fix compiler warnings.

### Release v1.1.2

1. Fix MultiWiFi connection bug. Check [SAMD MultiWiFi issues when first WiFi SSID configured in CP is invalid or not available #6](https://github.com/khoih-prog/WiFiManager_NINA_Lite/issues/6)
Expand Down Expand Up @@ -1819,7 +1838,10 @@ Submit issues to: [WiFiManager_Generic_Lite issues](https://github.com/khoih-pro
Please help contribute to this project and add your name here.

1. Thanks to [Max Gerhardt in GitHub](https://github.com/maxgerhardt) and [in PIO](https://community.platformio.org/u/maxgerhardt) for the useful fix [**attachInterrupt() on wifi101 unidentified**](https://community.platformio.org/t/attachinterrupt-on-wifi101-unidentified/17543) to enable STM32F/L/H/G/WB/MP1 using ATWINC1500/WiFi101, leading to new v1.0.2
2. Thanks to [Michael "bizprof"](https://github.com/bizprof) to report bug in [SAMD MultiWiFi issues when first WiFi SSID configured in CP is invalid or not available #6](https://github.com/khoih-prog/WiFiManager_NINA_Lite/issues/6) leading to v1.1.2.
2. Thanks to [Michael "bizprof"](https://github.com/bizprof) to report bugs in
- [SAMD MultiWiFi issues when first WiFi SSID configured in CP is invalid or not available #6](https://github.com/khoih-prog/WiFiManager_NINA_Lite/issues/6) leading to v1.1.2.
- [WiFiManager connection attempt to unconfigured ("blank") SSID after restart on SAMD #8](https://github.com/khoih-prog/WiFiManager_NINA_Lite/issues/8) leading to v1.1.3.


<table>
<tr>
Expand Down
3 changes: 2 additions & 1 deletion examples/MKR1000_WiFi101/MKR1000_WiFi101.ino
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
Built by Khoi Hoang https://github.com/khoih-prog/WiFiManager_Generic_Lite
Licensed under MIT license
Version: 1.1.2
Version: 1.1.3
Version Modified By Date Comments
------- ----------- ---------- -----------
Expand All @@ -18,6 +18,7 @@
1.1.0 K Hoang 21/02/2021 Optimize code and use better FlashStorage_SAMD and FlashStorage_STM32.
Add customs HTML header feature. Fix bug.
1.1.2 K Hoang 30/03/2021 Fix MultiWiFi connection bug.
1.1.3 K Hoang 12/04/2021 Fix invalid "blank" Config Data treated as Valid.
*****************************************************************************************************************************/

#include "defines.h"
Expand Down
16 changes: 12 additions & 4 deletions examples/MKR1000_WiFi101/defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,16 +71,24 @@

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

// Force some params in Blynk, only valid for library version 1.0.1 and later
#define TIMEOUT_RECONNECT_WIFI 10000L
// Permit running CONFIG_TIMEOUT_RETRYTIMES_BEFORE_RESET times before reset hardware
// to permit user another chance to config. Only if Config Data is valid.
// If Config Data is invalid, this has no effect as Config Portal will persist
#define RESET_IF_CONFIG_TIMEOUT true

// Permitted range of user-defined RETRY_TIMES_RECONNECT_WIFI between 2-5 times
#define RETRY_TIMES_RECONNECT_WIFI 3

// Permitted range of user-defined CONFIG_TIMEOUT_RETRYTIMES_BEFORE_RESET between 2-100
#define CONFIG_TIMEOUT_RETRYTIMES_BEFORE_RESET 5

// Config Timeout 120s (default 60s)
#define CONFIG_TIMEOUT 120000L
// Config Timeout 120s (default 60s). Applicable only if Config Data is Valid
#define CONFIG_TIMEOUT 120000L

#define USE_DYNAMIC_PARAMETERS true

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

#include <WiFiManager_Generic_Lite_SAMD.h>

#define HOST_NAME "SAMD-Master-Controller"
Expand Down
3 changes: 2 additions & 1 deletion examples/MKR1000_WiFi101_MQTT/MKR1000_WiFi101_MQTT.ino
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
Built by Khoi Hoang https://github.com/khoih-prog/WiFiManager_Generic_Lite
Licensed under MIT license
Version: 1.1.2
Version: 1.1.3
Version Modified By Date Comments
------- ----------- ---------- -----------
Expand All @@ -18,6 +18,7 @@
1.1.0 K Hoang 21/02/2021 Optimize code and use better FlashStorage_SAMD and FlashStorage_STM32.
Add customs HTML header feature. Fix bug.
1.1.2 K Hoang 30/03/2021 Fix MultiWiFi connection bug.
1.1.3 K Hoang 12/04/2021 Fix invalid "blank" Config Data treated as Valid.
*****************************************************************************************************************************/
/****************************************************************************************************************************
You have to modify file ./libraries/Adafruit_MQTT_Library/Adafruit_MQTT.cpp as follows to avoid dtostrf error, if exists
Expand Down
16 changes: 12 additions & 4 deletions examples/MKR1000_WiFi101_MQTT/defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,16 +71,24 @@

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

// Force some params in Blynk, only valid for library version 1.0.1 and later
#define TIMEOUT_RECONNECT_WIFI 10000L
// Permit running CONFIG_TIMEOUT_RETRYTIMES_BEFORE_RESET times before reset hardware
// to permit user another chance to config. Only if Config Data is valid.
// If Config Data is invalid, this has no effect as Config Portal will persist
#define RESET_IF_CONFIG_TIMEOUT true

// Permitted range of user-defined RETRY_TIMES_RECONNECT_WIFI between 2-5 times
#define RETRY_TIMES_RECONNECT_WIFI 3

// Permitted range of user-defined CONFIG_TIMEOUT_RETRYTIMES_BEFORE_RESET between 2-100
#define CONFIG_TIMEOUT_RETRYTIMES_BEFORE_RESET 5

// Config Timeout 120s (default 60s)
#define CONFIG_TIMEOUT 120000L
// Config Timeout 120s (default 60s). Applicable only if Config Data is Valid
#define CONFIG_TIMEOUT 120000L

#define USE_DYNAMIC_PARAMETERS true

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

#include <WiFiManager_Generic_Lite_SAMD.h>

#define HOST_NAME "SAMD-MQTT-Controller"
Expand Down
3 changes: 2 additions & 1 deletion examples/SAMD_WiFi/SAMD_WiFi.ino
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
Built by Khoi Hoang https://github.com/khoih-prog/WiFiManager_Generic_Lite
Licensed under MIT license
Version: 1.1.2
Version: 1.1.3
Version Modified By Date Comments
------- ----------- ---------- -----------
Expand All @@ -18,6 +18,7 @@
1.1.0 K Hoang 21/02/2021 Optimize code and use better FlashStorage_SAMD and FlashStorage_STM32.
Add customs HTML header feature. Fix bug.
1.1.2 K Hoang 30/03/2021 Fix MultiWiFi connection bug.
1.1.3 K Hoang 12/04/2021 Fix invalid "blank" Config Data treated as Valid.
*****************************************************************************************************************************/

#include "defines.h"
Expand Down
18 changes: 13 additions & 5 deletions examples/SAMD_WiFi/defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -208,15 +208,23 @@

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

// Force some params in Blynk, only valid for library version 1.0.1 and later
#define TIMEOUT_RECONNECT_WIFI 10000L
// Permit running CONFIG_TIMEOUT_RETRYTIMES_BEFORE_RESET times before reset hardware
// to permit user another chance to config. Only if Config Data is valid.
// If Config Data is invalid, this has no effect as Config Portal will persist
#define RESET_IF_CONFIG_TIMEOUT true

// Permitted range of user-defined RETRY_TIMES_RECONNECT_WIFI between 2-5 times
#define RETRY_TIMES_RECONNECT_WIFI 3

// Permitted range of user-defined CONFIG_TIMEOUT_RETRYTIMES_BEFORE_RESET between 2-100
#define CONFIG_TIMEOUT_RETRYTIMES_BEFORE_RESET 5

// Config Timeout 120s (default 60s)
#define CONFIG_TIMEOUT 120000L
// Config Timeout 120s (default 60s). Applicable only if Config Data is Valid
#define CONFIG_TIMEOUT 120000L

#define USE_DYNAMIC_PARAMETERS true
#define USE_DYNAMIC_PARAMETERS true

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

#if (USE_WIFI_CUSTOM && USE_ESP_AT_SHIELD)
// ESP-AT can use longer than 2K HTML and DYNAMIC_PARAMETERS
Expand Down
3 changes: 2 additions & 1 deletion examples/SAMD_WiFi_MQTT/SAMD_WiFi_MQTT.ino
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
Built by Khoi Hoang https://github.com/khoih-prog/WiFiManager_Generic_Lite
Licensed under MIT license
Version: 1.1.2
Version: 1.1.3
Version Modified By Date Comments
------- ----------- ---------- -----------
Expand All @@ -18,6 +18,7 @@
1.1.0 K Hoang 21/02/2021 Optimize code and use better FlashStorage_SAMD and FlashStorage_STM32.
Add customs HTML header feature. Fix bug.
1.1.2 K Hoang 30/03/2021 Fix MultiWiFi connection bug.
1.1.3 K Hoang 12/04/2021 Fix invalid "blank" Config Data treated as Valid.
*****************************************************************************************************************************/
/****************************************************************************************************************************
You have to modify file ./libraries/Adafruit_MQTT_Library/Adafruit_MQTT.cpp as follows to avoid dtostrf error, if exists
Expand Down
18 changes: 13 additions & 5 deletions examples/SAMD_WiFi_MQTT/defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -221,15 +221,23 @@

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

// Force some params in Blynk, only valid for library version 1.0.1 and later
#define TIMEOUT_RECONNECT_WIFI 10000L
// Permit running CONFIG_TIMEOUT_RETRYTIMES_BEFORE_RESET times before reset hardware
// to permit user another chance to config. Only if Config Data is valid.
// If Config Data is invalid, this has no effect as Config Portal will persist
#define RESET_IF_CONFIG_TIMEOUT true

// Permitted range of user-defined RETRY_TIMES_RECONNECT_WIFI between 2-5 times
#define RETRY_TIMES_RECONNECT_WIFI 3

// Permitted range of user-defined CONFIG_TIMEOUT_RETRYTIMES_BEFORE_RESET between 2-100
#define CONFIG_TIMEOUT_RETRYTIMES_BEFORE_RESET 5

// Config Timeout 120s (default 60s)
#define CONFIG_TIMEOUT 120000L
// Config Timeout 120s (default 60s). Applicable only if Config Data is Valid
#define CONFIG_TIMEOUT 120000L

#define USE_DYNAMIC_PARAMETERS true
#define USE_DYNAMIC_PARAMETERS true

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

#if (USE_WIFI_CUSTOM && USE_ESP_AT_SHIELD)
// ESP-AT can use longer than 2K HTML and DYNAMIC_PARAMETERS
Expand Down
3 changes: 2 additions & 1 deletion examples/SAM_DUE_WiFi/SAM_DUE_WiFi.ino
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
Built by Khoi Hoang https://github.com/khoih-prog/WiFiManager_Generic_Lite
Licensed under MIT license
Version: 1.1.2
Version: 1.1.3
Version Modified By Date Comments
------- ----------- ---------- -----------
Expand All @@ -18,6 +18,7 @@
1.1.0 K Hoang 21/02/2021 Optimize code and use better FlashStorage_SAMD and FlashStorage_STM32.
Add customs HTML header feature. Fix bug.
1.1.2 K Hoang 30/03/2021 Fix MultiWiFi connection bug.
1.1.3 K Hoang 12/04/2021 Fix invalid "blank" Config Data treated as Valid.
*****************************************************************************************************************************/
#include "defines.h"
#include "Credentials.h"
Expand Down
Loading

0 comments on commit 0b7f895

Please sign in to comment.