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

PR for v1.3.0 - Enable scan of WiFi networks #10

Merged
merged 16 commits into from
Apr 23, 2021
Merged
7 changes: 4 additions & 3 deletions examples/Mega_WiFiNINA/Mega_WiFiNINA.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_NINA_Lite
Licensed under MIT license
Version: 1.2.0
Version: 1.3.0

Version Modified By Date Comments
------- ----------- ---------- -----------
Expand All @@ -19,12 +19,13 @@
SSID password maxlen is 63 now. Permit special chars # and % in input data.
1.0.4 K Hoang 04/05/2020 Add Configurable Config Portal Title, Default Config Data and DRD. Update examples.
1.0.5 K Hoang 11/07/2020 Modify LOAD_DEFAULT_CONFIG_DATA logic. Enhance MultiWiFi connection logic. Add MQTT examples.
1.1.0 K Hoang 19/02/2021 Optimize code and use better FlashStorage_SAMD and FlashStorage_STM32.
1.1.0 K Hoang 19/02/2021 Optimize code and use better FlashStorage_SAMD and FlashStorage_STM32.
Add customs HTML header feature. Fix bug.
1.1.1 K Hoang 13/03/2021 Fix USE_DYNAMIC_PARAMETERS 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.
1.2.0 K Hoang 14/04/2021 Optional one set of WiFi Credentials. Enforce WiFi PWD minimum 8 chars
1.3.0 Michael H 21/04/2021 Enable scan of WiFi networks for selection in Configuration Portal
**********************************************************************************************************************************/

#include "defines.h"
Expand Down Expand Up @@ -67,7 +68,7 @@ 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;}\
const char NewCustomsStyle[] /*PROGMEM*/ = "<style>div,input,select{padding:5px;font-size:1em;}input,select{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>";
#endif

Expand Down
7 changes: 4 additions & 3 deletions examples/SAMD_WiFiNINA/SAMD_WiFiNINA.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_NINA_Lite
Licensed under MIT license
Version: 1.2.0
Version: 1.3.0

Version Modified By Date Comments
------- ----------- ---------- -----------
Expand All @@ -19,12 +19,13 @@
SSID password maxlen is 63 now. Permit special chars # and % in input data.
1.0.4 K Hoang 04/05/2020 Add Configurable Config Portal Title, Default Config Data and DRD. Update examples.
1.0.5 K Hoang 11/07/2020 Modify LOAD_DEFAULT_CONFIG_DATA logic. Enhance MultiWiFi connection logic. Add MQTT examples.
1.1.0 K Hoang 19/02/2021 Optimize code and use better FlashStorage_SAMD and FlashStorage_STM32.
1.1.0 K Hoang 19/02/2021 Optimize code and use better FlashStorage_SAMD and FlashStorage_STM32.
Add customs HTML header feature. Fix bug.
1.1.1 K Hoang 13/03/2021 Fix USE_DYNAMIC_PARAMETERS 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.
1.2.0 K Hoang 14/04/2021 Optional one set of WiFi Credentials. Enforce WiFi PWD minimum 8 chars
1.3.0 Michael H 21/04/2021 Enable scan of WiFi networks for selection in Configuration Portal
**********************************************************************************************************************************/

#include "defines.h"
Expand Down Expand Up @@ -68,7 +69,7 @@ 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;}\
const char NewCustomsStyle[] /*PROGMEM*/ = "<style>div,input,select{padding:5px;font-size:1em;}input,select{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>";
#endif

Expand Down
14 changes: 12 additions & 2 deletions examples/SAMD_WiFiNINA/defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#define DEBUG_WIFI_WEBSERVER_PORT Serial
#define WIFININA_DEBUG_OUTPUT Serial

#define _WIFININA_LOGLEVEL_ 2
#define _WIFININA_LOGLEVEL_ 1

#define DRD_GENERIC_DEBUG true

Expand Down Expand Up @@ -47,7 +47,7 @@
#elif defined(ARDUINO_SAMD_NANO_33_IOT)
#define BOARD_TYPE "SAMD NANO_33_IOT"
#elif defined(ARDUINO_SAMD_MKRFox1200)
#define BOARD_TYPE "SAMD MKRFox1200"
#define BOARD_TYPE "SAMD MKRFox1200"
#elif ( defined(ARDUINO_SAMD_MKRWAN1300) || defined(ARDUINO_SAMD_MKRWAN1310) )
#define BOARD_TYPE "SAMD MKRWAN13X0"
#elif defined(ARDUINO_SAMD_MKRGSM1400)
Expand Down Expand Up @@ -166,6 +166,16 @@

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

#define SCAN_WIFI_NETWORKS true

// To be able to manually input SSID, not from a scanned SSID lists
#define MANUAL_SSID_INPUT_ALLOWED true

// From 2-15
#define MAX_SSID_IN_LIST 6

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

#include <WiFiManager_NINA_Lite_SAMD.h>

#define HOST_NAME "SAMD-Master-Controller"
Expand Down
7 changes: 4 additions & 3 deletions examples/SAMD_WiFiNINA_MQTT/SAMD_WiFiNINA_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_NINA_Lite
Licensed under MIT license
Version: 1.2.0
Version: 1.3.0

Version Modified By Date Comments
------- ----------- ---------- -----------
Expand All @@ -19,12 +19,13 @@
SSID password maxlen is 63 now. Permit special chars # and % in input data.
1.0.4 K Hoang 04/05/2020 Add Configurable Config Portal Title, Default Config Data and DRD. Update examples.
1.0.5 K Hoang 11/07/2020 Modify LOAD_DEFAULT_CONFIG_DATA logic. Enhance MultiWiFi connection logic. Add MQTT examples.
1.1.0 K Hoang 19/02/2021 Optimize code and use better FlashStorage_SAMD and FlashStorage_STM32.
1.1.0 K Hoang 19/02/2021 Optimize code and use better FlashStorage_SAMD and FlashStorage_STM32.
Add customs HTML header feature. Fix bug.
1.1.1 K Hoang 13/03/2021 Fix USE_DYNAMIC_PARAMETERS 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.
1.2.0 K Hoang 14/04/2021 Optional one set of WiFi Credentials. Enforce WiFi PWD minimum 8 chars
1.3.0 Michael H 21/04/2021 Enable scan of WiFi networks for selection in Configuration Portal
**********************************************************************************************************************************/
/****************************************************************************************************************************
You have to modify file ./libraries/Adafruit_MQTT_Library/Adafruit_MQTT.cpp as follows to avoid dtostrf error, if exists
Expand Down Expand Up @@ -291,7 +292,7 @@ void MQTT_connect()
}

#if USING_CUSTOMS_STYLE
const char NewCustomsStyle[] /*PROGMEM*/ = "<style>div,input{padding:5px;font-size:1em;}input{width:95%;}body{text-align: center;}\
const char NewCustomsStyle[] /*PROGMEM*/ = "<style>div,input,select{padding:5px;font-size:1em;}input,select{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>";
#endif

Expand Down
10 changes: 10 additions & 0 deletions examples/SAMD_WiFiNINA_MQTT/defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,16 @@

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

#define SCAN_WIFI_NETWORKS true

// To be able to manually input SSID, not from a scanned SSID lists
#define MANUAL_SSID_INPUT_ALLOWED true

// From 2-15
#define MAX_SSID_IN_LIST 6

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

#include <WiFiManager_NINA_Lite_SAMD.h>

#define HOST_NAME "SAMD-MQTT-Controller"
Expand Down
9 changes: 5 additions & 4 deletions examples/SAM_DUE_WiFiNINA/SAM_DUE_WiFiNINA.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_NINA_Lite
Licensed under MIT license
Version: 1.2.0
Version: 1.3.0

Version Modified By Date Comments
------- ----------- ---------- -----------
Expand All @@ -19,12 +19,13 @@
SSID password maxlen is 63 now. Permit special chars # and % in input data.
1.0.4 K Hoang 04/05/2020 Add Configurable Config Portal Title, Default Config Data and DRD. Update examples.
1.0.5 K Hoang 11/07/2020 Modify LOAD_DEFAULT_CONFIG_DATA logic. Enhance MultiWiFi connection logic. Add MQTT examples.
1.1.0 K Hoang 19/02/2021 Optimize code and use better FlashStorage_SAMD and FlashStorage_STM32.
1.1.0 K Hoang 19/02/2021 Optimize code and use better FlashStorage_SAMD and FlashStorage_STM32.
Add customs HTML header feature. Fix bug.
1.1.1 K Hoang 13/03/2021 Fix USE_DYNAMIC_PARAMETERS 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.
1.2.0 K Hoang 14/04/2021 Optional one set of WiFi Credentials. Enforce WiFi PWD minimum 8 chars
1.3.0 Michael H 21/04/2021 Enable scan of WiFi networks for selection in Configuration Portal
**********************************************************************************************************************************/

#include "defines.h"
Expand Down Expand Up @@ -68,7 +69,7 @@ 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;}\
const char NewCustomsStyle[] /*PROGMEM*/ = "<style>div,input,select{padding:5px;font-size:1em;}input,select{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>";
#endif

Expand All @@ -90,7 +91,7 @@ void setup()
WiFiManager_NINA->setConfigPortalChannel(0);

#if USING_CUSTOMS_STYLE
WiFiManager_NINA->setCustomsStyle(NewCustomsStyle);
WiFiManager_NINA->setCustomsStyle(NewCustomsStyle);
#endif

#if USING_CUSTOMS_HEAD_ELEMENT
Expand Down
10 changes: 10 additions & 0 deletions examples/SAM_DUE_WiFiNINA/defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,16 @@

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

#define SCAN_WIFI_NETWORKS true

// To be able to manually input SSID, not from a scanned SSID lists
#define MANUAL_SSID_INPUT_ALLOWED true

// From 2-15
#define MAX_SSID_IN_LIST 6

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

#include <WiFiManager_NINA_Lite_DUE.h>

#define HOST_NAME "DUE-Master-Controller"
Expand Down
7 changes: 4 additions & 3 deletions examples/SAM_DUE_WiFiNINA_MQTT/SAM_DUE_WiFiNINA_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_NINA_Lite
Licensed under MIT license
Version: 1.2.0
Version: 1.3.0

Version Modified By Date Comments
------- ----------- ---------- -----------
Expand All @@ -19,12 +19,13 @@
SSID password maxlen is 63 now. Permit special chars # and % in input data.
1.0.4 K Hoang 04/05/2020 Add Configurable Config Portal Title, Default Config Data and DRD. Update examples.
1.0.5 K Hoang 11/07/2020 Modify LOAD_DEFAULT_CONFIG_DATA logic. Enhance MultiWiFi connection logic. Add MQTT examples.
1.1.0 K Hoang 19/02/2021 Optimize code and use better FlashStorage_SAMD and FlashStorage_STM32.
1.1.0 K Hoang 19/02/2021 Optimize code and use better FlashStorage_SAMD and FlashStorage_STM32.
Add customs HTML header feature. Fix bug.
1.1.1 K Hoang 13/03/2021 Fix USE_DYNAMIC_PARAMETERS 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.
1.2.0 K Hoang 14/04/2021 Optional one set of WiFi Credentials. Enforce WiFi PWD minimum 8 chars
1.3.0 Michael H 21/04/2021 Enable scan of WiFi networks for selection in Configuration Portal
**********************************************************************************************************************************/
/****************************************************************************************************************************
You have to modify file ./libraries/Adafruit_MQTT_Library/Adafruit_MQTT.cpp as follows to avoid dtostrf error
Expand Down Expand Up @@ -291,7 +292,7 @@ void MQTT_connect()
}

#if USING_CUSTOMS_STYLE
const char NewCustomsStyle[] /*PROGMEM*/ = "<style>div,input{padding:5px;font-size:1em;}input{width:95%;}body{text-align: center;}\
const char NewCustomsStyle[] /*PROGMEM*/ = "<style>div,input,select{padding:5px;font-size:1em;}input,select{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>";
#endif

Expand Down
10 changes: 10 additions & 0 deletions examples/SAM_DUE_WiFiNINA_MQTT/defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,16 @@

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

#define SCAN_WIFI_NETWORKS true

// To be able to manually input SSID, not from a scanned SSID lists
#define MANUAL_SSID_INPUT_ALLOWED true

// From 2-15
#define MAX_SSID_IN_LIST 6

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

#include <WiFiManager_NINA_Lite_DUE.h>

#define HOST_NAME "DUE-Master-Controller"
Expand Down
7 changes: 4 additions & 3 deletions examples/STM32_WiFiNINA/STM32_WiFiNINA.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_NINA_Lite
Licensed under MIT license
Version: 1.2.0
Version: 1.3.0

Version Modified By Date Comments
------- ----------- ---------- -----------
Expand All @@ -19,12 +19,13 @@
SSID password maxlen is 63 now. Permit special chars # and % in input data.
1.0.4 K Hoang 04/05/2020 Add Configurable Config Portal Title, Default Config Data and DRD. Update examples.
1.0.5 K Hoang 11/07/2020 Modify LOAD_DEFAULT_CONFIG_DATA logic. Enhance MultiWiFi connection logic. Add MQTT examples.
1.1.0 K Hoang 19/02/2021 Optimize code and use better FlashStorage_SAMD and FlashStorage_STM32.
1.1.0 K Hoang 19/02/2021 Optimize code and use better FlashStorage_SAMD and FlashStorage_STM32.
Add customs HTML header feature. Fix bug.
1.1.1 K Hoang 13/03/2021 Fix USE_DYNAMIC_PARAMETERS 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.
1.2.0 K Hoang 14/04/2021 Optional one set of WiFi Credentials. Enforce WiFi PWD minimum 8 chars
1.3.0 Michael H 21/04/2021 Enable scan of WiFi networks for selection in Configuration Portal
**********************************************************************************************************************************/

#include "defines.h"
Expand Down Expand Up @@ -68,7 +69,7 @@ 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;}\
const char NewCustomsStyle[] /*PROGMEM*/ = "<style>div,input,select{padding:5px;font-size:1em;}input,select{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>";
#endif

Expand Down
10 changes: 10 additions & 0 deletions examples/STM32_WiFiNINA/defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,16 @@

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

#define SCAN_WIFI_NETWORKS true

// To be able to manually input SSID, not from a scanned SSID lists
#define MANUAL_SSID_INPUT_ALLOWED true

// From 2-15
#define MAX_SSID_IN_LIST 6

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

#include <WiFiManager_NINA_Lite_STM32.h>

#define HOST_NAME "STM32-Master-Controller"
Expand Down
7 changes: 4 additions & 3 deletions examples/STM32_WiFiNINA_MQTT/STM32_WiFiNINA_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_NINA_Lite
Licensed under MIT license
Version: 1.2.0
Version: 1.3.0

Version Modified By Date Comments
------- ----------- ---------- -----------
Expand All @@ -19,12 +19,13 @@
SSID password maxlen is 63 now. Permit special chars # and % in input data.
1.0.4 K Hoang 04/05/2020 Add Configurable Config Portal Title, Default Config Data and DRD. Update examples.
1.0.5 K Hoang 11/07/2020 Modify LOAD_DEFAULT_CONFIG_DATA logic. Enhance MultiWiFi connection logic. Add MQTT examples.
1.1.0 K Hoang 19/02/2021 Optimize code and use better FlashStorage_SAMD and FlashStorage_STM32.
1.1.0 K Hoang 19/02/2021 Optimize code and use better FlashStorage_SAMD and FlashStorage_STM32.
Add customs HTML header feature. Fix bug.
1.1.1 K Hoang 13/03/2021 Fix USE_DYNAMIC_PARAMETERS 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.
1.2.0 K Hoang 14/04/2021 Optional one set of WiFi Credentials. Enforce WiFi PWD minimum 8 chars
1.3.0 Michael H 21/04/2021 Enable scan of WiFi networks for selection in Configuration Portal
**********************************************************************************************************************************/
/****************************************************************************************************************************
You have to modify file ./libraries/Adafruit_MQTT_Library/Adafruit_MQTT.cpp as follows to avoid dtostrf error
Expand Down Expand Up @@ -291,7 +292,7 @@ void MQTT_connect()
}

#if USING_CUSTOMS_STYLE
const char NewCustomsStyle[] /*PROGMEM*/ = "<style>div,input{padding:5px;font-size:1em;}input{width:95%;}body{text-align: center;}\
const char NewCustomsStyle[] /*PROGMEM*/ = "<style>div,input,select{padding:5px;font-size:1em;}input,select{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>";
#endif

Expand Down
10 changes: 10 additions & 0 deletions examples/STM32_WiFiNINA_MQTT/defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,16 @@

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

#define SCAN_WIFI_NETWORKS true

// To be able to manually input SSID, not from a scanned SSID lists
#define MANUAL_SSID_INPUT_ALLOWED true

// From 2-15
#define MAX_SSID_IN_LIST 6

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

#include "WiFiNINA_Pinout_Generic.h"

#include <WiFiManager_NINA_Lite_STM32.h>
Expand Down
Loading