diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 1cb38d2..13c8741 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -15,7 +15,7 @@ If you don't find anything, please [open a new issue](https://github.com/khoih-p
Please ensure to specify the following:
* Arduino IDE version (e.g. 1.8.19) or Platform.io version
-* Board Core Version (e.g. Arduino SAMDUE core v1.6.12, ESP8266 core v3.0.2, ArduinoCore-mbed v2.6.1, etc.)
+* Board Core Version (e.g. Arduino SAMDUE core v1.6.12, ESP8266 core v3.0.2, ArduinoCore-mbed v2.7.2, etc.)
* Contextual information (e.g. what you were trying to achieve)
* Simplest possible steps to reproduce
* Anything that might be relevant in your opinion, such as:
@@ -28,9 +28,9 @@ Please ensure to specify the following:
```
Arduino IDE version: 1.8.19
Nano_RP2040_Connect board
-ArduinoCore-mbed v2.6.1
+ArduinoCore-mbed v2.7.2
OS: Ubuntu 20.04 LTS
-Linux xy-Inspiron-3593 5.4.0-96-generic #109-Ubuntu SMP Wed Jan 12 16:49:16 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.
@@ -51,3 +51,4 @@ There are usually some outstanding feature requests in the [existing issues list
### Sending Pull Requests
Pull Requests with changes and fixes are also welcome!
+
diff --git a/README.md b/README.md
index 0ab5183..60ef45a 100644
--- a/README.md
+++ b/README.md
@@ -6,7 +6,8 @@
[![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](#Contributing)
[![GitHub issues](https://img.shields.io/github/issues/khoih-prog/ESP_AT_WM_Lite.svg)](http://github.com/khoih-prog/ESP_AT_WM_Lite/issues)
-
+
+
---
---
@@ -59,6 +60,7 @@
* [9. To avoid blocking in loop when WiFi is lost](#9-To-avoid-blocking-in-loop-when-wifi-is-lost)
* [9.1 Max times to try WiFi per loop](#91-max-times-to-try-wifi-per-loop)
* [9.2 Interval between reconnection WiFi if lost](#92-interval-between-reconnection-wifi-if-lost)
+ * [10. Not using Board_Name on Config_Portal](#10-Not-using-Board_Name-on-Config_Portal)
* [Important Notes for using Dynamic Parameters' ids](#important-notes-for-using-dynamic-parameters-ids)
* [Examples](#examples)
* [ 1. Mega_ESP8266Shield](examples/Mega_ESP8266Shield)
@@ -192,16 +194,16 @@ This [**ESP_AT_WM_Lite** library](https://github.com/khoih-prog/ESP_AT_WM_Lite)
## Prerequisites
1. [`Arduino IDE 1.8.19+` for Arduino](https://github.com/arduino/Arduino). [![GitHub release](https://img.shields.io/github/release/arduino/Arduino.svg)](https://github.com/arduino/Arduino/releases/latest)
- 2. [`Arduino AVR core 1.8.3+`](https://github.com/arduino/ArduinoCore-avr) for Arduino (Use Arduino Board Manager) for AVR boards. [![GitHub release](https://img.shields.io/github/release/arduino/ArduinoCore-avr.svg)](https://github.com/arduino/ArduinoCore-avr/releases/latest)
+ 2. [`Arduino AVR core 1.8.5+`](https://github.com/arduino/ArduinoCore-avr) for Arduino (Use Arduino Board Manager) for AVR boards. [![GitHub release](https://img.shields.io/github/release/arduino/ArduinoCore-avr.svg)](https://github.com/arduino/ArduinoCore-avr/releases/latest)
3. [`Arduino Core for STM32 v2.2.0+`](https://github.com/stm32duino/Arduino_Core_STM32) for STM32F/L/H/G/WB/MP1 boards (Nucleo-144 NUCLEO_F767ZI, Nucleo-64 NUCLEO_L053R8, etc.). [![GitHub release](https://img.shields.io/github/release/stm32duino/Arduino_Core_STM32.svg)](https://github.com/stm32duino/Arduino_Core_STM32/releases/latest)
4. [`Teensy core 1.56+`](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
5. [`Arduino SAM DUE core v1.6.12+`](https://github.com/arduino/ArduinoCore-sam) for SAM DUE ARM Cortex-M3 boards.
6. [`Arduino SAMD core 1.8.12+`](https://github.com/arduino/ArduinoCore-samd) 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)
- 7. [`Adafruit SAMD core 1.7.8+`](https://github.com/adafruit/ArduinoCore-samd) 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. [`Adafruit SAMD core 1.7.9+`](https://github.com/adafruit/ArduinoCore-samd) 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)
8. [`Seeeduino SAMD core 1.8.2+`](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/)
9. [`Adafruit nRF52 v1.3.0+`](https://github.com/adafruit/Adafruit_nRF52_Arduino) 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)
-10. [`Arduino mbed_rp2040 core 2.6.1+`](https://github.com/arduino/ArduinoCore-mbed) for Arduino RP2040-based boards, such as **Arduino Nano RP2040 Connect, RASPBERRY_PI_PICO, etc.**. [![GitHub release](https://img.shields.io/github/release/arduino/ArduinoCore-mbed.svg)](https://github.com/arduino/ArduinoCore-mbed/releases/latest)
-11. [`Earle Philhower's arduino-pico core v1.10.0+`](https://github.com/earlephilhower/arduino-pico) for RP2040-based boards such as **RASPBERRY_PI_PICO, ADAFRUIT_FEATHER_RP2040 and GENERIC_RP2040**, etc. [![GitHub release](https://img.shields.io/github/release/earlephilhower/arduino-pico.svg)](https://github.com/earlephilhower/arduino-pico/releases/latest)
+10. [`Arduino mbed_rp2040 core 2.7.2+`](https://github.com/arduino/ArduinoCore-mbed) for Arduino RP2040-based boards, such as **Arduino Nano RP2040 Connect, RASPBERRY_PI_PICO, etc.**. [![GitHub release](https://img.shields.io/github/release/arduino/ArduinoCore-mbed.svg)](https://github.com/arduino/ArduinoCore-mbed/releases/latest)
+11. [`Earle Philhower's arduino-pico core v1.12.0+`](https://github.com/earlephilhower/arduino-pico) for RP2040-based boards such as **RASPBERRY_PI_PICO, ADAFRUIT_FEATHER_RP2040 and GENERIC_RP2040**, etc. [![GitHub release](https://img.shields.io/github/release/earlephilhower/arduino-pico.svg)](https://github.com/earlephilhower/arduino-pico/releases/latest)
12. [`ESP8266_AT_WebServer library v1.5.3+`](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. [`FlashStorage_SAMD library v1.3.2+`](https://github.com/khoih-prog/FlashStorage_SAMD) for SAMD21 and SAMD51 boards (ZERO, MKR, NANO_33_IOT, M0, M0 Pro, AdaFruit Itsy-Bitsy M4, etc.). To install, check [![arduino-library-badge](https://www.ardu-badge.com/badge/FlashStorage_SAMD.svg?)](https://www.ardu-badge.com/FlashStorage_SAMD)
14. [`FlashStorage_STM32F1 library v1.1.0+`](https://github.com/khoih-prog/FlashStorage_STM32F1) for STM32F1/F3 boards. To install. check [![arduino-library-badge](https://www.ardu-badge.com/badge/FlashStorage_STM32F1.svg?)](https://www.ardu-badge.com/FlashStorage_STM32F1)
@@ -413,13 +415,13 @@ Whenever the above-mentioned compiler error issue is fixed with the new Arduino
#### 5. For Adafruit SAMD boards
- ***To be able to compile, run and automatically detect and display BOARD_NAME on Adafruit SAMD (Itsy-Bitsy M4, etc) boards***, you have to copy the whole [Adafruit SAMD Packages_Patches](Packages_Patches/adafruit/hardware/samd/1.7.7) directory into Adafruit samd directory (~/.arduino15/packages/adafruit/hardware/samd/1.7.7).
+ ***To be able to compile, run and automatically detect and display BOARD_NAME on Adafruit SAMD (Itsy-Bitsy M4, etc) boards***, you have to copy the whole [Adafruit SAMD Packages_Patches](Packages_Patches/adafruit/hardware/samd/1.7.9) directory into Adafruit samd directory (~/.arduino15/packages/adafruit/hardware/samd/1.7.9).
-Supposing the Adafruit SAMD core version is 1.7.7. This file must be copied into the directory:
+Supposing the Adafruit SAMD core version is 1.7.9. This file must be copied into the directory:
-- `~/.arduino15/packages/adafruit/hardware/samd/1.7.7/platform.txt`
-- `~/.arduino15/packages/adafruit/hardware/samd/1.7.7/cores/arduino/Print.h`
-- `~/.arduino15/packages/adafruit/hardware/samd/1.7.7/cores/arduino/Print.cpp`
+- `~/.arduino15/packages/adafruit/hardware/samd/1.7.9/platform.txt`
+- `~/.arduino15/packages/adafruit/hardware/samd/1.7.9/cores/arduino/Print.h`
+- `~/.arduino15/packages/adafruit/hardware/samd/1.7.9/cores/arduino/Print.cpp`
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:
@@ -521,12 +523,12 @@ With core after v1.5.0, this step is not necessary anymore thanks to the PR [Add
#### 9. For Portenta_H7 boards using Arduino IDE in Linux
- **To be able to upload firmware to Portenta_H7 using Arduino IDE in Linux (Ubuntu, etc.)**, you have to copy the file [portenta_post_install.sh](Packages_Patches/arduino/hardware/mbed_portenta/2.6.1/portenta_post_install.sh) into mbed_portenta directory (~/.arduino15/packages/arduino/hardware/mbed_portenta/2.6.1/portenta_post_install.sh).
+ **To be able to upload firmware to Portenta_H7 using Arduino IDE in Linux (Ubuntu, etc.)**, you have to copy the file [portenta_post_install.sh](Packages_Patches/arduino/hardware/mbed_portenta/2.7.2/portenta_post_install.sh) into mbed_portenta directory (~/.arduino15/packages/arduino/hardware/mbed_portenta/2.7.2/portenta_post_install.sh).
Then run the following command using `sudo`
```
-$ cd ~/.arduino15/packages/arduino/hardware/mbed_portenta/2.6.1
+$ cd ~/.arduino15/packages/arduino/hardware/mbed_portenta/2.7.2
$ chmod 755 portenta_post_install.sh
$ sudo ./portenta_post_install.sh
```
@@ -539,9 +541,9 @@ This will create the file `/etc/udev/rules.d/49-portenta_h7.rules` as follows:
SUBSYSTEMS=="usb", ATTRS{idVendor}=="2341", ATTRS{idProduct}=="035b", GROUP="plugdev", MODE="0666"
```
-Supposing the ArduinoCore-mbed core version is 2.6.1. Now only one file must be copied into the directory:
+Supposing the ArduinoCore-mbed core version is 2.7.2. Now only one file must be copied into the directory:
-- `~/.arduino15/packages/arduino/hardware/mbed_portenta/2.6.1/portenta_post_install.sh`
+- `~/.arduino15/packages/arduino/hardware/mbed_portenta/2.7.2/portenta_post_install.sh`
Whenever a new version is installed, remember to copy this files into the new version directory. For example, new version is x.yy.zz
@@ -781,6 +783,13 @@ Check [retries block the main loop #18](https://github.com/khoih-prog/WiFiManage
#define WIFI_RECON_INTERVAL 30000 // 30s
```
+
+#### 10. Not using Board_Name on Config_Portal
+
+Default is `true`. Just change to `false` to not using `Board_Name` on Config_Portal
+
+
+
---
---
diff --git a/changelog.md b/changelog.md
index 47433ad..840336a 100644
--- a/changelog.md
+++ b/changelog.md
@@ -12,6 +12,7 @@
## Table of Contents
* [Changelog](#changelog)
+ * [Release v1.5.2](#release-v152)
* [Release v1.5.1](#release-v151)
* [Release v1.5.0](#release-v150)
* [Release v1.4.1](#release-v141)
@@ -29,6 +30,13 @@
## Changelog
+### Release v1.5.2
+
+1. Optimize code by using passing by `reference` instead of by `value`
+2. Optional `Board_Name` in Menu. Check [option to remove board name from web page #25](https://github.com/khoih-prog/WiFiManager_NINA_Lite/issues/25)
+3. Add function `isConfigMode()` to signal system is in Config Portal mode.
+4. Update `Packages' Patches`
+
### Release v1.5.1
1. Update to be compatible with new `FlashStorage_SAMD`
diff --git a/examples/Mega_ESP8266Shield/Mega_ESP8266Shield.ino b/examples/Mega_ESP8266Shield/Mega_ESP8266Shield.ino
index b4e983a..3839c0d 100644
--- a/examples/Mega_ESP8266Shield/Mega_ESP8266Shield.ino
+++ b/examples/Mega_ESP8266Shield/Mega_ESP8266Shield.ino
@@ -20,10 +20,22 @@ void heartBeatPrint()
{
static int num = 1;
+ if (ESP_AT_WiFiManager->getWiFiStatus())
+ Serial.print("H"); // H means connected to WiFi
+ else
+ {
+ if (ESP_AT_WiFiManager->isConfigMode())
+ Serial.print("C"); // C means in Config Mode
+ else
+ Serial.print("F"); // F means not connected to WiFi
+ }
+
+#if 0
if (WiFi.status() == WL_CONNECTED)
Serial.print(F("H")); // H means connected to WiFi
else
Serial.print(F("F")); // F means not connected to WiFi
+#endif
if (num == 80)
{
diff --git a/examples/Mega_ESP8266Shield/defines.h b/examples/Mega_ESP8266Shield/defines.h
index d285f22..cf201cc 100644
--- a/examples/Mega_ESP8266Shield/defines.h
+++ b/examples/Mega_ESP8266Shield/defines.h
@@ -72,6 +72,28 @@
/////////////////////////////////////////////
+// Optional, to use Board Name in Menu
+#define USING_BOARD_NAME false //true
+
+/////////////////////////////////////////////
+
+// 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
#define HOST_NAME "Mega-ESP_AT"
diff --git a/examples/RPi_Pico_ESP8266Shield/RPi_Pico_ESP8266Shield.ino b/examples/RPi_Pico_ESP8266Shield/RPi_Pico_ESP8266Shield.ino
index 0bc4320..728ba89 100644
--- a/examples/RPi_Pico_ESP8266Shield/RPi_Pico_ESP8266Shield.ino
+++ b/examples/RPi_Pico_ESP8266Shield/RPi_Pico_ESP8266Shield.ino
@@ -23,7 +23,12 @@ void heartBeatPrint()
if (ESP_AT_WiFiManager->getWiFiStatus())
Serial.print("H"); // H means connected to WiFi
else
- Serial.print("F"); // F means not connected to WiFi
+ {
+ if (ESP_AT_WiFiManager->isConfigMode())
+ Serial.print("C"); // C means in Config Mode
+ else
+ Serial.print("F"); // F means not connected to WiFi
+ }
if (num == 80)
{
diff --git a/examples/RPi_Pico_ESP8266Shield/defines.h b/examples/RPi_Pico_ESP8266Shield/defines.h
index 8c93165..ca6af88 100644
--- a/examples/RPi_Pico_ESP8266Shield/defines.h
+++ b/examples/RPi_Pico_ESP8266Shield/defines.h
@@ -125,6 +125,28 @@
/////////////////////////////////////////////
+// Optional, to use Board Name in Menu
+#define USING_BOARD_NAME false //true
+
+/////////////////////////////////////////////
+
+// 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
+
+/////////////////////////////////////////////
+
#if ESP8266_AT_USE_RP2040
#include
diff --git a/examples/SAMD_ESP8266Shield/SAMD_ESP8266Shield.ino b/examples/SAMD_ESP8266Shield/SAMD_ESP8266Shield.ino
index 5c84b1b..9d3d832 100644
--- a/examples/SAMD_ESP8266Shield/SAMD_ESP8266Shield.ino
+++ b/examples/SAMD_ESP8266Shield/SAMD_ESP8266Shield.ino
@@ -23,7 +23,12 @@ void heartBeatPrint()
if (ESP_AT_WiFiManager->getWiFiStatus())
Serial.print("H"); // H means connected to WiFi
else
- Serial.print("F"); // F means not connected to WiFi
+ {
+ if (ESP_AT_WiFiManager->isConfigMode())
+ Serial.print("C"); // C means in Config Mode
+ else
+ Serial.print("F"); // F means not connected to WiFi
+ }
if (num == 80)
{
diff --git a/examples/SAMD_ESP8266Shield/defines.h b/examples/SAMD_ESP8266Shield/defines.h
index ad62451..580df44 100644
--- a/examples/SAMD_ESP8266Shield/defines.h
+++ b/examples/SAMD_ESP8266Shield/defines.h
@@ -134,6 +134,28 @@
/////////////////////////////////////////////
+// Optional, to use Board Name in Menu
+#define USING_BOARD_NAME false //true
+
+/////////////////////////////////////////////
+
+// 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
#define HOST_NAME "SAMD_ESP_AT"
diff --git a/examples/SAM_DUE_ESP8266Shield/SAM_DUE_ESP8266Shield.ino b/examples/SAM_DUE_ESP8266Shield/SAM_DUE_ESP8266Shield.ino
index 4700aab..16a17d5 100644
--- a/examples/SAM_DUE_ESP8266Shield/SAM_DUE_ESP8266Shield.ino
+++ b/examples/SAM_DUE_ESP8266Shield/SAM_DUE_ESP8266Shield.ino
@@ -23,7 +23,12 @@ void heartBeatPrint()
if (ESP_AT_WiFiManager->getWiFiStatus())
Serial.print("H"); // H means connected to WiFi
else
- Serial.print("F"); // F means not connected to WiFi
+ {
+ if (ESP_AT_WiFiManager->isConfigMode())
+ Serial.print("C"); // C means in Config Mode
+ else
+ Serial.print("F"); // F means not connected to WiFi
+ }
if (num == 80)
{
diff --git a/examples/SAM_DUE_ESP8266Shield/defines.h b/examples/SAM_DUE_ESP8266Shield/defines.h
index 2bd1fd4..6890ff4 100644
--- a/examples/SAM_DUE_ESP8266Shield/defines.h
+++ b/examples/SAM_DUE_ESP8266Shield/defines.h
@@ -92,6 +92,28 @@
/////////////////////////////////////////////
+// Optional, to use Board Name in Menu
+#define USING_BOARD_NAME false //true
+
+/////////////////////////////////////////////
+
+// 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
#define HOST_NAME "SAM_DUE-ESP_AT"
diff --git a/examples/STM32_ESP8266Shield/STM32_ESP8266Shield.ino b/examples/STM32_ESP8266Shield/STM32_ESP8266Shield.ino
index d1ee853..c2ea149 100644
--- a/examples/STM32_ESP8266Shield/STM32_ESP8266Shield.ino
+++ b/examples/STM32_ESP8266Shield/STM32_ESP8266Shield.ino
@@ -23,7 +23,12 @@ void heartBeatPrint()
if (ESP_AT_WiFiManager->getWiFiStatus())
Serial.print("H"); // H means connected to WiFi
else
- Serial.print("F"); // F means not connected to WiFi
+ {
+ if (ESP_AT_WiFiManager->isConfigMode())
+ Serial.print("C"); // C means in Config Mode
+ else
+ Serial.print("F"); // F means not connected to WiFi
+ }
if (num == 80)
{
diff --git a/examples/STM32_ESP8266Shield/defines.h b/examples/STM32_ESP8266Shield/defines.h
index de1568d..4c6a40a 100644
--- a/examples/STM32_ESP8266Shield/defines.h
+++ b/examples/STM32_ESP8266Shield/defines.h
@@ -156,6 +156,28 @@
/////////////////////////////////////////////
+// Optional, to use Board Name in Menu
+#define USING_BOARD_NAME false //true
+
+/////////////////////////////////////////////
+
+// 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
diff --git a/examples/nRF52_ESP8266Shield/defines.h b/examples/nRF52_ESP8266Shield/defines.h
index 7b1675d..d3cb58a 100644
--- a/examples/nRF52_ESP8266Shield/defines.h
+++ b/examples/nRF52_ESP8266Shield/defines.h
@@ -113,6 +113,28 @@
/////////////////////////////////////////////
+// Optional, to use Board Name in Menu
+#define USING_BOARD_NAME false //true
+
+/////////////////////////////////////////////
+
+// 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
#define HOST_NAME "nRF52-ESP_AT"
diff --git a/examples/nRF52_ESP8266Shield/nRF52_ESP8266Shield.ino b/examples/nRF52_ESP8266Shield/nRF52_ESP8266Shield.ino
index 1b09e50..7e86465 100644
--- a/examples/nRF52_ESP8266Shield/nRF52_ESP8266Shield.ino
+++ b/examples/nRF52_ESP8266Shield/nRF52_ESP8266Shield.ino
@@ -23,7 +23,12 @@ void heartBeatPrint()
if (ESP_AT_WiFiManager->getWiFiStatus())
Serial.print("H"); // H means connected to WiFi
else
- Serial.print("F"); // F means not connected to WiFi
+ {
+ if (ESP_AT_WiFiManager->isConfigMode())
+ Serial.print("C"); // C means in Config Mode
+ else
+ Serial.print("F"); // F means not connected to WiFi
+ }
if (num == 80)
{
diff --git a/keywords.txt b/keywords.txt
index e0ccf4c..edfec3f 100644
--- a/keywords.txt
+++ b/keywords.txt
@@ -57,3 +57,8 @@ ESP_AT_HTML_SCRIPT_ITEM LITERAL1
ESP_AT_HTML_SCRIPT_END LITERAL1
ESP_AT_HTML_END LITERAL1
+LED_ON LITERAL1
+LED_OFF LITERAL1
+
+USING_BOARD_NAME LITERAL1
+
diff --git a/library.json b/library.json
index 178c192..94f28e3 100644
--- a/library.json
+++ b/library.json
@@ -1,6 +1,6 @@
{
"name": "ESP_AT_WM_Lite",
- "version": "1.5.1",
+ "version": "1.5.2",
"keywords": "wifi, MultiWiFi, ESP8266-AT, ESP32-AT, SAM DUE, SAMD, nRF52, STM32, rpi-pico, rp2040, nano-rp2040-connect, Credentials, config-portal, dynamic-params, EEPROM, FlashStorage-SAMD, FlashStorage-STM32, LittleFS, DueFlashStorage, AVR Mega, Double-Reset, FlashStorage, light-weight",
"description": "Light-Weight WiFi/Credentials Manager for AVR Mega, SAM DUE, SAMD21, SAMD51, nRF52, STM32, RP2040-based Nano_RP2040_connect, RASPBERRY_PI_PICO boards, etc. using ESP8266/ESP32-AT-command shields with web configuration portal. Powerful-yet-simple-to-use feature to enable adding dynamic custom parameters. You can also specify static AP and STA IP. Use much less memory compared to full-fledge WiFiManager. Config Portal will be auto-adjusted to match the number of dynamic custom parameters. Credentials and dynamic custom parameters are saved in EPROM, FlashStorage_SAMD, FlashStorage_STM32, FlashStorage_STM32F1, DueFlashStorage or nRF52/RP2040 LittleFS.",
"authors":
diff --git a/library.properties b/library.properties
index 6680ba5..e716242 100644
--- a/library.properties
+++ b/library.properties
@@ -1,5 +1,5 @@
name=ESP_AT_WM_Lite
-version=1.5.1
+version=1.5.2
author=Khoi Hoang
maintainer=Khoi Hoang
license=MIT
diff --git a/src/Esp8266_AT_WM_Lite.h b/src/Esp8266_AT_WM_Lite.h
index 751ed27..5286b63 100644
--- a/src/Esp8266_AT_WM_Lite.h
+++ b/src/Esp8266_AT_WM_Lite.h
@@ -8,25 +8,16 @@
Built by Khoi Hoang https://github.com/khoih-prog/ESP_AT_WM_Lite
Licensed under MIT license
- Version: 1.5.1
+ Version: 1.5.2
Version Modified By Date Comments
------- ----------- ---------- -----------
1.0.0 K Hoang 09/03/2020 Initial coding
- 1.0.1 K Hoang 20/03/2020 Add feature to enable adding dynamically more Credentials parameters in sketch
- 1.0.2 K Hoang 17/04/2020 Fix bug. Add support to SAMD51 and SAMD DUE. WPA2 SSID PW to 63 chars.
- Permit to input special chars such as !,@,#,$,%,^,&,* into data fields.
- 1.0.3 K Hoang 11/06/2020 Add support to nRF52 boards, such as AdaFruit Feather nRF52832, NINA_B30_ublox, etc.
- Add DRD support. Add MultiWiFi support
- 1.0.4 K Hoang 03/07/2020 Add support to ESP32-AT shields. Modify LOAD_DEFAULT_CONFIG_DATA logic.
- Enhance MultiWiFi connection logic. Fix WiFi Status bug.
- 1.1.0 K Hoang 13/04/2021 Fix invalid "blank" Config Data treated as Valid. Optional one set of WiFi Credentials
- 1.2.0 Michael H 28/04/2021 Enable scan of WiFi networks for selection in Configuration Portal
- 1.3.0 K Hoang 12/05/2021 Add support to RASPBERRY_PI_PICO using Arduino-pico core
- 1.4.0 K Hoang 01/06/2021 Add support to Nano_RP2040_Connect, RASPBERRY_PI_PICO using RP2040 Arduino mbed core
- 1.4.1 K Hoang 10/10/2021 Update `platform.ini` and `library.json`
+ ...
1.5.0 K Hoang 08/01/2022 Fix the blocking issue in loop() with configurable WIFI_RECON_INTERVAL
1.5.1 K Hoang 26/01/2022 Update to be compatible with new FlashStorage libraries. Add support to more SAMD/STM32 boards
+ 1.5.2 K Hoang 22/02/2022 Optional Board_Name in Menu. Optimize code by using passing by reference
+ Add optional CONFIG_MODE_LED. Add function isConfigMode()
***************************************************************************************************************************************/
#ifndef Esp8266_AT_WM_Lite_h
@@ -41,13 +32,13 @@
#endif
#ifndef ESP_AT_WM_LITE_VERSION
- #define ESP_AT_WM_LITE_VERSION "ESP_AT_WM_Lite v1.5.1"
+ #define ESP_AT_WM_LITE_VERSION "ESP_AT_WM_Lite v1.5.2"
#define ESP_AT_WM_LITE_VERSION_MAJOR 1
#define ESP_AT_WM_LITE_VERSION_MINOR 5
- #define ESP_AT_WM_LITE_VERSION_PATCH 1
+ #define ESP_AT_WM_LITE_VERSION_PATCH 2
- #define ESP_AT_WM_LITE_VERSION_INT 1005001
+ #define ESP_AT_WM_LITE_VERSION_INT 1005002
#endif
@@ -140,7 +131,7 @@ extern ESP8266_AT_Configuration defaultConfig;
//////////////////////////////////////////////
-String IPAddressToString(IPAddress _address)
+String IPAddressToString(const IPAddress& _address)
{
String str = String(_address[0]);
str += ".";
@@ -225,7 +216,13 @@ class ESP_AT_WiFiManager_Lite
if (NUM_MENU_ITEMS > 3)
NUM_MENU_ITEMS = 3;
#endif
-
+
+#if USING_CONFIG_MODE_LED
+ //Turn OFF
+ pinMode(LED_BUILTIN, OUTPUT);
+ digitalWrite(LED_BUILTIN, LED_OFF);
+#endif
+
//// New DRD ////
drd = new DoubleResetDetector_Generic(DRD_TIMEOUT, DRD_ADDRESS);
bool useConfigPortal = false;
@@ -344,6 +341,11 @@ class ESP_AT_WiFiManager_Lite
if (WiFi.status() == WL_CONNECTED)
{
wifi_connected = true;
+
+#if USING_CONFIG_MODE_LED
+ // turn the LED_BUILTIN OFF to tell us we exit configuration mode.
+ digitalWrite(CONFIG_MODE_LED, LED_OFF);
+#endif
}
else
{
@@ -432,12 +434,17 @@ class ESP_AT_WiFiManager_Lite
{
configuration_mode = false;
ESP_AT_LOGERROR(F("r:gotWBack"));
+
+#if USING_CONFIG_MODE_LED
+ // turn the LED_BUILTIN OFF to tell us we exit configuration mode.
+ digitalWrite(CONFIG_MODE_LED, LED_OFF);
+#endif
}
}
//////////////////////////////////////////////
- void setConfigPortalIP(IPAddress portalIP = IPAddress(192, 168, 4, 1))
+ void setConfigPortalIP(const IPAddress& portalIP = IPAddress(192, 168, 4, 1))
{
portal_apIP = portalIP;
}
@@ -447,7 +454,7 @@ class ESP_AT_WiFiManager_Lite
#define MIN_WIFI_CHANNEL 1
#define MAX_WIFI_CHANNEL 12 // Channel 13 is flaky, because of bad number 13 ;-)
- int setConfigPortalChannel(int channel = 1)
+ int setConfigPortalChannel(const int& channel = 1)
{
// If channel < MIN_WIFI_CHANNEL - 1 or channel > MAX_WIFI_CHANNEL => channel = 1
// If channel == 0 => will use random channel from MIN_WIFI_CHANNEL to MAX_WIFI_CHANNEL
@@ -462,7 +469,7 @@ class ESP_AT_WiFiManager_Lite
//////////////////////////////////////////////
- void setConfigPortal(String ssid = "", String pass = "")
+ void setConfigPortal(const String& ssid = "", const String& pass = "")
{
portal_ssid = ssid;
portal_pass = pass;
@@ -470,7 +477,7 @@ class ESP_AT_WiFiManager_Lite
//////////////////////////////////////////////
- void setSTAStaticIPConfig(IPAddress ip)
+ void setSTAStaticIPConfig(const IPAddress& ip)
{
static_IP = ip;
}
@@ -556,6 +563,13 @@ class ESP_AT_WiFiManager_Lite
return hadConfigData;
}
+ //////////////////////////////////////////////
+
+ bool isConfigMode()
+ {
+ return configuration_mode;
+ }
+
//////////////////////////////////////////////
void resetFunc()
@@ -591,7 +605,7 @@ class ESP_AT_WiFiManager_Lite
//////////////////////////////////////////////
- void displayConfigData(ESP8266_AT_Configuration configData)
+ void displayConfigData(const ESP8266_AT_Configuration& configData)
{
ESP_AT_LOGDEBUG5(F("Hdr="), configData.header, F(",SSID="), configData.wifi_ssid,
F(",PW="), configData.wifi_pw);
@@ -1119,8 +1133,6 @@ class ESP_AT_WiFiManager_Lite
String pitem;
-
-
#if USE_DYNAMIC_PARAMETERS
if (NUM_MENU_ITEMS > 0)
{
@@ -1338,6 +1350,11 @@ class ESP_AT_WiFiManager_Lite
void startConfigurationMode()
{
+#if USING_CONFIG_MODE_LED
+ // turn the LED_BUILTIN ON to tell us we enter configuration mode.
+ digitalWrite(CONFIG_MODE_LED, LED_ON);
+#endif
+
WiFi.configAP(portal_apIP);
if ( (portal_ssid == "") || portal_pass == "" )
diff --git a/src/Esp8266_AT_WM_Lite_DUE.h b/src/Esp8266_AT_WM_Lite_DUE.h
index 08b4126..d2f55d8 100644
--- a/src/Esp8266_AT_WM_Lite_DUE.h
+++ b/src/Esp8266_AT_WM_Lite_DUE.h
@@ -8,25 +8,16 @@
Built by Khoi Hoang https://github.com/khoih-prog/ESP_AT_WM_Lite
Licensed under MIT license
- Version: 1.5.1
+ Version: 1.5.2
Version Modified By Date Comments
------- ----------- ---------- -----------
1.0.0 K Hoang 09/03/2020 Initial coding
- 1.0.1 K Hoang 20/03/2020 Add feature to enable adding dynamically more Credentials parameters in sketch
- 1.0.2 K Hoang 17/04/2020 Fix bug. Add support to SAMD51 and SAMD DUE. WPA2 SSID PW to 63 chars.
- Permit to input special chars such as !,@,#,$,%,^,&,* into data fields.
- 1.0.3 K Hoang 11/06/2020 Add support to nRF52 boards, such as AdaFruit Feather nRF52832, NINA_B30_ublox, etc.
- Add DRD support. Add MultiWiFi support
- 1.0.4 K Hoang 03/07/2020 Add support to ESP32-AT shields. Modify LOAD_DEFAULT_CONFIG_DATA logic.
- Enhance MultiWiFi connection logic. Fix WiFi Status bug.
- 1.1.0 K Hoang 13/04/2021 Fix invalid "blank" Config Data treated as Valid. Optional one set of WiFi Credentials
- 1.2.0 Michael H 28/04/2021 Enable scan of WiFi networks for selection in Configuration Portal
- 1.3.0 K Hoang 12/05/2021 Add support to RASPBERRY_PI_PICO using Arduino-pico core
- 1.4.0 K Hoang 01/06/2021 Add support to Nano_RP2040_Connect, RASPBERRY_PI_PICO using RP2040 Arduino mbed core
- 1.4.1 K Hoang 10/10/2021 Update `platform.ini` and `library.json`
+ ...
1.5.0 K Hoang 08/01/2022 Fix the blocking issue in loop() with configurable WIFI_RECON_INTERVAL
1.5.1 K Hoang 26/01/2022 Update to be compatible with new FlashStorage libraries. Add support to more SAMD/STM32 boards
+ 1.5.2 K Hoang 22/02/2022 Optional Board_Name in Menu. Optimize code by using passing by reference
+ Add optional CONFIG_MODE_LED. Add function isConfigMode()
***************************************************************************************************************************************/
#ifndef Esp8266_AT_WM_Lite_DUE_h
@@ -43,13 +34,13 @@
#endif
#ifndef ESP_AT_WM_LITE_VERSION
- #define ESP_AT_WM_LITE_VERSION "ESP_AT_WM_Lite v1.5.1"
+ #define ESP_AT_WM_LITE_VERSION "ESP_AT_WM_Lite v1.5.2"
#define ESP_AT_WM_LITE_VERSION_MAJOR 1
#define ESP_AT_WM_LITE_VERSION_MINOR 5
- #define ESP_AT_WM_LITE_VERSION_PATCH 1
+ #define ESP_AT_WM_LITE_VERSION_PATCH 2
- #define ESP_AT_WM_LITE_VERSION_INT 1005001
+ #define ESP_AT_WM_LITE_VERSION_INT 1005002
#endif
@@ -168,10 +159,15 @@ typedef struct
#define NUM_WIFI_CREDENTIALS 2
-// Configurable items besides fixed Header, just add board_name
-#define NUM_CONFIGURABLE_ITEMS ( ( 2 * NUM_WIFI_CREDENTIALS ) + 1 )
+#if USING_BOARD_NAME
+ // Configurable items besides fixed Header, just add board_name
+ #define NUM_CONFIGURABLE_ITEMS ( ( 2 * NUM_WIFI_CREDENTIALS ) + 1 )
+#else
+ // Configurable items besides fixed Header, just add board_name
+ #define NUM_CONFIGURABLE_ITEMS ( ( 2 * NUM_WIFI_CREDENTIALS ))
+#endif
-//////////////////////////////////////////////
+////////////////
#define HEADER_MAX_LEN 16
#define BOARD_NAME_MAX_LEN 24
@@ -198,12 +194,20 @@ const char ESP_AT_HTML_HEAD_START[] /*PROGMEM*/ = "div,input{padding:5px;font-size:1em;}input{width:95%;}body{text-align: center;}button{background-color:#16A1E7;color:#fff;line-height:2.4rem;font-size:1.2rem;width:100%;}fieldset{border-radius:0.3rem;margin:0px;}";
+#if USING_BOARD_NAME
const char ESP_AT_HTML_HEAD_END[] /*PROGMEM*/ = "
\
\
"; // DO NOT CHANGE THIS STRING EVER!!!!
+#else
+const char ESP_AT_HTML_HEAD_END[] /*PROGMEM*/ = "