From db32cb12f41c190a2b70b484b0471588f4df5b8f Mon Sep 17 00:00:00 2001 From: Khoi Hoang <57012152+khoih-prog@users.noreply.github.com> Date: Thu, 28 Jan 2021 22:00:39 -0500 Subject: [PATCH] v1.2.0 ### Releases v1.2.0 1. Use new and more efficient [FlashStorage_STM32](https://github.com/khoih-prog/FlashStorage_STM32) and [FlashStorage_SAMD](https://github.com/khoih-prog/FlashStorage_SAMD) library versions. 2. Fix Config Portal bug --- README.md | 60 +-- .../Mega_ESP8266Shield/Mega_ESP8266Shield.ino | 3 +- examples/SAMD_ESP8266Shield/Credentials.h | 3 +- .../SAMD_ESP8266Shield/SAMD_ESP8266Shield.ino | 3 +- examples/SAMD_ESP8266Shield/defines.h | 3 +- examples/SAMD_ESP8266Shield/dynamicParams.h | 3 +- examples/SAM_DUE_ESP8266Shield/Credentials.h | 3 +- .../SAM_DUE_ESP8266Shield.ino | 3 +- examples/SAM_DUE_ESP8266Shield/defines.h | 3 +- .../SAM_DUE_ESP8266Shield/dynamicParams.h | 3 +- examples/STM32_ESP8266Shield/Credentials.h | 3 +- .../STM32_ESP8266Shield.ino | 3 +- examples/STM32_ESP8266Shield/defines.h | 3 +- examples/STM32_ESP8266Shield/dynamicParams.h | 3 +- examples/Teensy40_ESP8266Shield/Credentials.h | 3 +- .../Teensy40_ESP8266Shield.ino | 3 +- examples/Teensy40_ESP8266Shield/defines.h | 3 +- .../Teensy40_ESP8266Shield/dynamicParams.h | 3 +- .../Teensy40_ESP8266Shield_Single.ino | 3 +- examples/nRF52_ESP8266Shield/Credentials.h | 3 +- examples/nRF52_ESP8266Shield/defines.h | 3 +- examples/nRF52_ESP8266Shield/dynamicParams.h | 3 +- .../nRF52_ESP8266Shield.ino | 3 +- library.json | 18 +- library.properties | 6 +- platformio/platformio.ini | 4 + src/Blynk/BlynkDetectDevice.h | 3 +- src/BlynkSimpleShieldEsp8266.h | 5 +- src/BlynkSimpleShieldEsp8266_DUE.h | 5 +- src/BlynkSimpleShieldEsp8266_DUE_WM.h | 48 ++- src/BlynkSimpleShieldEsp8266_SAMD.h | 5 +- src/BlynkSimpleShieldEsp8266_SAMD_WM.h | 60 +-- src/BlynkSimpleShieldEsp8266_STM32.h | 5 +- src/BlynkSimpleShieldEsp8266_STM32_WM.h | 348 +++--------------- src/BlynkSimpleShieldEsp8266_Teensy.h | 5 +- src/BlynkSimpleShieldEsp8266_Teensy_WM.h | 46 ++- ...lynkSimpleShieldEsp8266_Teensy_WM_Single.h | 5 +- src/BlynkSimpleShieldEsp8266_WM.h | 5 +- src/BlynkSimpleShieldEsp8266_nRF52.h | 5 +- src/BlynkSimpleShieldEsp8266_nRF52_WM.h | 44 ++- 40 files changed, 306 insertions(+), 437 deletions(-) diff --git a/README.md b/README.md index 81a7dd5..c119cfb 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,7 @@ * [Currently Supported Boards](#currently-supported-boards) * [Currently Supported AT-command shields](#currently-supported-at-command-shields) * [Changelog](#changelog) + * [Releases v1.2.0](#releases-v120) * [Releases v1.1.1](#releases-v111) * [Major Releases v1.1.0](#major-releases-v110) * [Releases v1.0.7](#releases-v107) @@ -135,6 +136,11 @@ New recent features: ## Changelog +### Releases v1.2.0 + +1. Use new and more efficient [FlashStorage_STM32](https://github.com/khoih-prog/FlashStorage_STM32) and [FlashStorage_SAMD](https://github.com/khoih-prog/FlashStorage_SAMD) library versions. +2. Fix Config Portal bug + ### Releases v1.1.1 1. Add support to **Teensy 3.x boards**, using only Teensy core v1.51 if Config Portal is needed. @@ -215,6 +221,8 @@ With version `v1.0.0` or later, you now can configure: 15. [`Adafruit's LittleFS/InternalFS`](https://www.adafruit.com) for nRF52 16. [`DoubleResetDetector_Generic v1.0.3+`](https://github.com/khoih-prog/DoubleResetDetector_Generic). To install. check [![arduino-library-badge](https://www.ardu-badge.com/badge/DoubleResetDetector_Generic.svg?)](https://www.ardu-badge.com/DoubleResetDetector_Generic) 17. [`ESP_AT_Lib v1.0.0+`](https://github.com/khoih-prog/ESP_AT_Lib) for ESP8266/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) +18. [`FlashStorage_SAMD v1.1.0+`](https://github.com/khoih-prog/FlashStorage_SAMD) for SAMD21/SAMD51 boards. +19. [`FlashStorage_STM32 v1.0.0+`](https://github.com/khoih-prog/FlashStorage_STM32) for STM32F/L/H/G/WB/MP1 boards. To install, check [![arduino-library-badge](https://www.ardu-badge.com/badge/FlashStorage_STM32.svg?)](https://www.ardu-badge.com/FlashStorage_STM32) --- --- @@ -371,11 +379,11 @@ These files must be copied into the directory: #### 2. For Teensy boards - **To be able to compile and run on Teensy boards**, you have to copy the file [Teensy boards.txt](Packages_Patches/hardware/teensy/avr/boards.txt) into Teensy hardware directory (./arduino-1.8.12/hardware/teensy/avr/boards.txt). + **To be able to compile and run on Teensy boards**, you have to copy the file [Teensy boards.txt](Packages_Patches/hardware/teensy/avr/boards.txt) into Teensy hardware directory (./arduino-1.8.13/hardware/teensy/avr/boards.txt). -Supposing the Arduino version is 1.8.12. This file must be copied into the directory: +Supposing the Arduino version is 1.8.13. This file must be copied into the directory: -- `./arduino-1.8.12/hardware/teensy/avr/boards.txt` +- `./arduino-1.8.13/hardware/teensy/avr/boards.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: @@ -1299,7 +1307,7 @@ uint16_t NUM_MENU_ITEMS = 0; ``` Start nRF52_ESP8266Shield on NRF52840_ITSYBITSY -Blynk_Esp8266AT_WM v1.1.1 +Blynk_Esp8266AT_WM v1.2.0 Start Blynk_ESP8266AT_WM [7691] AT version:1.7.4.0(May 11 2020 19:13:04) SDK version:3.0.4(9532ceb) @@ -1408,7 +1416,7 @@ FFFFFFF [260526] h:Rst Start nRF52_ESP8266Shield on NRF52840_ITSYBITSY -Blynk_Esp8266AT_WM v1.1.1 +Blynk_Esp8266AT_WM v1.2.0 Start Blynk_ESP8266AT_WM [7919] AT version:1.7.4.0(May 11 2020 19:13:04) SDK version:3.0.4(9532ceb) @@ -1496,7 +1504,7 @@ CP Button Hit. Rebooting [175987] OK Start nRF52_ESP8266Shield on NRF52840_ITSYBITSY -Blynk_Esp8266AT_WM v1.1.1 +Blynk_Esp8266AT_WM v1.2.0 Start Blynk_ESP8266AT_WM [7466] AT version:1.7.4.0(May 11 2020 19:13:04) SDK version:3.0.4(9532ceb) @@ -1563,7 +1571,7 @@ Persistent CP Button Hit. Rebooting [43432] OK Start nRF52_ESP8266Shield on NRF52840_ITSYBITSY -Blynk_Esp8266AT_WM v1.1.1 +Blynk_Esp8266AT_WM v1.2.0 Start Blynk_ESP8266AT_WM [7441] AT version:1.7.4.0(May 11 2020 19:13:04) SDK version:3.0.4(9532ceb) @@ -1622,7 +1630,7 @@ Port = 1883 ``` Start STM32_ESP8266Shield on NUCLEO_F767ZI -Blynk_Esp8266AT_WM v1.1.1 +Blynk_Esp8266AT_WM v1.2.0 Start Blynk_ESP8266AT_WM [6769] AT version:1.1.0.0(May 11 2016 18:09:56) SDK version:1.5.4(baaeaebb) @@ -1680,7 +1688,7 @@ FFF[60707] h:repl ``` Start STM32_ESP8266Shield on NUCLEO_F767ZI -Blynk_Esp8266AT_WM v1.1.1 +Blynk_Esp8266AT_WM v1.2.0 Start Blynk_ESP8266AT_WM [6768] AT version:1.1.0.0(May 11 2016 18:09:56) SDK version:1.5.4(baaeaebb) @@ -1741,7 +1749,7 @@ CP Button Hit. Rebooting [49650] setForcedCP non-Persistent Start STM32_ESP8266Shield on NUCLEO_F767ZI -Blynk_Esp8266AT_WM v1.1.1 +Blynk_Esp8266AT_WM v1.2.0 Start Blynk_ESP8266AT_WM [6769] AT version:1.1.0.0(May 11 2016 18:09:56) SDK version:1.5.4(baaeaebb) @@ -1780,7 +1788,7 @@ Persistent CP Button Hit. Rebooting [38325] setForcedCP Persistent Start STM32_ESP8266Shield on NUCLEO_F767ZI -Blynk_Esp8266AT_WM v1.1.1 +Blynk_Esp8266AT_WM v1.2.0 Start Blynk_ESP8266AT_WM [6769] AT version:1.1.0.0(May 11 2016 18:09:56) SDK version:1.5.4(baaeaebb) @@ -1820,7 +1828,7 @@ FFFFFF ``` Start SAM_DUE_ESP8266Shield on SAM DUE -Blynk_Esp8266AT_WM v1.1.1 +Blynk_Esp8266AT_WM v1.2.0 Start Blynk_ESP8266AT_WM [6779] AT version:1.1.0.0(May 11 2016 18:09:56) SDK version:1.5.4(baaeaebb) @@ -1891,7 +1899,7 @@ FFFF[126459] h:repl id ``` Start SAM_DUE_ESP8266Shield on SAM DUE -Blynk_Esp8266AT_WM v1.1.1 +Blynk_Esp8266AT_WM v1.2.0 Start Blynk_ESP8266AT_WM [6771] AT version:1.1.0.0(May 11 2016 18:09:56) SDK version:1.5.4(baaeaebb) @@ -1956,7 +1964,7 @@ CP Button Hit. Rebooting [272907] setForcedCP non-Persistent Start SAM_DUE_ESP8266Shield on SAM DUE -Blynk_Esp8266AT_WM v1.1.1 +Blynk_Esp8266AT_WM v1.2.0 Start Blynk_ESP8266AT_WM [6771] AT version:1.1.0.0(May 11 2016 18:09:56) SDK version:1.5.4(baaeaebb) @@ -1999,7 +2007,7 @@ Persistent CP Button Hit. Rebooting [83192] setForcedCP Persistent Start SAM_DUE_ESP8266Shield on SAM DUE -Blynk_Esp8266AT_WM v1.1.1 +Blynk_Esp8266AT_WM v1.2.0 Start Blynk_ESP8266AT_WM [6771] AT version:1.1.0.0(May 11 2016 18:09:56) SDK version:1.5.4(baaeaebb) @@ -2042,7 +2050,7 @@ MQTT Server = default-mqtt-server ``` Start SAMD_ESP8266Shield on ITSYBITSY_M4 -Blynk_Esp8266AT_WM v1.1.1 +Blynk_Esp8266AT_WM v1.2.0 Start Blynk_ESP8266AT_WM [30676] AT version:1.7.4.0(May 11 2020 19:13:04) SDK version:3.0.4(9532ceb) @@ -2083,7 +2091,7 @@ F ``` Start SAMD_ESP8266Shield on ITSYBITSY_M4 -Blynk_Esp8266AT_WM v1.1.1 +Blynk_Esp8266AT_WM v1.2.0 Start Blynk_ESP8266AT_WM [35347] AT version:1.7.4.0(May 11 2020 19:13:04) SDK version:3.0.4(9532ceb) @@ -2152,7 +2160,7 @@ CP Button Hit. Rebooting Start SAMD_ESP8266Shield on ITSYBITSY_M4 -Blynk_Esp8266AT_WM v1.1.1 +Blynk_Esp8266AT_WM v1.2.0 Start Blynk_ESP8266AT_WM [30676] AT version:1.7.4.0(May 11 2020 19:13:04) SDK version:3.0.4(9532ceb) @@ -2195,7 +2203,7 @@ F Persistent CP Button Hit. Rebooting [40547] setForcedCP Persistent Start SAMD_ESP8266Shield on ITSYBITSY_M4 -Blynk_Esp8266AT_WM v1.1.1 +Blynk_Esp8266AT_WM v1.2.0 Start Blynk_ESP8266AT_WM [34937] AT version:1.7.4.0(May 11 2020 19:13:04) SDK version:3.0.4(9532ceb) @@ -2239,7 +2247,7 @@ FF ``` Start Teensy_ESP8266Shield on TEENSY 4.1/4.0 -Blynk_Esp8266AT_WM v1.1.1 +Blynk_Esp8266AT_WM v1.2.0 [8878] AT version:1.7.4.0(May 11 2020 19:13:04) SDK version:3.0.4(9532ceb) compile time:May 27 2020 10:12:17 @@ -2318,7 +2326,7 @@ FFFF[106580] h:repl id ``` Start Teensy_ESP8266Shield on TEENSY 4.1/4.0 -Blynk_Esp8266AT_WM v1.1.1 +Blynk_Esp8266AT_WM v1.2.0 Start Blynk_ESP8266AT_WM [80347] AT version:1.7.4.0(May 11 2020 19:13:04) SDK version:3.0.4(9532ceb) @@ -2425,6 +2433,11 @@ Sometimes, the library will only work if you update the `ESP8266 AT shield` core ## Releases +### Releases v1.2.0 + +1. Use new and more efficient [FlashStorage_STM32](https://github.com/khoih-prog/FlashStorage_STM32) and [FlashStorage_SAMD](https://github.com/khoih-prog/FlashStorage_SAMD) library versions. +2. Fix Config Portal bug + ### Releases v1.1.1 1. Add support to **Teensy 3.x boards**, using only Teensy core v1.51 if Config Portal is needed. @@ -2496,7 +2509,7 @@ Sometimes, the library will only work if you update the `ESP8266 AT shield` core ### Issues -Submit issues to: [Blynk_WM issues](https://github.com/khoih-prog/Blynk_Esp8266AT_WM/issues) +Submit issues to: [Blynk_Esp8266AT_WM issues](https://github.com/khoih-prog/Blynk_Esp8266AT_WM/issues) --- --- @@ -2515,7 +2528,7 @@ Submit issues to: [Blynk_WM issues](https://github.com/khoih-prog/Blynk_Esp8266A 4. If the config data not entered completely (SSID, password, Server and Blynk token), entering config portal 5. Add configurable Config Portal IP, SSID and Password 6. Add configurable Static IP, GW, Subnet Mask and 2 DNS Servers' IP Addresses. - 7. Add support to **nRF52, SAMD21/SAMD51, STM32F, SAM-DUE** + 7. Add support to **nRF52, SAMD21/SAMD51, STM32F/L/H/G/WB/MP1, SAM-DUE** 8. Add support to **ESP32-AT** shields. 9. Add MultiWiFi features with auto(re)connect 10. Add DRD @@ -2525,6 +2538,7 @@ Submit issues to: [Blynk_WM issues](https://github.com/khoih-prog/Blynk_Esp8266A 14. Add support to all **STM32F/L/H/G/WB/MP1** boards, using emulated or integrated EEPROM 15. Add support to **Teensy** boards using Teensy core v1.51 for Config Portal 16. Add Table-of-Contents +17. Use more efficient [FlashStorage_STM32](https://github.com/khoih-prog/FlashStorage_STM32) and [FlashStorage_SAMD](https://github.com/khoih-prog/FlashStorage_SAMD) library versions. --- diff --git a/examples/Mega_ESP8266Shield/Mega_ESP8266Shield.ino b/examples/Mega_ESP8266Shield/Mega_ESP8266Shield.ino index 7aea6de..59b3fd4 100644 --- a/examples/Mega_ESP8266Shield/Mega_ESP8266Shield.ino +++ b/examples/Mega_ESP8266Shield/Mega_ESP8266Shield.ino @@ -8,7 +8,7 @@ Based on and Modified from Blynk library v0.6.1 https://github.com/blynkkk/blynk-library/releases Built by Khoi Hoang https://github.com/khoih-prog/Blynk_Esp8266AT_WM Licensed under MIT license - Version: 1.1.1 + Version: 1.2.0 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -23,6 +23,7 @@ 1.0.7 K Hoang 27/07/2020 Add support to all STM32F/L/H/G/WB/MP1 and Seeeduino SAMD21/SAMD51 boards. 1.1.0 K Hoang 15/01/2021 Restore support to Teensy to be used only with Teensy core v1.51. 1.1.1 K Hoang 24/01/2021 Add support to Teensy 3.x, to be used only with Teensy core v1.51. + 1.2.0 K Hoang 28/01/2021 Fix bug. Use more efficient FlashStorage_STM32 and FlashStorage_SAMD. *****************************************************************************************************************************/ /**************************************************************************************************************************** Important notes: diff --git a/examples/SAMD_ESP8266Shield/Credentials.h b/examples/SAMD_ESP8266Shield/Credentials.h index fdf694d..7c4979c 100644 --- a/examples/SAMD_ESP8266Shield/Credentials.h +++ b/examples/SAMD_ESP8266Shield/Credentials.h @@ -7,7 +7,7 @@ Based on and Modified from Blynk library v0.6.1 https://github.com/blynkkk/blynk-library/releases Built by Khoi Hoang https://github.com/khoih-prog/Blynk_Esp8266AT_WM Licensed under MIT license - Version: 1.1.1 + Version: 1.2.0 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -22,6 +22,7 @@ 1.0.7 K Hoang 27/07/2020 Add support to all STM32F/L/H/G/WB/MP1 and Seeeduino SAMD21/SAMD51 boards. 1.1.0 K Hoang 15/01/2021 Restore support to Teensy to be used only with Teensy core v1.51. 1.1.1 K Hoang 24/01/2021 Add support to Teensy 3.x, to be used only with Teensy core v1.51. + 1.2.0 K Hoang 28/01/2021 Fix bug. Use more efficient FlashStorage_STM32 and FlashStorage_SAMD. *****************************************************************************************************************************/ #ifndef Credentials_h diff --git a/examples/SAMD_ESP8266Shield/SAMD_ESP8266Shield.ino b/examples/SAMD_ESP8266Shield/SAMD_ESP8266Shield.ino index 5c35441..babe185 100644 --- a/examples/SAMD_ESP8266Shield/SAMD_ESP8266Shield.ino +++ b/examples/SAMD_ESP8266Shield/SAMD_ESP8266Shield.ino @@ -8,7 +8,7 @@ Based on and Modified from Blynk library v0.6.1 https://github.com/blynkkk/blynk-library/releases Built by Khoi Hoang https://github.com/khoih-prog/Blynk_Esp8266AT_WM Licensed under MIT license - Version: 1.1.1 + Version: 1.2.0 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -23,6 +23,7 @@ 1.0.7 K Hoang 27/07/2020 Add support to all STM32F/L/H/G/WB/MP1 and Seeeduino SAMD21/SAMD51 boards. 1.1.0 K Hoang 15/01/2021 Restore support to Teensy to be used only with Teensy core v1.51. 1.1.1 K Hoang 24/01/2021 Add support to Teensy 3.x, to be used only with Teensy core v1.51. + 1.2.0 K Hoang 28/01/2021 Fix bug. Use more efficient FlashStorage_STM32 and FlashStorage_SAMD. *****************************************************************************************************************************/ /**************************************************************************************************************************** Important notes: diff --git a/examples/SAMD_ESP8266Shield/defines.h b/examples/SAMD_ESP8266Shield/defines.h index 895c524..c2343ad 100644 --- a/examples/SAMD_ESP8266Shield/defines.h +++ b/examples/SAMD_ESP8266Shield/defines.h @@ -7,7 +7,7 @@ Based on and Modified from Blynk library v0.6.1 https://github.com/blynkkk/blynk-library/releases Built by Khoi Hoang https://github.com/khoih-prog/Blynk_Esp8266AT_WM Licensed under MIT license - Version: 1.1.1 + Version: 1.2.0 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -22,6 +22,7 @@ 1.0.7 K Hoang 27/07/2020 Add support to all STM32F/L/H/G/WB/MP1 and Seeeduino SAMD21/SAMD51 boards. 1.1.0 K Hoang 15/01/2021 Restore support to Teensy to be used only with Teensy core v1.51. 1.1.1 K Hoang 24/01/2021 Add support to Teensy 3.x, to be used only with Teensy core v1.51. + 1.2.0 K Hoang 28/01/2021 Fix bug. Use more efficient FlashStorage_STM32 and FlashStorage_SAMD. *****************************************************************************************************************************/ #ifndef defines_h diff --git a/examples/SAMD_ESP8266Shield/dynamicParams.h b/examples/SAMD_ESP8266Shield/dynamicParams.h index f7d3eae..e03facf 100644 --- a/examples/SAMD_ESP8266Shield/dynamicParams.h +++ b/examples/SAMD_ESP8266Shield/dynamicParams.h @@ -7,7 +7,7 @@ Based on and Modified from Blynk library v0.6.1 https://github.com/blynkkk/blynk-library/releases Built by Khoi Hoang https://github.com/khoih-prog/Blynk_Esp8266AT_WM Licensed under MIT license - Version: 1.1.1 + Version: 1.2.0 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -22,6 +22,7 @@ 1.0.7 K Hoang 27/07/2020 Add support to all STM32F/L/H/G/WB/MP1 and Seeeduino SAMD21/SAMD51 boards. 1.1.0 K Hoang 15/01/2021 Restore support to Teensy to be used only with Teensy core v1.51. 1.1.1 K Hoang 24/01/2021 Add support to Teensy 3.x, to be used only with Teensy core v1.51. + 1.2.0 K Hoang 28/01/2021 Fix bug. Use more efficient FlashStorage_STM32 and FlashStorage_SAMD. *****************************************************************************************************************************/ #ifndef dynamicParams_h diff --git a/examples/SAM_DUE_ESP8266Shield/Credentials.h b/examples/SAM_DUE_ESP8266Shield/Credentials.h index e3bdea1..5142712 100644 --- a/examples/SAM_DUE_ESP8266Shield/Credentials.h +++ b/examples/SAM_DUE_ESP8266Shield/Credentials.h @@ -7,7 +7,7 @@ Based on and Modified from Blynk library v0.6.1 https://github.com/blynkkk/blynk-library/releases Built by Khoi Hoang https://github.com/khoih-prog/Blynk_Esp8266AT_WM Licensed under MIT license - Version: 1.1.1 + Version: 1.2.0 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -22,6 +22,7 @@ 1.0.7 K Hoang 27/07/2020 Add support to all STM32F/L/H/G/WB/MP1 and Seeeduino SAMD21/SAMD51 boards. 1.1.0 K Hoang 15/01/2021 Restore support to Teensy to be used only with Teensy core v1.51. 1.1.1 K Hoang 24/01/2021 Add support to Teensy 3.x, to be used only with Teensy core v1.51. + 1.2.0 K Hoang 28/01/2021 Fix bug. Use more efficient FlashStorage_STM32 and FlashStorage_SAMD. *****************************************************************************************************************************/ #ifndef Credentials_h diff --git a/examples/SAM_DUE_ESP8266Shield/SAM_DUE_ESP8266Shield.ino b/examples/SAM_DUE_ESP8266Shield/SAM_DUE_ESP8266Shield.ino index 6edbaf8..f0574ee 100644 --- a/examples/SAM_DUE_ESP8266Shield/SAM_DUE_ESP8266Shield.ino +++ b/examples/SAM_DUE_ESP8266Shield/SAM_DUE_ESP8266Shield.ino @@ -8,7 +8,7 @@ Based on and Modified from Blynk library v0.6.1 https://github.com/blynkkk/blynk-library/releases Built by Khoi Hoang https://github.com/khoih-prog/Blynk_Esp8266AT_WM Licensed under MIT license - Version: 1.1.1 + Version: 1.2.0 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -23,6 +23,7 @@ 1.0.7 K Hoang 27/07/2020 Add support to all STM32F/L/H/G/WB/MP1 and Seeeduino SAMD21/SAMD51 boards. 1.1.0 K Hoang 15/01/2021 Restore support to Teensy to be used only with Teensy core v1.51. 1.1.1 K Hoang 24/01/2021 Add support to Teensy 3.x, to be used only with Teensy core v1.51. + 1.2.0 K Hoang 28/01/2021 Fix bug. Use more efficient FlashStorage_STM32 and FlashStorage_SAMD. *****************************************************************************************************************************/ /**************************************************************************************************************************** Important notes: diff --git a/examples/SAM_DUE_ESP8266Shield/defines.h b/examples/SAM_DUE_ESP8266Shield/defines.h index 6fe4efa..d324c1d 100644 --- a/examples/SAM_DUE_ESP8266Shield/defines.h +++ b/examples/SAM_DUE_ESP8266Shield/defines.h @@ -7,7 +7,7 @@ Based on and Modified from Blynk library v0.6.1 https://github.com/blynkkk/blynk-library/releases Built by Khoi Hoang https://github.com/khoih-prog/Blynk_Esp8266AT_WM Licensed under MIT license - Version: 1.1.1 + Version: 1.2.0 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -22,6 +22,7 @@ 1.0.7 K Hoang 27/07/2020 Add support to all STM32F/L/H/G/WB/MP1 and Seeeduino SAMD21/SAMD51 boards. 1.1.0 K Hoang 15/01/2021 Restore support to Teensy to be used only with Teensy core v1.51. 1.1.1 K Hoang 24/01/2021 Add support to Teensy 3.x, to be used only with Teensy core v1.51. + 1.2.0 K Hoang 28/01/2021 Fix bug. Use more efficient FlashStorage_STM32 and FlashStorage_SAMD. *****************************************************************************************************************************/ #ifndef defines_h diff --git a/examples/SAM_DUE_ESP8266Shield/dynamicParams.h b/examples/SAM_DUE_ESP8266Shield/dynamicParams.h index 4285d65..4b1fa28 100644 --- a/examples/SAM_DUE_ESP8266Shield/dynamicParams.h +++ b/examples/SAM_DUE_ESP8266Shield/dynamicParams.h @@ -7,7 +7,7 @@ Based on and Modified from Blynk library v0.6.1 https://github.com/blynkkk/blynk-library/releases Built by Khoi Hoang https://github.com/khoih-prog/Blynk_Esp8266AT_WM Licensed under MIT license - Version: 1.1.1 + Version: 1.2.0 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -22,6 +22,7 @@ 1.0.7 K Hoang 27/07/2020 Add support to all STM32F/L/H/G/WB/MP1 and Seeeduino SAMD21/SAMD51 boards. 1.1.0 K Hoang 15/01/2021 Restore support to Teensy to be used only with Teensy core v1.51. 1.1.1 K Hoang 24/01/2021 Add support to Teensy 3.x, to be used only with Teensy core v1.51. + 1.2.0 K Hoang 28/01/2021 Fix bug. Use more efficient FlashStorage_STM32 and FlashStorage_SAMD. *****************************************************************************************************************************/ #ifndef dynamicParams_h diff --git a/examples/STM32_ESP8266Shield/Credentials.h b/examples/STM32_ESP8266Shield/Credentials.h index deb13e1..562dc0a 100644 --- a/examples/STM32_ESP8266Shield/Credentials.h +++ b/examples/STM32_ESP8266Shield/Credentials.h @@ -7,7 +7,7 @@ Based on and Modified from Blynk library v0.6.1 https://github.com/blynkkk/blynk-library/releases Built by Khoi Hoang https://github.com/khoih-prog/Blynk_Esp8266AT_WM Licensed under MIT license - Version: 1.1.1 + Version: 1.2.0 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -22,6 +22,7 @@ 1.0.7 K Hoang 27/07/2020 Add support to all STM32F/L/H/G/WB/MP1 and Seeeduino SAMD21/SAMD51 boards. 1.1.0 K Hoang 15/01/2021 Restore support to Teensy to be used only with Teensy core v1.51. 1.1.1 K Hoang 24/01/2021 Add support to Teensy 3.x, to be used only with Teensy core v1.51. + 1.2.0 K Hoang 28/01/2021 Fix bug. Use more efficient FlashStorage_STM32 and FlashStorage_SAMD. *****************************************************************************************************************************/ #ifndef Credentials_h diff --git a/examples/STM32_ESP8266Shield/STM32_ESP8266Shield.ino b/examples/STM32_ESP8266Shield/STM32_ESP8266Shield.ino index 39e9ad9..edf984d 100644 --- a/examples/STM32_ESP8266Shield/STM32_ESP8266Shield.ino +++ b/examples/STM32_ESP8266Shield/STM32_ESP8266Shield.ino @@ -8,7 +8,7 @@ Based on and Modified from Blynk library v0.6.1 https://github.com/blynkkk/blynk-library/releases Built by Khoi Hoang https://github.com/khoih-prog/Blynk_Esp8266AT_WM Licensed under MIT license - Version: 1.1.1 + Version: 1.2.0 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -23,6 +23,7 @@ 1.0.7 K Hoang 27/07/2020 Add support to all STM32F/L/H/G/WB/MP1 and Seeeduino SAMD21/SAMD51 boards. 1.1.0 K Hoang 15/01/2021 Restore support to Teensy to be used only with Teensy core v1.51. 1.1.1 K Hoang 24/01/2021 Add support to Teensy 3.x, to be used only with Teensy core v1.51. + 1.2.0 K Hoang 28/01/2021 Fix bug. Use more efficient FlashStorage_STM32 and FlashStorage_SAMD. *****************************************************************************************************************************/ /**************************************************************************************************************************** Important notes: diff --git a/examples/STM32_ESP8266Shield/defines.h b/examples/STM32_ESP8266Shield/defines.h index 2c2727b..9fc410e 100644 --- a/examples/STM32_ESP8266Shield/defines.h +++ b/examples/STM32_ESP8266Shield/defines.h @@ -7,7 +7,7 @@ Based on and Modified from Blynk library v0.6.1 https://github.com/blynkkk/blynk-library/releases Built by Khoi Hoang https://github.com/khoih-prog/Blynk_Esp8266AT_WM Licensed under MIT license - Version: 1.1.1 + Version: 1.2.0 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -22,6 +22,7 @@ 1.0.7 K Hoang 27/07/2020 Add support to all STM32F/L/H/G/WB/MP1 and Seeeduino SAMD21/SAMD51 boards. 1.1.0 K Hoang 15/01/2021 Restore support to Teensy to be used only with Teensy core v1.51. 1.1.1 K Hoang 24/01/2021 Add support to Teensy 3.x, to be used only with Teensy core v1.51. + 1.2.0 K Hoang 28/01/2021 Fix bug. Use more efficient FlashStorage_STM32 and FlashStorage_SAMD. *****************************************************************************************************************************/ #ifndef defines_h diff --git a/examples/STM32_ESP8266Shield/dynamicParams.h b/examples/STM32_ESP8266Shield/dynamicParams.h index c665342..b39eb33 100644 --- a/examples/STM32_ESP8266Shield/dynamicParams.h +++ b/examples/STM32_ESP8266Shield/dynamicParams.h @@ -7,7 +7,7 @@ Based on and Modified from Blynk library v0.6.1 https://github.com/blynkkk/blynk-library/releases Built by Khoi Hoang https://github.com/khoih-prog/Blynk_Esp8266AT_WM Licensed under MIT license - Version: 1.1.1 + Version: 1.2.0 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -22,6 +22,7 @@ 1.0.7 K Hoang 27/07/2020 Add support to all STM32F/L/H/G/WB/MP1 and Seeeduino SAMD21/SAMD51 boards. 1.1.0 K Hoang 15/01/2021 Restore support to Teensy to be used only with Teensy core v1.51. 1.1.1 K Hoang 24/01/2021 Add support to Teensy 3.x, to be used only with Teensy core v1.51. + 1.2.0 K Hoang 28/01/2021 Fix bug. Use more efficient FlashStorage_STM32 and FlashStorage_SAMD. *****************************************************************************************************************************/ #ifndef dynamicParams_h diff --git a/examples/Teensy40_ESP8266Shield/Credentials.h b/examples/Teensy40_ESP8266Shield/Credentials.h index f9bd5b9..45c9b2d 100644 --- a/examples/Teensy40_ESP8266Shield/Credentials.h +++ b/examples/Teensy40_ESP8266Shield/Credentials.h @@ -7,7 +7,7 @@ Based on and Modified from Blynk library v0.6.1 https://github.com/blynkkk/blynk-library/releases Built by Khoi Hoang https://github.com/khoih-prog/Blynk_Esp8266AT_WM Licensed under MIT license - Version: 1.1.1 + Version: 1.2.0 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -22,6 +22,7 @@ 1.0.7 K Hoang 27/07/2020 Add support to all STM32F/L/H/G/WB/MP1 and Seeeduino SAMD21/SAMD51 boards. 1.1.0 K Hoang 15/01/2021 Restore support to Teensy to be used only with Teensy core v1.51. 1.1.1 K Hoang 24/01/2021 Add support to Teensy 3.x, to be used only with Teensy core v1.51. + 1.2.0 K Hoang 28/01/2021 Fix bug. Use more efficient FlashStorage_STM32 and FlashStorage_SAMD. *****************************************************************************************************************************/ #ifndef Credentials_h diff --git a/examples/Teensy40_ESP8266Shield/Teensy40_ESP8266Shield.ino b/examples/Teensy40_ESP8266Shield/Teensy40_ESP8266Shield.ino index f0ed6b9..c276fb7 100644 --- a/examples/Teensy40_ESP8266Shield/Teensy40_ESP8266Shield.ino +++ b/examples/Teensy40_ESP8266Shield/Teensy40_ESP8266Shield.ino @@ -8,7 +8,7 @@ Based on and Modified from Blynk library v0.6.1 https://github.com/blynkkk/blynk-library/releases Built by Khoi Hoang https://github.com/khoih-prog/Blynk_Esp8266AT_WM Licensed under MIT license - Version: 1.1.1 + Version: 1.2.0 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -23,6 +23,7 @@ 1.0.7 K Hoang 27/07/2020 Add support to all STM32F/L/H/G/WB/MP1 and Seeeduino SAMD21/SAMD51 boards. 1.1.0 K Hoang 15/01/2021 Restore support to Teensy to be used only with Teensy core v1.51. 1.1.1 K Hoang 24/01/2021 Add support to Teensy 3.x, to be used only with Teensy core v1.51. + 1.2.0 K Hoang 28/01/2021 Fix bug. Use more efficient FlashStorage_STM32 and FlashStorage_SAMD. *****************************************************************************************************************************/ #include "defines.h" diff --git a/examples/Teensy40_ESP8266Shield/defines.h b/examples/Teensy40_ESP8266Shield/defines.h index eb9b571..4b14e73 100644 --- a/examples/Teensy40_ESP8266Shield/defines.h +++ b/examples/Teensy40_ESP8266Shield/defines.h @@ -7,7 +7,7 @@ Based on and Modified from Blynk library v0.6.1 https://github.com/blynkkk/blynk-library/releases Built by Khoi Hoang https://github.com/khoih-prog/Blynk_Esp8266AT_WM Licensed under MIT license - Version: 1.1.1 + Version: 1.2.0 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -22,6 +22,7 @@ 1.0.7 K Hoang 27/07/2020 Add support to all STM32F/L/H/G/WB/MP1 and Seeeduino SAMD21/SAMD51 boards. 1.1.0 K Hoang 15/01/2021 Restore support to Teensy to be used only with Teensy core v1.51. 1.1.1 K Hoang 24/01/2021 Add support to Teensy 3.x, to be used only with Teensy core v1.51. + 1.2.0 K Hoang 28/01/2021 Fix bug. Use more efficient FlashStorage_STM32 and FlashStorage_SAMD. *****************************************************************************************************************************/ #ifndef defines_h diff --git a/examples/Teensy40_ESP8266Shield/dynamicParams.h b/examples/Teensy40_ESP8266Shield/dynamicParams.h index 1832e0f..ba91370 100644 --- a/examples/Teensy40_ESP8266Shield/dynamicParams.h +++ b/examples/Teensy40_ESP8266Shield/dynamicParams.h @@ -7,7 +7,7 @@ Based on and Modified from Blynk library v0.6.1 https://github.com/blynkkk/blynk-library/releases Built by Khoi Hoang https://github.com/khoih-prog/Blynk_Esp8266AT_WM Licensed under MIT license - Version: 1.1.1 + Version: 1.2.0 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -22,6 +22,7 @@ 1.0.7 K Hoang 27/07/2020 Add support to all STM32F/L/H/G/WB/MP1 and Seeeduino SAMD21/SAMD51 boards. 1.1.0 K Hoang 15/01/2021 Restore support to Teensy to be used only with Teensy core v1.51. 1.1.1 K Hoang 24/01/2021 Add support to Teensy 3.x, to be used only with Teensy core v1.51. + 1.2.0 K Hoang 28/01/2021 Fix bug. Use more efficient FlashStorage_STM32 and FlashStorage_SAMD. *****************************************************************************************************************************/ #ifndef dynamicParams_h diff --git a/examples/Teensy40_ESP8266Shield_Single/Teensy40_ESP8266Shield_Single.ino b/examples/Teensy40_ESP8266Shield_Single/Teensy40_ESP8266Shield_Single.ino index dfc9da6..717f470 100644 --- a/examples/Teensy40_ESP8266Shield_Single/Teensy40_ESP8266Shield_Single.ino +++ b/examples/Teensy40_ESP8266Shield_Single/Teensy40_ESP8266Shield_Single.ino @@ -8,7 +8,7 @@ Based on and Modified from Blynk library v0.6.1 https://github.com/blynkkk/blynk-library/releases Built by Khoi Hoang https://github.com/khoih-prog/Blynk_Esp8266AT_WM Licensed under MIT license - Version: 1.1.1 + Version: 1.2.0 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -23,6 +23,7 @@ 1.0.7 K Hoang 27/07/2020 Add support to all STM32F/L/H/G/WB/MP1 and Seeeduino SAMD21/SAMD51 boards. 1.1.0 K Hoang 15/01/2021 Restore support to Teensy to be used only with Teensy core v1.51. 1.1.1 K Hoang 24/01/2021 Add support to Teensy 3.x, to be used only with Teensy core v1.51. + 1.2.0 K Hoang 28/01/2021 Fix bug. Use more efficient FlashStorage_STM32 and FlashStorage_SAMD. *****************************************************************************************************************************/ /* Comment this out to disable prints and save space */ diff --git a/examples/nRF52_ESP8266Shield/Credentials.h b/examples/nRF52_ESP8266Shield/Credentials.h index 9600147..235d26e 100644 --- a/examples/nRF52_ESP8266Shield/Credentials.h +++ b/examples/nRF52_ESP8266Shield/Credentials.h @@ -7,7 +7,7 @@ Based on and Modified from Blynk library v0.6.1 https://github.com/blynkkk/blynk-library/releases Built by Khoi Hoang https://github.com/khoih-prog/Blynk_Esp8266AT_WM Licensed under MIT license - Version: 1.1.1 + Version: 1.2.0 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -22,6 +22,7 @@ 1.0.7 K Hoang 27/07/2020 Add support to all STM32F/L/H/G/WB/MP1 and Seeeduino SAMD21/SAMD51 boards. 1.1.0 K Hoang 15/01/2021 Restore support to Teensy to be used only with Teensy core v1.51. 1.1.1 K Hoang 24/01/2021 Add support to Teensy 3.x, to be used only with Teensy core v1.51. + 1.2.0 K Hoang 28/01/2021 Fix bug. Use more efficient FlashStorage_STM32 and FlashStorage_SAMD. *****************************************************************************************************************************/ #ifndef Credentials_h diff --git a/examples/nRF52_ESP8266Shield/defines.h b/examples/nRF52_ESP8266Shield/defines.h index f45af4b..9f901aa 100644 --- a/examples/nRF52_ESP8266Shield/defines.h +++ b/examples/nRF52_ESP8266Shield/defines.h @@ -7,7 +7,7 @@ Based on and Modified from Blynk library v0.6.1 https://github.com/blynkkk/blynk-library/releases Built by Khoi Hoang https://github.com/khoih-prog/Blynk_Esp8266AT_WM Licensed under MIT license - Version: 1.1.1 + Version: 1.2.0 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -22,6 +22,7 @@ 1.0.7 K Hoang 27/07/2020 Add support to all STM32F/L/H/G/WB/MP1 and Seeeduino SAMD21/SAMD51 boards. 1.1.0 K Hoang 15/01/2021 Restore support to Teensy to be used only with Teensy core v1.51. 1.1.1 K Hoang 24/01/2021 Add support to Teensy 3.x, to be used only with Teensy core v1.51. + 1.2.0 K Hoang 28/01/2021 Fix bug. Use more efficient FlashStorage_STM32 and FlashStorage_SAMD. *****************************************************************************************************************************/ #ifndef defines_h diff --git a/examples/nRF52_ESP8266Shield/dynamicParams.h b/examples/nRF52_ESP8266Shield/dynamicParams.h index f6cd8ed..d94a562 100644 --- a/examples/nRF52_ESP8266Shield/dynamicParams.h +++ b/examples/nRF52_ESP8266Shield/dynamicParams.h @@ -7,7 +7,7 @@ Based on and Modified from Blynk library v0.6.1 https://github.com/blynkkk/blynk-library/releases Built by Khoi Hoang https://github.com/khoih-prog/Blynk_Esp8266AT_WM Licensed under MIT license - Version: 1.1.1 + Version: 1.2.0 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -22,6 +22,7 @@ 1.0.7 K Hoang 27/07/2020 Add support to all STM32F/L/H/G/WB/MP1 and Seeeduino SAMD21/SAMD51 boards. 1.1.0 K Hoang 15/01/2021 Restore support to Teensy to be used only with Teensy core v1.51. 1.1.1 K Hoang 24/01/2021 Add support to Teensy 3.x, to be used only with Teensy core v1.51. + 1.2.0 K Hoang 28/01/2021 Fix bug. Use more efficient FlashStorage_STM32 and FlashStorage_SAMD. *****************************************************************************************************************************/ #ifndef dynamicParams_h diff --git a/examples/nRF52_ESP8266Shield/nRF52_ESP8266Shield.ino b/examples/nRF52_ESP8266Shield/nRF52_ESP8266Shield.ino index 99640ab..7251d01 100644 --- a/examples/nRF52_ESP8266Shield/nRF52_ESP8266Shield.ino +++ b/examples/nRF52_ESP8266Shield/nRF52_ESP8266Shield.ino @@ -8,7 +8,7 @@ Based on and Modified from Blynk library v0.6.1 https://github.com/blynkkk/blynk-library/releases Built by Khoi Hoang https://github.com/khoih-prog/Blynk_Esp8266AT_WM Licensed under MIT license - Version: 1.1.1 + Version: 1.2.0 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -23,6 +23,7 @@ 1.0.7 K Hoang 27/07/2020 Add support to all STM32F/L/H/G/WB/MP1 and Seeeduino SAMD21/SAMD51 boards. 1.1.0 K Hoang 15/01/2021 Restore support to Teensy to be used only with Teensy core v1.51. 1.1.1 K Hoang 24/01/2021 Add support to Teensy 3.x, to be used only with Teensy core v1.51. + 1.2.0 K Hoang 28/01/2021 Fix bug. Use more efficient FlashStorage_STM32 and FlashStorage_SAMD. *****************************************************************************************************************************/ /**************************************************************************************************************************** Important notes: diff --git a/library.json b/library.json index 0ba18ad..15438ba 100644 --- a/library.json +++ b/library.json @@ -1,8 +1,8 @@ { "name": "Blynk_Esp8266AT_WM", - "version": "1.1.1", - "description": "Simple WiFiManager for Blynk and Mega, SAM DUE, SAMD21, SAMD51, nRF52, STM32, etc. boards running ESP8266/ESP32-AT shields, configuration data saved in EEPROM, SAMD EEPROM-emulated FlashStorage, SAM-DUE DueFlashStorage or nRF52 LittleFS", - "keywords": "sensors, control, device, smartphone, mobile, app, web, cloud, communication, protocol, iot, m2m, wifi, ble, bluetooth, ethernet, usb, serial, gsm, gprs, 3g, data, esp8266, esp32, http", + "version": "1.2.0", + "description": "Simple WiFiManager for Blynk with MultiWiFi Credentials, for Mega, SAM DUE, SAMD21, SAMD51, nRF52, STM32, Teensy, etc. boards running ESP8266/ESP32-AT shields. Configuration data saved in EEPROM, EEPROM-emulated FlashStorage_STM32 or FlashStorage_SAMD, SAM-DUE DueFlashStorage or nRF52 LittleFS.", + "keywords": "sensors, control, device, smartphone, mobile, app, web, cloud, communication, protocol, iot, m2m, wifi, ble, bluetooth, ethernet, usb, serial, gsm, gprs, 3g, data, esp8266, esp32, http, flashstorage, flash-storage, emulated-eeprom, wifimanager, credentials, samd, sam-due, nrf52, stm32, eeprom, littlefs, esp-at, esp8266-at, esp32-at", "authors": { "name": "Khoi Hoang", @@ -42,6 +42,18 @@ "version": "^1.0.3", "platforms": ["*"] }, + { + "owner": "khoih.prog", + "name": "FlashStorage_SAMD", + "version": "^1.1.0", + "platforms": ["*"] + }, + { + "owner": "khoih.prog", + "name": "FlashStorage_STM32", + "version": "^1.0.0", + "platforms": ["*"] + }, { "owner": "khoih-prog", "name": "ESP_AT_Lib", diff --git a/library.properties b/library.properties index 3837966..87a3c66 100644 --- a/library.properties +++ b/library.properties @@ -1,11 +1,11 @@ name=Blynk_Esp8266AT_WM -version=1.1.1 +version=1.2.0 author=Khoi Hoang license=MIT maintainer=Khoi Hoang -sentence=Simple WiFiManager for Blynk with MultiWiFi Credentials, for Mega, SAM DUE, SAMD21, SAMD51, nRF52, STM32, Teensy, etc. boards running ESP8266/ESP32-AT shields. Configuration data saved in EEPROM, SAMD EEPROM-emulated FlashStorage, SAM-DUE DueFlashStorage, nRF52 LittleFS or STM32 emulated EEPROM. +sentence=Simple WiFiManager for Blynk with MultiWiFi Credentials, for Mega, SAM DUE, SAMD21, SAMD51, nRF52, STM32, Teensy, etc. boards running ESP8266/ESP32-AT shields. Configuration data saved in EEPROM, EEPROM-emulated FlashStorage_STM32 or FlashStorage_SAMD, SAM-DUE DueFlashStorage or nRF52 LittleFS. paragraph=Library for configuring/auto(re)connecting Mega, SAM DUE, SAMD21, SAMD51, nRF52, STM32, etc., running ESP8266/ESP32-AT shields, to MultiWiFi and Blynk at runtime. category=Communication url=https://github.com/khoih-prog/Blynk_Esp8266AT_WM architectures=* -depends=Blynk,ESP8266_AT_WebServer,DoubleResetDetector_Generic,ESP_AT_Lib +depends=Blynk,ESP8266_AT_WebServer,DoubleResetDetector_Generic,ESP_AT_Lib,FlashStorage_SAMD,FlashStorage_STM32 diff --git a/platformio/platformio.ini b/platformio/platformio.ini index 70e2bb3..92d0cc0 100644 --- a/platformio/platformio.ini +++ b/platformio/platformio.ini @@ -39,11 +39,15 @@ lib_deps = ESP8266_AT_WebServer@~1.1.2 ESP_AT_Lib@~1.0.0 DoubleResetDetector_Generic@~1.0.3 + FlashStorage_SAMD@~1.1.0 + FlashStorage_STM32@~1.0.0 ; PlatformIO 5.x ; blynkkk/Blynk@~0.6.1 ; khoih-prog/ESP8266_AT_WebServer@~1.1.2 ; khoih-prog/ESP_AT_Lib@~1.0.0 ; khoih-prog/DoubleResetDetector_Generic@~1.0.3 +; khoih-prog/FlashStorage_SAMD@~1.1.0 +; khoih-prog/FlashStorage_STM32@~1.0.0 build_flags = ; set your debug output (default=Serial) diff --git a/src/Blynk/BlynkDetectDevice.h b/src/Blynk/BlynkDetectDevice.h index 4be8298..88e19d9 100644 --- a/src/Blynk/BlynkDetectDevice.h +++ b/src/Blynk/BlynkDetectDevice.h @@ -23,7 +23,7 @@ @date Jun 2015 @brief - Version: 1.1.1 + Version: 1.2.0 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -38,6 +38,7 @@ 1.0.7 K Hoang 27/07/2020 Add support to all STM32F/L/H/G/WB/MP1 and Seeeduino SAMD21/SAMD51 boards. 1.1.0 K Hoang 15/01/2021 Restore support to Teensy to be used only with Teensy core v1.51. 1.1.1 K Hoang 24/01/2021 Add support to Teensy 3.x, to be used only with Teensy core v1.51. + 1.2.0 K Hoang 28/01/2021 Fix bug. Use more efficient FlashStorage_STM32 and FlashStorage_SAMD. *****************************************************************************************************************************/ #ifndef BlynkDetectDevice_h diff --git a/src/BlynkSimpleShieldEsp8266.h b/src/BlynkSimpleShieldEsp8266.h index d3ca796..275f4c2 100644 --- a/src/BlynkSimpleShieldEsp8266.h +++ b/src/BlynkSimpleShieldEsp8266.h @@ -17,7 +17,7 @@ @date Jun 2015 @brief - Version: 1.1.1 + Version: 1.2.0 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -32,6 +32,7 @@ 1.0.7 K Hoang 27/07/2020 Add support to all STM32F/L/H/G/WB/MP1 and Seeeduino SAMD21/SAMD51 boards. 1.1.0 K Hoang 15/01/2021 Restore support to Teensy to be used only with Teensy core v1.51. 1.1.1 K Hoang 24/01/2021 Add support to Teensy 3.x, to be used only with Teensy core v1.51. + 1.2.0 K Hoang 28/01/2021 Fix bug. Use more efficient FlashStorage_STM32 and FlashStorage_SAMD. *****************************************************************************************************************************/ #ifndef BlynkSimpleShieldEsp8266_h @@ -41,7 +42,7 @@ #error This code is not intended to run on the ESP8266 platform! Please check your Tools->Board setting. #endif -#define BLYNK_ESP8266AT_WM_VERSION "Blynk_Esp8266AT_WM v1.1.1" +#define BLYNK_ESP8266AT_WM_VERSION "Blynk_Esp8266AT_WM v1.2.0" #ifndef BLYNK_INFO_CONNECTION #define BLYNK_INFO_CONNECTION "ESP8266" diff --git a/src/BlynkSimpleShieldEsp8266_DUE.h b/src/BlynkSimpleShieldEsp8266_DUE.h index 3dabf7a..bd92313 100644 --- a/src/BlynkSimpleShieldEsp8266_DUE.h +++ b/src/BlynkSimpleShieldEsp8266_DUE.h @@ -17,7 +17,7 @@ @date Jun 2015 @brief - Version: 1.1.1 + Version: 1.2.0 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -32,6 +32,7 @@ 1.0.7 K Hoang 27/07/2020 Add support to all STM32F/L/H/G/WB/MP1 and Seeeduino SAMD21/SAMD51 boards. 1.1.0 K Hoang 15/01/2021 Restore support to Teensy to be used only with Teensy core v1.51. 1.1.1 K Hoang 24/01/2021 Add support to Teensy 3.x, to be used only with Teensy core v1.51. + 1.2.0 K Hoang 28/01/2021 Fix bug. Use more efficient FlashStorage_STM32 and FlashStorage_SAMD. *****************************************************************************************************************************/ #ifndef BlynkSimpleShieldEsp8266_DUE_h @@ -50,7 +51,7 @@ #error This code is intended to run on the SAM DUE platform! Please check your Tools->Board setting. #endif -#define BLYNK_ESP8266AT_WM_VERSION "Blynk_Esp8266AT_WM v1.1.1" +#define BLYNK_ESP8266AT_WM_VERSION "Blynk_Esp8266AT_WM v1.2.0" #ifndef BLYNK_INFO_CONNECTION #define BLYNK_INFO_CONNECTION "ESP8266" diff --git a/src/BlynkSimpleShieldEsp8266_DUE_WM.h b/src/BlynkSimpleShieldEsp8266_DUE_WM.h index 4931cea..1b85f84 100644 --- a/src/BlynkSimpleShieldEsp8266_DUE_WM.h +++ b/src/BlynkSimpleShieldEsp8266_DUE_WM.h @@ -17,7 +17,7 @@ @date Jun 2015 @brief - Version: 1.1.1 + Version: 1.2.0 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -32,6 +32,7 @@ 1.0.7 K Hoang 27/07/2020 Add support to all STM32F/L/H/G/WB/MP1 and Seeeduino SAMD21/SAMD51 boards. 1.1.0 K Hoang 15/01/2021 Restore support to Teensy to be used only with Teensy core v1.51. 1.1.1 K Hoang 24/01/2021 Add support to Teensy 3.x, to be used only with Teensy core v1.51. + 1.2.0 K Hoang 28/01/2021 Fix bug. Use more efficient FlashStorage_STM32 and FlashStorage_SAMD. *****************************************************************************************************************************/ #ifndef BlynkSimpleShieldEsp8266_DUE_WM_h @@ -50,7 +51,7 @@ #error This code is intended to run on the SAM DUE platform! Please check your Tools->Board setting. #endif -#define BLYNK_ESP8266AT_WM_VERSION "Blynk_Esp8266AT_WM v1.1.1" +#define BLYNK_ESP8266AT_WM_VERSION "Blynk_Esp8266AT_WM v1.2.0" #ifndef BLYNK_INFO_CONNECTION #define BLYNK_INFO_CONNECTION "ESP8266" @@ -1593,7 +1594,7 @@ class BlynkWifi // Reset configTimeout to stay here until finished. configTimeout = 0; - + result.replace("[[id]]", Blynk8266_WF_config.WiFi_Creds[0].wifi_ssid); result.replace("[[pw]]", Blynk8266_WF_config.WiFi_Creds[0].wifi_pw); result.replace("[[id1]]", Blynk8266_WF_config.WiFi_Creds[1].wifi_ssid); @@ -1601,23 +1602,14 @@ class BlynkWifi result.replace("[[sv]]", Blynk8266_WF_config.blynk_server); result.replace("[[tk]]", Blynk8266_WF_config.blynk_token); -#if USE_DYNAMIC_PARAMETERS - if (!menuItemUpdated) - { - // Don't need to free - menuItemUpdated = new bool[NUM_MENU_ITEMS]; - } - +#if USE_DYNAMIC_PARAMETERS for (uint16_t i = 0; i < NUM_MENU_ITEMS; i++) { String toChange = String("[[") + myMenuItems[i].id + "]]"; result.replace(toChange, myMenuItems[i].pdata); - // To flag item is not yet updated - menuItemUpdated[i] = false; - #if ( BLYNK_WM_DEBUG > 2) - BLYNK_LOG4(BLYNK_F("h1:myMenuItems["), i, BLYNK_F("]="), myMenuItems[i].pdata ) + BLYNK_LOG4(BLYNK_F("h1:myMenuItems["), i, BLYNK_F("]="), myMenuItems[i].pdata ); #endif } #endif @@ -1630,7 +1622,7 @@ class BlynkWifi if (HTML_page_size > MAX_HTML_SIZE) { - BLYNK_LOG1(BLYNK_F("h:HTML page larger than 2K. CP not work. Reduce dynamic params")); + BLYNK_LOG1(BLYNK_F("h:HTML page larger than 2K. Config Portal not work. Reduce dynamic params")); } server->send(200, "text/html", result); @@ -1643,6 +1635,30 @@ class BlynkWifi memset(&Blynk8266_WF_config, 0, sizeof(Blynk8266_WF_config)); strcpy(Blynk8266_WF_config.header, BLYNK_BOARD_TYPE); } + +#if USE_DYNAMIC_PARAMETERS + if (!menuItemUpdated) + { + // Don't need to free + menuItemUpdated = new bool[NUM_MENU_ITEMS]; + + if (menuItemUpdated) + { + for (uint16_t i = 0; i < NUM_MENU_ITEMS; i++) + { + // To flag item is not yet updated + menuItemUpdated[i] = false; + } + #if ( BLYNK_WM_DEBUG > 2) + BLYNK_LOG1(BLYNK_F("h: Init menuItemUpdated" )); + #endif + } + else + { + BLYNK_LOG1(BLYNK_F("h: Error can't alloc memory for menuItemUpdated" )); + } + } +#endif static bool id_Updated = false; static bool pw_Updated = false; @@ -1766,7 +1782,7 @@ class BlynkWifi if (number_items_Updated == NUM_CONFIGURABLE_ITEMS) #endif { - BLYNK_LOG1(BLYNK_F("h:UpdFlash")); + BLYNK_LOG1(BLYNK_F("h:UpdEEPROM")); saveConfigData(); diff --git a/src/BlynkSimpleShieldEsp8266_SAMD.h b/src/BlynkSimpleShieldEsp8266_SAMD.h index ba467b0..839c3fc 100644 --- a/src/BlynkSimpleShieldEsp8266_SAMD.h +++ b/src/BlynkSimpleShieldEsp8266_SAMD.h @@ -17,7 +17,7 @@ @date Jun 2015 @brief - Version: 1.1.1 + Version: 1.2.0 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -32,6 +32,7 @@ 1.0.7 K Hoang 27/07/2020 Add support to all STM32F/L/H/G/WB/MP1 and Seeeduino SAMD21/SAMD51 boards. 1.1.0 K Hoang 15/01/2021 Restore support to Teensy to be used only with Teensy core v1.51. 1.1.1 K Hoang 24/01/2021 Add support to Teensy 3.x, to be used only with Teensy core v1.51. + 1.2.0 K Hoang 28/01/2021 Fix bug. Use more efficient FlashStorage_STM32 and FlashStorage_SAMD. *****************************************************************************************************************************/ #ifndef BlynkSimpleShieldEsp8266_SAMD_h @@ -53,7 +54,7 @@ #error This code is intended to run on the SAMD platform! Please check your Tools->Board setting. #endif -#define BLYNK_ESP8266AT_WM_VERSION "Blynk_Esp8266AT_WM v1.1.1" +#define BLYNK_ESP8266AT_WM_VERSION "Blynk_Esp8266AT_WM v1.2.0" #ifndef BLYNK_INFO_CONNECTION #define BLYNK_INFO_CONNECTION "ESP8266" diff --git a/src/BlynkSimpleShieldEsp8266_SAMD_WM.h b/src/BlynkSimpleShieldEsp8266_SAMD_WM.h index 7b9c7d8..258e30b 100644 --- a/src/BlynkSimpleShieldEsp8266_SAMD_WM.h +++ b/src/BlynkSimpleShieldEsp8266_SAMD_WM.h @@ -17,7 +17,7 @@ @date Jun 2015 @brief - Version: 1.1.1 + Version: 1.2.0 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -32,6 +32,7 @@ 1.0.7 K Hoang 27/07/2020 Add support to all STM32F/L/H/G/WB/MP1 and Seeeduino SAMD21/SAMD51 boards. 1.1.0 K Hoang 15/01/2021 Restore support to Teensy to be used only with Teensy core v1.51. 1.1.1 K Hoang 24/01/2021 Add support to Teensy 3.x, to be used only with Teensy core v1.51. + 1.2.0 K Hoang 28/01/2021 Fix bug. Use more efficient FlashStorage_STM32 and FlashStorage_SAMD. *****************************************************************************************************************************/ #ifndef BlynkSimpleShieldEsp8266_SAMD_WM_h @@ -46,6 +47,7 @@ #undef BLYNK_ESP8266_AT_USE_SAMD #endif #define BLYNK_ESP8266_AT_USE_SAMD true + #warning To be used with FlashStorage_SAMD library v1.1.0+ #endif #if ( defined(ESP8266) || defined(ESP32) || defined(ARDUINO_AVR_MEGA2560) || defined(ARDUINO_AVR_MEGA) || \ @@ -53,7 +55,7 @@ #error This code is intended to run on the SAMD platform! Please check your Tools->Board setting. #endif -#define BLYNK_ESP8266AT_WM_VERSION "Blynk_Esp8266AT_WM v1.1.1" +#define BLYNK_ESP8266AT_WM_VERSION "Blynk_Esp8266AT_WM v1.2.0" #ifndef BLYNK_INFO_CONNECTION #define BLYNK_INFO_CONNECTION "ESP8266" @@ -80,7 +82,6 @@ #include // Include EEPROM-like API for FlashStorage -//#include //https://github.com/cmaglie/FlashStorage #include //https://github.com/khoih-prog/FlashStorage_SAMD #ifndef SIMPLE_SHIELD_ESP8266_DEBUG @@ -1586,25 +1587,15 @@ class BlynkWifi result.replace("[[pw1]]", Blynk8266_WF_config.WiFi_Creds[1].wifi_pw); result.replace("[[sv]]", Blynk8266_WF_config.blynk_server); result.replace("[[tk]]", Blynk8266_WF_config.blynk_token); - -#if USE_DYNAMIC_PARAMETERS - if (!menuItemUpdated) - { - // Don't need to free - menuItemUpdated = new bool[NUM_MENU_ITEMS]; - } - +#if USE_DYNAMIC_PARAMETERS for (uint16_t i = 0; i < NUM_MENU_ITEMS; i++) { String toChange = String("[[") + myMenuItems[i].id + "]]"; result.replace(toChange, myMenuItems[i].pdata); - // To flag item is not yet updated - menuItemUpdated[i] = false; - #if ( BLYNK_WM_DEBUG > 2) - BLYNK_LOG4(BLYNK_F("h1:myMenuItems["), i, BLYNK_F("]="), myMenuItems[i].pdata ) + BLYNK_LOG4(BLYNK_F("h1:myMenuItems["), i, BLYNK_F("]="), myMenuItems[i].pdata ); #endif } #endif @@ -1615,10 +1606,9 @@ class BlynkWifi BLYNK_LOG2(BLYNK_F("h:HTML page size:"), HTML_page_size); - if (HTML_page_size > 2048) + if (HTML_page_size > MAX_HTML_SIZE) { BLYNK_LOG1(BLYNK_F("h:HTML page larger than 2K. Config Portal not work. Reduce dynamic params")); - BLYNK_LOG1(result); } server->send(200, "text/html", result); @@ -1632,15 +1622,37 @@ class BlynkWifi strcpy(Blynk8266_WF_config.header, BLYNK_BOARD_TYPE); } - // TODO Find a way to update and count only once for each item !!! - +#if USE_DYNAMIC_PARAMETERS + if (!menuItemUpdated) + { + // Don't need to free + menuItemUpdated = new bool[NUM_MENU_ITEMS]; + + if (menuItemUpdated) + { + for (uint16_t i = 0; i < NUM_MENU_ITEMS; i++) + { + // To flag item is not yet updated + menuItemUpdated[i] = false; + } + #if ( BLYNK_WM_DEBUG > 2) + BLYNK_LOG1(BLYNK_F("h: Init menuItemUpdated" )); + #endif + } + else + { + BLYNK_LOG1(BLYNK_F("h: Error can't alloc memory for menuItemUpdated" )); + } + } +#endif + static bool id_Updated = false; static bool pw_Updated = false; static bool id1_Updated = false; static bool pw1_Updated = false; static bool sv_Updated = false; static bool tk_Updated = false; - + if (!id_Updated && (key == String("id"))) { #if ( BLYNK_WM_DEBUG > 2) @@ -1743,10 +1755,10 @@ class BlynkWifi } #endif - #if ( BLYNK_WM_DEBUG > 2) + //#if ( BLYNK_WM_DEBUG > 2) BLYNK_LOG2(F("h:items updated ="), number_items_Updated); BLYNK_LOG4(F("h:key ="), key, ", value =", value); - #endif + //#endif server->send(200, "text/html", "OK"); @@ -1756,10 +1768,10 @@ class BlynkWifi if (number_items_Updated == NUM_CONFIGURABLE_ITEMS) #endif { - BLYNK_LOG1(BLYNK_F("h:UpdFlash")); + BLYNK_LOG1(BLYNK_F("h:UpdEEPROM")); saveConfigData(); - + // Done with CP, Clear CP Flag here if forced if (isForcedConfigPortal) clearForcedCP(); diff --git a/src/BlynkSimpleShieldEsp8266_STM32.h b/src/BlynkSimpleShieldEsp8266_STM32.h index 6725882..8eafeca 100644 --- a/src/BlynkSimpleShieldEsp8266_STM32.h +++ b/src/BlynkSimpleShieldEsp8266_STM32.h @@ -17,7 +17,7 @@ @date Jun 2015 @brief - Version: 1.1.1 + Version: 1.2.0 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -32,6 +32,7 @@ 1.0.7 K Hoang 27/07/2020 Add support to all STM32F/L/H/G/WB/MP1 and Seeeduino SAMD21/SAMD51 boards. 1.1.0 K Hoang 15/01/2021 Restore support to Teensy to be used only with Teensy core v1.51. 1.1.1 K Hoang 24/01/2021 Add support to Teensy 3.x, to be used only with Teensy core v1.51. + 1.2.0 K Hoang 28/01/2021 Fix bug. Use more efficient FlashStorage_STM32 and FlashStorage_SAMD. *****************************************************************************************************************************/ #ifndef BlynkSimpleShieldEsp8266_STM32_h @@ -50,7 +51,7 @@ #error This code is intended to run on STM32 platform! Please check your Tools->Board setting. #endif -#define BLYNK_ESP8266AT_WM_VERSION "Blynk_Esp8266AT_WM v1.1.1" +#define BLYNK_ESP8266AT_WM_VERSION "Blynk_Esp8266AT_WM v1.2.0" #ifndef BLYNK_INFO_CONNECTION #define BLYNK_INFO_CONNECTION "ESP8266" diff --git a/src/BlynkSimpleShieldEsp8266_STM32_WM.h b/src/BlynkSimpleShieldEsp8266_STM32_WM.h index 8e09050..39382cc 100644 --- a/src/BlynkSimpleShieldEsp8266_STM32_WM.h +++ b/src/BlynkSimpleShieldEsp8266_STM32_WM.h @@ -17,7 +17,7 @@ @date Jun 2015 @brief - Version: 1.1.1 + Version: 1.2.0 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -32,6 +32,7 @@ 1.0.7 K Hoang 27/07/2020 Add support to all STM32F/L/H/G/WB/MP1 and Seeeduino SAMD21/SAMD51 boards. 1.1.0 K Hoang 15/01/2021 Restore support to Teensy to be used only with Teensy core v1.51. 1.1.1 K Hoang 24/01/2021 Add support to Teensy 3.x, to be used only with Teensy core v1.51. + 1.2.0 K Hoang 28/01/2021 Fix bug. Use more efficient FlashStorage_STM32 and FlashStorage_SAMD. *****************************************************************************************************************************/ #ifndef BlynkSimpleShieldEsp8266_STM32_WM_h @@ -50,7 +51,7 @@ #error This code is intended to run on STM32 platform! Please check your Tools->Board setting. #endif -#define BLYNK_ESP8266AT_WM_VERSION "Blynk_Esp8266AT_WM v1.1.1" +#define BLYNK_ESP8266AT_WM_VERSION "Blynk_Esp8266AT_WM v1.2.0" #ifndef BLYNK_INFO_CONNECTION #define BLYNK_INFO_CONNECTION "ESP8266" @@ -75,7 +76,6 @@ #endif #include -#include #include @@ -1046,16 +1046,28 @@ class BlynkWifi Blynk8266_WF_config.blynk_server[SERVER_MAX_LEN - 1] = 0; Blynk8266_WF_config.blynk_token [TOKEN_MAX_LEN - 1] = 0; } - - ////////////////////////////////////////////// + + +////////////////////////////////////////////// #if defined(DATA_EEPROM_BASE) - // For STM32 devices having integrated EEPROM. - #warning "STM32 devices have integrated EEPROM. Not using buffered API." - - ////////////////////////////////////////////// - + #include + #warning STM32 devices have integrated EEPROM. Not using buffered API. +#else + /** + Most STM32 devices don't have an integrated EEPROM. To emulate a EEPROM, the STM32 Arduino core emulated + the operation of an EEPROM with the help of the embedded flash. + Writing to a flash is very expensive operation, since a whole flash page needs to be written, even if you only + want to access the flash byte-wise. + The STM32 Arduino core provides a buffered access API to the emulated EEPROM. The library has allocated the + buffer even if you don't use the buffered API, so it's strongly suggested to use the buffered API anyhow. + */ + #include // https://github.com/khoih-prog/FlashStorage_STM32 + #warning STM32 devices have no integrated EEPROM. Using buffered API with FlashStorage_STM32 library +#endif // #if defined(DATA_EEPROM_BASE) +////////////////////////////////////////////// + void setForcedCP(bool isPersistent) { uint32_t readForcedConfigPortalFlag = isPersistent? FORCED_PERS_CONFIG_PORTAL_FLAG_DATA : FORCED_CONFIG_PORTAL_FLAG_DATA; @@ -1253,285 +1265,6 @@ class BlynkWifi ////////////////////////////////////////////// -#else // #if defined(DATA_EEPROM_BASE) - - /** - Most STM32 devices don't have an integrated EEPROM. To emulate a EEPROM, the STM32 Arduino core emulated - the operation of an EEPROM with the help of the embedded flash. - Writing to a flash is very expensive operation, since a whole flash page needs to be written, even if you only - want to access the flash byte-wise. - The STM32 Arduino core provides a buffered access API to the emulated EEPROM. The library has allocated the - buffer even if you don't use the buffered API, so it's strongly suggested to use the buffered API anyhow. - */ - - #warning "STM32 devices don't have integrated EEPROM. Using buffered API." - - ////////////////////////////////////////////// - - void setForcedCP(bool isPersistent) - { - uint32_t readForcedConfigPortalFlag = isPersistent? FORCED_PERS_CONFIG_PORTAL_FLAG_DATA : FORCED_CONFIG_PORTAL_FLAG_DATA; - -#if ( BLYNK_WM_DEBUG > 2) - BLYNK_LOG1(isPersistent ? BLYNK_F("setForcedCP Persistent") : BLYNK_F("setForcedCP non-Persistent")); -#endif - - // First, to copy the data from the flash to the buffer to protect previous data - eeprom_buffer_fill(); - - uint16_t offset = CONFIG_EEPROM_START + CONFIG_DATA_SIZE; - - uint8_t* _pointer = (uint8_t *) &readForcedConfigPortalFlag; - - for (uint16_t i = 0; i < sizeof(readForcedConfigPortalFlag); i++, _pointer++, offset++) - { - eeprom_buffered_write_byte(offset, *_pointer); - } - - // Save the data from the buffer to the flash - eeprom_buffer_flush(); - } - - ////////////////////////////////////////////// - - void clearForcedCP() - { - uint32_t readForcedConfigPortalFlag = 0; - - // First, to copy the data from the flash to the buffer to protect previous data - eeprom_buffer_fill(); - - uint16_t offset = CONFIG_EEPROM_START + CONFIG_DATA_SIZE; - - uint8_t* _pointer = (uint8_t *) &readForcedConfigPortalFlag; - - for (uint16_t i = 0; i < sizeof(readForcedConfigPortalFlag); i++, _pointer++, offset++) - { - eeprom_buffered_write_byte(offset, *_pointer); - } - - // Save the data from the buffer to the flash - eeprom_buffer_flush(); - } - - ////////////////////////////////////////////// - - bool isForcedCP() - { - uint32_t readForcedConfigPortalFlag; - - // Return true if forced CP (0xDEADBEEF read at offset EPROM_START + DRD_FLAG_DATA_SIZE + CONFIG_DATA_SIZE) - // => set flag noForcedConfigPortal = false - - // First, to copy the data from the flash to the buffer to protect previous data - eeprom_buffer_fill(); - - uint16_t offset = CONFIG_EEPROM_START + CONFIG_DATA_SIZE; - - uint8_t* _pointer = (uint8_t *) &readForcedConfigPortalFlag; - - for (uint16_t i = 0; i < sizeof(readForcedConfigPortalFlag); i++, _pointer++, offset++) - { - *_pointer = eeprom_buffered_read_byte(offset); - } - - // Return true if forced CP (0xDEADBEEF read at offset EPROM_START + DRD_FLAG_DATA_SIZE + CONFIG_DATA_SIZE) - // => set flag noForcedConfigPortal = false - if (readForcedConfigPortalFlag == FORCED_CONFIG_PORTAL_FLAG_DATA) - { - persForcedConfigPortal = false; - return true; - } - else if (readForcedConfigPortalFlag == FORCED_PERS_CONFIG_PORTAL_FLAG_DATA) - { - persForcedConfigPortal = true; - return true; - } - else - { - return false; - } - } - - ////////////////////////////////////////////// - -#if USE_DYNAMIC_PARAMETERS - - bool checkDynamicData() - { - int checkSum = 0; - int readCheckSum; - - // First, to copy the data from the flash to the buffer to protect previous data - eeprom_buffer_fill(); - - uint16_t offset = CONFIG_EEPROM_START + sizeof(Blynk8266_WF_config) + FORCED_CONFIG_PORTAL_FLAG_DATA_SIZE; - - // Find the longest pdata, then dynamically allocate buffer. Remember to free when done - // This is used to store tempo data to calculate checksum to see of data is valid - // We dont like to destroy myMenuItems[i].pdata with invalid data - - for (uint16_t i = 0; i < NUM_MENU_ITEMS; i++) - { - for (uint16_t j = 0; j < myMenuItems[i].maxlen; j++, offset++) - { - checkSum += eeprom_buffered_read_byte(offset); - } - } - - uint8_t* _pointer = (uint8_t *) &readCheckSum; - - for (uint16_t i = 0; i < sizeof(readCheckSum); i++, _pointer++, offset++) - { - *_pointer = eeprom_buffered_read_byte(offset); - } - - BLYNK_LOG4(BLYNK_F("ChkCrR:CrCCsum=0x"), String(checkSum, HEX), F(",CrRCsum=0x"), String(readCheckSum, HEX)); - - if ( checkSum != readCheckSum) - { - return false; - } - - return true; - } - - ////////////////////////////////////////////// - - bool EEPROM_getDynamicData() - { - int readCheckSum; - int checkSum = 0; - - // First, to copy the data from the flash to the buffer to protect previous data - eeprom_buffer_fill(); - - totalDataSize = sizeof(Blynk8266_WF_config) + sizeof(readCheckSum); - - // Using FORCED_CONFIG_PORTAL_FLAG_DATA - uint16_t offset = CONFIG_EEPROM_START + sizeof(Blynk8266_WF_config) + FORCED_CONFIG_PORTAL_FLAG_DATA_SIZE; - uint8_t* _pointer; - - for (uint16_t i = 0; i < NUM_MENU_ITEMS; i++) - { - _pointer = (uint8_t *) myMenuItems[i].pdata; - totalDataSize += myMenuItems[i].maxlen; - - // Actual size of pdata is [maxlen + 1] - memset(myMenuItems[i].pdata, 0, myMenuItems[i].maxlen + 1); - - for (uint16_t j = 0; j < myMenuItems[i].maxlen; j++, _pointer++, offset++) - { - *_pointer = eeprom_buffered_read_byte(offset); - checkSum += *_pointer; - } - } - - _pointer = (uint8_t *) &readCheckSum; - - for (uint16_t i = 0; i < sizeof(readCheckSum); i++, _pointer++, offset++) - { - *_pointer = eeprom_buffered_read_byte(offset); - } - - BLYNK_LOG4(BLYNK_F("CrCCSum="), String(checkSum, HEX), F(",CrRCSum="), String(readCheckSum, HEX)); - - if ( checkSum != readCheckSum) - { - return false; - } - - return true; - } - - ////////////////////////////////////////////// - - void EEPROM_putDynamicData() - { - int checkSum = 0; - - // First, to copy the data from the flash to the buffer to protect previous data - eeprom_buffer_fill(); - - // Using FORCED_CONFIG_PORTAL_FLAG_DATA - uint16_t offset = CONFIG_EEPROM_START + sizeof(Blynk8266_WF_config) + FORCED_CONFIG_PORTAL_FLAG_DATA_SIZE; - uint8_t* _pointer; - - for (uint16_t i = 0; i < NUM_MENU_ITEMS; i++) - { - _pointer = (uint8_t *) myMenuItems[i].pdata; - -#if ( BLYNK_WM_DEBUG > 2) - BLYNK_LOG4(BLYNK_F("pdata="), myMenuItems[i].pdata, F(",len="), myMenuItems[i].maxlen); -#endif - - for (uint16_t j = 0; j < myMenuItems[i].maxlen; j++,_pointer++,offset++) - { - eeprom_buffered_write_byte(offset, *_pointer); - - checkSum += *_pointer; - } - } - - _pointer = (uint8_t *) &checkSum; - - for (uint16_t i = 0; i < sizeof(checkSum); i++, _pointer++, offset++) - { - eeprom_buffered_write_byte(offset, *_pointer); - } - - BLYNK_LOG2(BLYNK_F("CrCCSum=0x"), String(checkSum, HEX)); - - // Save the data from the buffer to the flash - eeprom_buffer_flush(); - } -#endif // #if USE_DYNAMIC_PARAMETERS - - ////////////////////////////////////////////// - - bool EEPROM_get() - { - // Copy the data from the flash to the buffer - eeprom_buffer_fill(); - - uint16_t offset = CONFIG_EEPROM_START; - - uint8_t* _pointer = (uint8_t *) &Blynk8266_WF_config; - - for (uint16_t i = 0; i < sizeof(Blynk8266_WF_config); i++, _pointer++, offset++) - { - *_pointer = eeprom_buffered_read_byte(offset); - } - - NULLTerminateConfig(); - - return true; - } - - ////////////////////////////////////////////// - - void EEPROM_put() - { - // First, to copy the data from the flash to the buffer to protect previous data - eeprom_buffer_fill(); - - uint16_t offset = CONFIG_EEPROM_START; - - uint8_t* _pointer = (uint8_t *) &Blynk8266_WF_config; - - for (uint16_t i = 0; i < sizeof(Blynk8266_WF_config); i++, _pointer++, offset++) - { - eeprom_buffered_write_byte(offset, *_pointer); - } - - // Save the data from the buffer to the flash - eeprom_buffer_flush(); - } - -#endif // #if defined(DATA_EEPROM_BASE) - - ////////////////////////////////////////////// - void saveConfigData() { int calChecksum = calcChecksum(); @@ -1893,23 +1626,14 @@ class BlynkWifi result.replace("[[sv]]", Blynk8266_WF_config.blynk_server); result.replace("[[tk]]", Blynk8266_WF_config.blynk_token); -#if USE_DYNAMIC_PARAMETERS - if (!menuItemUpdated) - { - // Don't need to free - menuItemUpdated = new bool[NUM_MENU_ITEMS]; - } - +#if USE_DYNAMIC_PARAMETERS for (uint16_t i = 0; i < NUM_MENU_ITEMS; i++) { String toChange = String("[[") + myMenuItems[i].id + "]]"; result.replace(toChange, myMenuItems[i].pdata); - // To flag item is not yet updated - menuItemUpdated[i] = false; - #if ( BLYNK_WM_DEBUG > 2) - BLYNK_LOG4(BLYNK_F("h1:myMenuItems["), i, BLYNK_F("]="), myMenuItems[i].pdata ) + BLYNK_LOG4(BLYNK_F("h1:myMenuItems["), i, BLYNK_F("]="), myMenuItems[i].pdata ); #endif } #endif @@ -1935,6 +1659,30 @@ class BlynkWifi memset(&Blynk8266_WF_config, 0, sizeof(Blynk8266_WF_config)); strcpy(Blynk8266_WF_config.header, BLYNK_BOARD_TYPE); } + +#if USE_DYNAMIC_PARAMETERS + if (!menuItemUpdated) + { + // Don't need to free + menuItemUpdated = new bool[NUM_MENU_ITEMS]; + + if (menuItemUpdated) + { + for (uint16_t i = 0; i < NUM_MENU_ITEMS; i++) + { + // To flag item is not yet updated + menuItemUpdated[i] = false; + } + #if ( BLYNK_WM_DEBUG > 2) + BLYNK_LOG1(BLYNK_F("h: Init menuItemUpdated" )); + #endif + } + else + { + BLYNK_LOG1(BLYNK_F("h: Error can't alloc memory for menuItemUpdated" )); + } + } +#endif static bool id_Updated = false; static bool pw_Updated = false; diff --git a/src/BlynkSimpleShieldEsp8266_Teensy.h b/src/BlynkSimpleShieldEsp8266_Teensy.h index 969d504..7dcadfa 100644 --- a/src/BlynkSimpleShieldEsp8266_Teensy.h +++ b/src/BlynkSimpleShieldEsp8266_Teensy.h @@ -17,7 +17,7 @@ @date Jun 2015 @brief - Version: 1.1.1 + Version: 1.2.0 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -32,6 +32,7 @@ 1.0.7 K Hoang 27/07/2020 Add support to all STM32F/L/H/G/WB/MP1 and Seeeduino SAMD21/SAMD51 boards. 1.1.0 K Hoang 15/01/2021 Restore support to Teensy to be used only with Teensy core v1.51. 1.1.1 K Hoang 24/01/2021 Add support to Teensy 3.x, to be used only with Teensy core v1.51. + 1.2.0 K Hoang 28/01/2021 Fix bug. Use more efficient FlashStorage_STM32 and FlashStorage_SAMD. *****************************************************************************************************************************/ #ifndef BlynkSimpleShieldEsp8266_Teensy_h @@ -47,7 +48,7 @@ #error This code is intended to run on the Teensy platform! Please check your Tools->Board setting. #endif -#define BLYNK_ESP8266AT_WM_VERSION "Blynk_Esp8266AT_WM v1.1.1" +#define BLYNK_ESP8266AT_WM_VERSION "Blynk_Esp8266AT_WM v1.2.0" #ifndef BLYNK_INFO_CONNECTION #define BLYNK_INFO_CONNECTION "ESP8266" diff --git a/src/BlynkSimpleShieldEsp8266_Teensy_WM.h b/src/BlynkSimpleShieldEsp8266_Teensy_WM.h index 6ca3dd8..34c7b89 100644 --- a/src/BlynkSimpleShieldEsp8266_Teensy_WM.h +++ b/src/BlynkSimpleShieldEsp8266_Teensy_WM.h @@ -17,7 +17,7 @@ @date Jun 2015 @brief - Version: 1.1.1 + Version: 1.2.0 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -32,6 +32,7 @@ 1.0.7 K Hoang 27/07/2020 Add support to all STM32F/L/H/G/WB/MP1 and Seeeduino SAMD21/SAMD51 boards. 1.1.0 K Hoang 15/01/2021 Restore support to Teensy to be used only with Teensy core v1.51. 1.1.1 K Hoang 24/01/2021 Add support to Teensy 3.x, to be used only with Teensy core v1.51. + 1.2.0 K Hoang 28/01/2021 Fix bug. Use more efficient FlashStorage_STM32 and FlashStorage_SAMD. *****************************************************************************************************************************/ #ifndef BlynkSimpleShieldEsp8266_Teensy_WM_h @@ -51,7 +52,7 @@ #error This code is intended to run only on the Teensy code v1.51 ! Please check your Teensy core. #endif -#define BLYNK_ESP8266AT_WM_VERSION "Blynk_Esp8266AT_WM v1.1.1" +#define BLYNK_ESP8266AT_WM_VERSION "Blynk_Esp8266AT_WM v1.2.0" #ifndef BLYNK_INFO_CONNECTION #define BLYNK_INFO_CONNECTION "ESP8266" @@ -1622,24 +1623,15 @@ class BlynkWifi result.replace("[[pw1]]", Blynk8266_WF_config.WiFi_Creds[1].wifi_pw); result.replace("[[sv]]", Blynk8266_WF_config.blynk_server); result.replace("[[tk]]", Blynk8266_WF_config.blynk_token); - -#if USE_DYNAMIC_PARAMETERS - if (!menuItemUpdated) - { - // Don't need to free - menuItemUpdated = new bool[NUM_MENU_ITEMS]; - } +#if USE_DYNAMIC_PARAMETERS for (uint16_t i = 0; i < NUM_MENU_ITEMS; i++) { String toChange = String("[[") + myMenuItems[i].id + "]]"; result.replace(toChange, myMenuItems[i].pdata); - // To flag item is not yet updated - menuItemUpdated[i] = false; - #if ( BLYNK_WM_DEBUG > 2) - BLYNK_LOG4(BLYNK_F("h1:myMenuItems["), i, BLYNK_F("]="), myMenuItems[i].pdata ) + BLYNK_LOG4(BLYNK_F("h1:myMenuItems["), i, BLYNK_F("]="), myMenuItems[i].pdata ); #endif } #endif @@ -1665,7 +1657,31 @@ class BlynkWifi memset(&Blynk8266_WF_config, 0, sizeof(Blynk8266_WF_config)); strcpy(Blynk8266_WF_config.header, BLYNK_BOARD_TYPE); } - + +#if USE_DYNAMIC_PARAMETERS + if (!menuItemUpdated) + { + // Don't need to free + menuItemUpdated = new bool[NUM_MENU_ITEMS]; + + if (menuItemUpdated) + { + for (uint16_t i = 0; i < NUM_MENU_ITEMS; i++) + { + // To flag item is not yet updated + menuItemUpdated[i] = false; + } + #if ( BLYNK_WM_DEBUG > 2) + BLYNK_LOG1(BLYNK_F("h: Init menuItemUpdated" )); + #endif + } + else + { + BLYNK_LOG1(BLYNK_F("h: Error can't alloc memory for menuItemUpdated" )); + } + } +#endif + static bool id_Updated = false; static bool pw_Updated = false; static bool id1_Updated = false; @@ -1781,7 +1797,7 @@ class BlynkWifi //#endif server->send(200, "text/html", "OK"); - + #if USE_DYNAMIC_PARAMETERS if (number_items_Updated == NUM_CONFIGURABLE_ITEMS + NUM_MENU_ITEMS) #else diff --git a/src/BlynkSimpleShieldEsp8266_Teensy_WM_Single.h b/src/BlynkSimpleShieldEsp8266_Teensy_WM_Single.h index b351b0f..2e94002 100644 --- a/src/BlynkSimpleShieldEsp8266_Teensy_WM_Single.h +++ b/src/BlynkSimpleShieldEsp8266_Teensy_WM_Single.h @@ -17,7 +17,7 @@ @date Jun 2015 @brief - Version: 1.1.1 + Version: 1.2.0 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -32,6 +32,7 @@ 1.0.7 K Hoang 27/07/2020 Add support to all STM32F/L/H/G/WB/MP1 and Seeeduino SAMD21/SAMD51 boards. 1.1.0 K Hoang 15/01/2021 Restore support to Teensy to be used only with Teensy core v1.51. 1.1.1 K Hoang 24/01/2021 Add support to Teensy 3.x, to be used only with Teensy core v1.51. + 1.2.0 K Hoang 28/01/2021 Fix bug. Use more efficient FlashStorage_STM32 and FlashStorage_SAMD. *****************************************************************************************************************************/ #ifndef BlynkSimpleShieldEsp8266_Teensy_WM_Single_h @@ -51,7 +52,7 @@ #error This code is intended to run only on the Teensy code v1.51 ! Please check your Teensy core. #endif -#define BLYNK_ESP8266AT_WM_VERSION "Blynk_Esp8266AT_WM v1.1.1" +#define BLYNK_ESP8266AT_WM_VERSION "Blynk_Esp8266AT_WM v1.2.0" #ifndef BLYNK_INFO_CONNECTION #define BLYNK_INFO_CONNECTION "ESP8266" diff --git a/src/BlynkSimpleShieldEsp8266_WM.h b/src/BlynkSimpleShieldEsp8266_WM.h index c0b21c8..2157b3f 100644 --- a/src/BlynkSimpleShieldEsp8266_WM.h +++ b/src/BlynkSimpleShieldEsp8266_WM.h @@ -17,7 +17,7 @@ @date Jun 2015 @brief - Version: 1.1.1 + Version: 1.2.0 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -32,6 +32,7 @@ 1.0.7 K Hoang 27/07/2020 Add support to all STM32F/L/H/G/WB/MP1 and Seeeduino SAMD21/SAMD51 boards. 1.1.0 K Hoang 15/01/2021 Restore support to Teensy to be used only with Teensy core v1.51. 1.1.1 K Hoang 24/01/2021 Add support to Teensy 3.x, to be used only with Teensy core v1.51. + 1.2.0 K Hoang 28/01/2021 Fix bug. Use more efficient FlashStorage_STM32 and FlashStorage_SAMD. *****************************************************************************************************************************/ #ifndef BlynkSimpleShieldEsp8266_WM_h @@ -41,7 +42,7 @@ #error This code is intended to run on the Mega2560 platform! Please check your Tools->Board setting. #endif -#define BLYNK_ESP8266AT_WM_VERSION "Blynk_Esp8266AT_WM v1.1.1" +#define BLYNK_ESP8266AT_WM_VERSION "Blynk_Esp8266AT_WM v1.2.0" #ifndef BLYNK_INFO_CONNECTION #define BLYNK_INFO_CONNECTION "ESP8266" diff --git a/src/BlynkSimpleShieldEsp8266_nRF52.h b/src/BlynkSimpleShieldEsp8266_nRF52.h index 72dd1b0..17513f7 100644 --- a/src/BlynkSimpleShieldEsp8266_nRF52.h +++ b/src/BlynkSimpleShieldEsp8266_nRF52.h @@ -17,7 +17,7 @@ @date Jun 2015 @brief - Version: 1.1.1 + Version: 1.2.0 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -32,6 +32,7 @@ 1.0.7 K Hoang 27/07/2020 Add support to all STM32F/L/H/G/WB/MP1 and Seeeduino SAMD21/SAMD51 boards. 1.1.0 K Hoang 15/01/2021 Restore support to Teensy to be used only with Teensy core v1.51. 1.1.1 K Hoang 24/01/2021 Add support to Teensy 3.x, to be used only with Teensy core v1.51. + 1.2.0 K Hoang 28/01/2021 Fix bug. Use more efficient FlashStorage_STM32 and FlashStorage_SAMD. *****************************************************************************************************************************/ #ifndef BlynkSimpleShieldEsp8266_nRF52_h @@ -51,7 +52,7 @@ #error This code is intended to run on the nRF52 platform! Please check your Tools->Board setting. #endif -#define BLYNK_ESP8266AT_WM_VERSION "Blynk_Esp8266AT_WM v1.1.1" +#define BLYNK_ESP8266AT_WM_VERSION "Blynk_Esp8266AT_WM v1.2.0" #ifndef BLYNK_INFO_CONNECTION #define BLYNK_INFO_CONNECTION "ESP8266" diff --git a/src/BlynkSimpleShieldEsp8266_nRF52_WM.h b/src/BlynkSimpleShieldEsp8266_nRF52_WM.h index b6f6410..39c961a 100644 --- a/src/BlynkSimpleShieldEsp8266_nRF52_WM.h +++ b/src/BlynkSimpleShieldEsp8266_nRF52_WM.h @@ -17,7 +17,7 @@ @date Jun 2015 @brief - Version: 1.1.1 + Version: 1.2.0 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -32,6 +32,7 @@ 1.0.7 K Hoang 27/07/2020 Add support to all STM32F/L/H/G/WB/MP1 and Seeeduino SAMD21/SAMD51 boards. 1.1.0 K Hoang 15/01/2021 Restore support to Teensy to be used only with Teensy core v1.51. 1.1.1 K Hoang 24/01/2021 Add support to Teensy 3.x, to be used only with Teensy core v1.51. + 1.2.0 K Hoang 28/01/2021 Fix bug. Use more efficient FlashStorage_STM32 and FlashStorage_SAMD. *****************************************************************************************************************************/ #ifndef BlynkSimpleShieldEsp8266_nRF52_WM_h @@ -51,7 +52,7 @@ #error This code is intended to run on the nRF52 platform! Please check your Tools->Board setting. #endif -#define BLYNK_ESP8266AT_WM_VERSION "Blynk_Esp8266AT_WM v1.1.1" +#define BLYNK_ESP8266AT_WM_VERSION "Blynk_Esp8266AT_WM v1.2.0" #ifndef BLYNK_INFO_CONNECTION #define BLYNK_INFO_CONNECTION "ESP8266" @@ -1804,23 +1805,14 @@ class BlynkWifi result.replace("[[sv]]", Blynk8266_WF_config.blynk_server); result.replace("[[tk]]", Blynk8266_WF_config.blynk_token); -#if USE_DYNAMIC_PARAMETERS - if (!menuItemUpdated) - { - // Don't need to free - menuItemUpdated = new bool[NUM_MENU_ITEMS]; - } - +#if USE_DYNAMIC_PARAMETERS for (uint16_t i = 0; i < NUM_MENU_ITEMS; i++) { String toChange = String("[[") + myMenuItems[i].id + "]]"; result.replace(toChange, myMenuItems[i].pdata); - // To flag item is not yet updated - menuItemUpdated[i] = false; - #if ( BLYNK_WM_DEBUG > 2) - BLYNK_LOG4(BLYNK_F("h1:myMenuItems["), i, BLYNK_F("]="), myMenuItems[i].pdata ) + BLYNK_LOG4(BLYNK_F("h1:myMenuItems["), i, BLYNK_F("]="), myMenuItems[i].pdata ); #endif } #endif @@ -1846,6 +1838,30 @@ class BlynkWifi memset(&Blynk8266_WF_config, 0, sizeof(Blynk8266_WF_config)); strcpy(Blynk8266_WF_config.header, BLYNK_BOARD_TYPE); } + +#if USE_DYNAMIC_PARAMETERS + if (!menuItemUpdated) + { + // Don't need to free + menuItemUpdated = new bool[NUM_MENU_ITEMS]; + + if (menuItemUpdated) + { + for (uint16_t i = 0; i < NUM_MENU_ITEMS; i++) + { + // To flag item is not yet updated + menuItemUpdated[i] = false; + } + #if ( BLYNK_WM_DEBUG > 2) + BLYNK_LOG1(BLYNK_F("h: Init menuItemUpdated" )); + #endif + } + else + { + BLYNK_LOG1(BLYNK_F("h: Error can't alloc memory for menuItemUpdated" )); + } + } +#endif static bool id_Updated = false; static bool pw_Updated = false; @@ -1969,7 +1985,7 @@ class BlynkWifi if (number_items_Updated == NUM_CONFIGURABLE_ITEMS) #endif { - BLYNK_LOG1(BLYNK_F("h:UpdLittleFS")); + BLYNK_LOG1(BLYNK_F("h:UpdEEPROM")); saveConfigData();