This repository has been archived by the owner on Jan 29, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#### Major Release v1.0.4 1. Configurable ***Config Portal Title*** to be either HostName, BoardName or default undistinguishable names. 2. Optional default ***Credentials as well as Dynamic parameters to be optionally autoloaded into Config Portal*** to use or change instead of manually input. 3. ***DoubleDetectDetector*** feature to force Config Portal when double reset is detected within predetermined time, default 10s. 4. Examples are redesigned to separate Credentials / Defines / Dynamic Params / Code so that you can change Credentials / Dynamic Params quickly for each device. 5. Add Board Name
- Loading branch information
1 parent
6f0cfe9
commit 66415c8
Showing
37 changed files
with
3,850 additions
and
1,174 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
/**************************************************************************************************************************** | ||
Credentials.h | ||
For nRF52 boards using WiFiNINA modules/shields, using much less code to support boards with smaller memory | ||
WiFiManager_NINA_WM_Lite is a library for the Mega, Teensy, SAM DUE, SAMD and STM32 boards | ||
(https://github.com/khoih-prog/WiFiManager_NINA_Lite) to enable store Credentials in EEPROM/LittleFS for easy | ||
configuration/reconfiguration and autoconnect/autoreconnect of WiFi and other services without Hardcoding. | ||
Built by Khoi Hoang https://github.com/khoih-prog/WiFiManager_NINA_Lite | ||
Licensed under MIT license | ||
Version: 1.0.4 | ||
Version Modified By Date Comments | ||
------- ----------- ---------- ----------- | ||
1.0.0 K Hoang 26/03/2020 Initial coding | ||
1.0.1 K Hoang 27/03/2020 Fix SAMD soft-reset bug. Add support to remaining boards | ||
1.0.2 K Hoang 15/04/2020 Fix bug. Add SAMD51 support. | ||
1.0.3 K Hoang 24/04/2020 Fix bug. Add nRF5 (Adafruit, NINA_B302_ublox, etc.) support. Add MultiWiFi, HostName capability. | ||
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. | ||
*****************************************************************************************************************************/ | ||
|
||
#ifndef Credentials_h | ||
#define Credentials_h | ||
|
||
#include "defines.h" | ||
|
||
/// Start Default Config Data ////////////////// | ||
|
||
/* | ||
#define SSID_MAX_LEN 32 | ||
//From v1.0.3, WPA2 passwords can be up to 63 characters long. | ||
#define PASS_MAX_LEN 64 | ||
typedef struct | ||
{ | ||
char wifi_ssid[SSID_MAX_LEN]; | ||
char wifi_pw [PASS_MAX_LEN]; | ||
} WiFi_Credentials; | ||
#define NUM_WIFI_CREDENTIALS 2 | ||
// Configurable items besides fixed Header, just add board_name | ||
#define NUM_CONFIGURABLE_ITEMS ( ( 2 * NUM_WIFI_CREDENTIALS ) + 1 ) | ||
//////////////// | ||
typedef struct Configuration | ||
{ | ||
char header [16]; | ||
WiFi_Credentials WiFi_Creds [NUM_WIFI_CREDENTIALS]; | ||
char board_name [24]; | ||
int checkSum; | ||
} WiFiNINA_Configuration; | ||
*/ | ||
|
||
#define TO_LOAD_DEFAULT_CONFIG_DATA true | ||
|
||
#if TO_LOAD_DEFAULT_CONFIG_DATA | ||
|
||
bool LOAD_DEFAULT_CONFIG_DATA = true; | ||
|
||
WiFiNINA_Configuration defaultConfig = | ||
{ | ||
//char header[16], dummy, not used | ||
"WIFININA", | ||
// WiFi_Credentials WiFi_Creds [NUM_WIFI_CREDENTIALS]; | ||
// WiFi_Credentials.wifi_ssid and WiFi_Credentials.wifi_pw | ||
"SSID1", "password1", | ||
"SSID2", "password2", | ||
//char board_name [24]; | ||
"Air-Control", | ||
// terminate the list | ||
//int checkSum, dummy, not used | ||
0 | ||
/////////// End Default Config Data ///////////// | ||
}; | ||
|
||
#else | ||
|
||
bool LOAD_DEFAULT_CONFIG_DATA = false; | ||
|
||
WiFiNINA_Configuration defaultConfig; | ||
|
||
#endif // TO_LOAD_DEFAULT_CONFIG_DATA | ||
|
||
/////////// End Default Config Data ///////////// | ||
|
||
|
||
#endif //Credentials_h |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/**************************************************************************************************************************** | ||
defines.h for ESP32WM_Config.ino | ||
For nRF52 boards using WiFiNINA modules/shields, using much less code to support boards with smaller memory | ||
WiFiManager_NINA_WM_Lite is a library for the Mega, Teensy, SAM DUE, SAMD and STM32 boards | ||
(https://github.com/khoih-prog/WiFiManager_NINA_Lite) to enable store Credentials in EEPROM/LittleFS for easy | ||
configuration/reconfiguration and autoconnect/autoreconnect of WiFi and other services without Hardcoding. | ||
Built by Khoi Hoang https://github.com/khoih-prog/WiFiManager_NINA_Lite | ||
Licensed under MIT license | ||
Version: 1.0.4 | ||
Version Modified By Date Comments | ||
------- ----------- ---------- ----------- | ||
1.0.0 K Hoang 26/03/2020 Initial coding | ||
1.0.1 K Hoang 27/03/2020 Fix SAMD soft-reset bug. Add support to remaining boards | ||
1.0.2 K Hoang 15/04/2020 Fix bug. Add SAMD51 support. | ||
1.0.3 K Hoang 24/04/2020 Fix bug. Add nRF5 (Adafruit, NINA_B302_ublox, etc.) support. Add MultiWiFi, HostName capability. | ||
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. | ||
*****************************************************************************************************************************/ | ||
|
||
#ifndef defines_h | ||
#define defines_h | ||
|
||
/* Comment this out to disable prints and save space */ | ||
#define DEBUG_WIFI_WEBSERVER_PORT Serial | ||
#define WIFININA_DEBUG_OUTPUT Serial | ||
|
||
#define WIFININA_DEBUG false //true | ||
|
||
#define DRD_GENERIC_DEBUG false //true | ||
|
||
#if !( defined(ARDUINO_AVR_MEGA) || defined(ARDUINO_AVR_MEGA2560) ) | ||
#error This code is intended to run only on the Arduino Mega 1280/2560 boards ! Please check your Tools->Board setting. | ||
#endif | ||
|
||
#if defined(ARDUINO_AVR_MEGA2560) | ||
#define BOARD_TYPE "AVR Mega2560" | ||
#else | ||
#define BOARD_TYPE "AVR Mega" | ||
#endif | ||
|
||
// Start location in EEPROM to store config data. Default 0 | ||
// Config data Size currently is 128 bytes) | ||
#define EEPROM_START 0 | ||
|
||
#include <WiFiManager_NINA_Lite.h> | ||
|
||
#define HOST_NAME "AVR-Master-Controller" | ||
|
||
#endif //defines_h |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
/**************************************************************************************************************************** | ||
dynamicParams.h | ||
For nRF52 boards using WiFiNINA modules/shields, using much less code to support boards with smaller memory | ||
WiFiManager_NINA_WM_Lite is a library for the Mega, Teensy, SAM DUE, SAMD and STM32 boards | ||
(https://github.com/khoih-prog/WiFiManager_NINA_Lite) to enable store Credentials in EEPROM/LittleFS for easy | ||
configuration/reconfiguration and autoconnect/autoreconnect of WiFi and other services without Hardcoding. | ||
Built by Khoi Hoang https://github.com/khoih-prog/WiFiManager_NINA_Lite | ||
Licensed under MIT license | ||
Version: 1.0.4 | ||
Version Modified By Date Comments | ||
------- ----------- ---------- ----------- | ||
1.0.0 K Hoang 26/03/2020 Initial coding | ||
1.0.1 K Hoang 27/03/2020 Fix SAMD soft-reset bug. Add support to remaining boards | ||
1.0.2 K Hoang 15/04/2020 Fix bug. Add SAMD51 support. | ||
1.0.3 K Hoang 24/04/2020 Fix bug. Add nRF5 (Adafruit, NINA_B302_ublox, etc.) support. Add MultiWiFi, HostName capability. | ||
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. | ||
*****************************************************************************************************************************/ | ||
|
||
#ifndef dynamicParams_h | ||
#define dynamicParams_h | ||
|
||
#include "defines.h" | ||
|
||
#define USE_DYNAMIC_PARAMETERS true | ||
|
||
/////////////// Start dynamic Credentials /////////////// | ||
|
||
//Defined in <WiFiManager_NINA_Lite_NRF52840.h> | ||
/************************************** | ||
#define MAX_ID_LEN 5 | ||
#define MAX_DISPLAY_NAME_LEN 16 | ||
typedef struct | ||
{ | ||
char id [MAX_ID_LEN + 1]; | ||
char displayName [MAX_DISPLAY_NAME_LEN + 1]; | ||
char *pdata; | ||
uint8_t maxlen; | ||
} MenuItem; | ||
**************************************/ | ||
|
||
#if USE_DYNAMIC_PARAMETERS | ||
|
||
#define MAX_BLYNK_SERVER_LEN 34 | ||
#define MAX_BLYNK_TOKEN_LEN 34 | ||
|
||
char Blynk_Server1 [MAX_BLYNK_SERVER_LEN + 1] = "account.duckdns.org"; | ||
char Blynk_Token1 [MAX_BLYNK_TOKEN_LEN + 1] = "token1"; | ||
|
||
char Blynk_Server2 [MAX_BLYNK_SERVER_LEN + 1] = "account.ddns.net"; | ||
char Blynk_Token2 [MAX_BLYNK_TOKEN_LEN + 1] = "token2"; | ||
|
||
#define MAX_BLYNK_PORT_LEN 6 | ||
char Blynk_Port [MAX_BLYNK_PORT_LEN + 1] = "8080"; | ||
|
||
#define MAX_MQTT_SERVER_LEN 34 | ||
char MQTT_Server [MAX_MQTT_SERVER_LEN + 1] = "mqtt.duckdns.org"; | ||
|
||
MenuItem myMenuItems [] = | ||
{ | ||
{ "sv1", "Blynk Server1", Blynk_Server1, MAX_BLYNK_SERVER_LEN }, | ||
{ "tk1", "Token1", Blynk_Token1, MAX_BLYNK_TOKEN_LEN }, | ||
{ "sv2", "Blynk Server2", Blynk_Server2, MAX_BLYNK_SERVER_LEN }, | ||
{ "tk2", "Token2", Blynk_Token2, MAX_BLYNK_TOKEN_LEN }, | ||
{ "pt", "Port", Blynk_Port, MAX_BLYNK_PORT_LEN }, | ||
{ "mq", "MQTT Server", MQTT_Server, MAX_MQTT_SERVER_LEN }, | ||
}; | ||
|
||
uint16_t NUM_MENU_ITEMS = sizeof(myMenuItems) / sizeof(MenuItem); //MenuItemSize; | ||
|
||
#else | ||
|
||
MenuItem myMenuItems [] = {}; | ||
|
||
uint16_t NUM_MENU_ITEMS = 0; | ||
|
||
#endif //USE_DYNAMIC_PARAMETERS | ||
|
||
|
||
#endif //dynamicParams_h |
Oops, something went wrong.