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

Commit 9b17847

Browse files
authored
v1.1.0 to use FlashStorage_STM32, etc
### Major Release v1.1.0 1. Use new efficient [**FlashStorage_STM32** library](https://github.com/khoih-prog/FlashStorage_STM32). 2. Add support to new **STM32 core v2.0.0** and STM32L5 3. Permit auto-connect without waiting for Config Portal if stored data is valid and WiFi test connection is OK. 4. Update examples with new features
1 parent 013d7e0 commit 9b17847

20 files changed

+1156
-544
lines changed

CONTRIBUTING.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
## Contributing to ESP_WiFiManager
1+
## Contributing to ESP_AT_WiFiManager
22

33
### Reporting Bugs
44

5-
Please report bugs in ESP_WiFiManager if you find them.
5+
Please report bugs in ESP_AT_WiFiManager if you find them.
66

77
However, before reporting a bug please check through the following:
88

9-
* [Existing Open Issues](https://github.com/khoih-prog/ESP_WiFiManager/issues) - someone might have already encountered this.
9+
* [Existing Open Issues](https://github.com/khoih-prog/ESP_AT_WiFiManager/issues) - someone might have already encountered this.
1010

11-
If you don't find anything, please [open a new issue](https://github.com/khoih-prog/ESP_WiFiManager/issues/new).
11+
If you don't find anything, please [open a new issue](https://github.com/khoih-prog/ESP_AT_WiFiManager/issues/new).
1212

1313
### How to submit a bug report
1414

1515
Please ensure to specify the following:
1616

17-
* Arduino IDE version (e.g. 1.8.11) or Platform.io version
18-
* `ESP8266` or `ESP32` Core Version (e.g. ESP8266 core v2.6.3 or ESP32 v1.0.4)
17+
* Arduino IDE version (e.g. 1.8.13) or Platform.io version
18+
* Board Core Version (e.g. Arduino SAMDUE core v1.6.12, STM32 core v2.0.0, etc.)
1919
* Contextual information (e.g. what you were trying to achieve)
2020
* Simplest possible steps to reproduce
2121
* Anything that might be relevant in your opinion, such as:
@@ -26,10 +26,10 @@ Please ensure to specify the following:
2626
### Example
2727

2828
```
29-
Arduino IDE version: 1.8.11
30-
ESP8266 Core Version 2.6.3
31-
OS: Ubuntu 16.04 LTS
32-
Linux Inspiron 4.4.0-170-generic #199-Ubuntu SMP Thu Nov 14 01:45:04 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
29+
Arduino IDE version: 1.8.13
30+
Arduino STM32 Core v2.0.0
31+
OS: Ubuntu 20.04 LTS
32+
Linux xy-Inspiron-3593 5.4.0-72-generic #80-Ubuntu SMP Mon Apr 12 17:35:00 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
3333
3434
Context:
3535
I encountered an endless loop while trying to connect to Local WiFi.
@@ -44,7 +44,7 @@ Steps to reproduce:
4444

4545
Feel free to post feature requests. It's helpful if you can explain exactly why the feature would be useful.
4646

47-
There are usually some outstanding feature requests in the [existing issues list](https://github.com/khoih-prog/ESP_WiFiManager/issues?q=is%3Aopen+is%3Aissue+label%3Aenhancement), feel free to add comments to them.
47+
There are usually some outstanding feature requests in the [existing issues list](https://github.com/khoih-prog/ESP_AT_WiFiManager/issues?q=is%3Aopen+is%3Aissue+label%3Aenhancement), feel free to add comments to them.
4848

4949
### Sending Pull Requests
5050

README.md

Lines changed: 443 additions & 132 deletions
Large diffs are not rendered by default.

examples/AutoConnect/AutoConnect.ino

Lines changed: 38 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,24 @@
11
/****************************************************************************************************************************
2-
AutoConnect.ino
3-
WiFi/Credentials Manager for SAM DUE, SAMD, nRF52, STM32F/L/H/G/WB/MP1, etc. boards running `ESP8266/ESP32-AT-command` shields
4-
5-
ESP_AT_WiFiManager is a library for the Teensy, SAM DUE, SAMD, nRF52, STM32F/L/H/G/WB/MP1, etc. boards running `ESP8266/ESP32-AT-command` shields
6-
(https://github.com/esp8266/Arduino) to enable easy configuration and reconfiguration of WiFi, etc. credentials using a Captive Portal
7-
8-
Based on and modified from Tzapu https://github.com/tzapu/WiFiManager
9-
and from Ken Taylor https://github.com/kentaylor
10-
11-
Built by Khoi Hoang https://github.com/khoih-prog/ESP_AT_WiFiManager
12-
Licensed under MIT license
13-
Version: 1.0.3
14-
15-
Version Modified By Date Comments
16-
------- ----------- ---------- -----------
17-
1.0.0 K Hoang 08/03/2020 Initial coding
18-
1.0.1 K Hoang 22/06/2020 Add support to nRF52 boards, such as AdaFruit Feather nRF52832, NINA_B302_ublox, etc.
19-
1.0.2 K Hoang 02/07/2020 Add support to ESP32-AT-command shields.
20-
1.0.3 K Hoang 28/07/2020 Add support to STM32F/L/H/G/WB/MP1 and Seeeduino SAMD21/SAMD51 boards. Add Packages' Patches.
2+
AutoConnect.ino
3+
WiFi/Credentials Manager for SAM DUE, SAMD, nRF52, STM32F/L/H/G/WB/MP1, etc. boards running `ESP8266/ESP32-AT-command` shields
4+
5+
ESP_AT_WiFiManager is a library for the Teensy, SAM DUE, SAMD, nRF52, STM32F/L/H/G/WB/MP1, etc. boards running `ESP8266/ESP32-AT-command` shields
6+
(https://github.com/esp8266/Arduino) to enable easy configuration and reconfiguration of WiFi, etc. credentials using a Captive Portal
7+
8+
Based on and modified from Tzapu https://github.com/tzapu/WiFiManager
9+
and from Ken Taylor https://github.com/kentaylor
10+
11+
Built by Khoi Hoang https://github.com/khoih-prog/ESP_AT_WiFiManager
12+
Licensed under MIT license
13+
Version: 1.1.0
14+
15+
Version Modified By Date Comments
16+
------- ----------- ---------- -----------
17+
1.0.0 K Hoang 08/03/2020 Initial coding
18+
1.0.1 K Hoang 22/06/2020 Add support to nRF52 boards, such as AdaFruit Feather nRF52832, NINA_B302_ublox, etc.
19+
1.0.2 K Hoang 02/07/2020 Add support to ESP32-AT-command shields.
20+
1.0.3 K Hoang 28/07/2020 Add support to STM32F/L/H/G/WB/MP1 and Seeeduino SAMD21/SAMD51 boards. Add Packages' Patches.
21+
1.1.0 K Hoang 27/04/2021 Use new FlashStorage_STM32 library. Add support to new STM32 core v2.0.0 and STM32L5
2122
*****************************************************************************************************************************/
2223
// Credits of [Miguel Alexandre Wisintainer](https://github.com/tcpipchip) for this simple yet effective method
2324
// For some STM32, there is only definition of Serial in variant.h, and is used for Serial/USB Debugging
@@ -42,7 +43,7 @@
4243

4344
#include "defines.h"
4445

45-
void heartBeatPrint(void)
46+
void heartBeatPrint()
4647
{
4748
static int num = 1;
4849

@@ -75,7 +76,7 @@ void check_status()
7576
}
7677
}
7778

78-
void enterConfigPortal(void)
79+
void enterConfigPortal()
7980
{
8081
//Local intialization. Once its business is done, there is no need to keep it around
8182
ESP_AT_WiFiManager ESP_AT_wiFiManager;
@@ -99,13 +100,20 @@ void enterConfigPortal(void)
99100
Router_SSID = ESP_AT_wiFiManager.WiFi_SSID();
100101
Router_Pass = ESP_AT_wiFiManager.WiFi_Pass();
101102

102-
if (Router_SSID != "")
103-
{
103+
if ( (Router_SSID != "") && ESP_AT_wiFiManager.isWiFiConfigValid() )
104+
{
105+
if (ESP_AT_wiFiManager.connectWifi(Router_SSID, Router_Pass) == WL_CONNECTED)
106+
{
107+
Serial.println(F("Got stored Credentials. Try to connect first"));
108+
109+
return;
110+
}
111+
104112
ESP_AT_wiFiManager.setConfigPortalTimeout(60); //If no access point name has been previously entered disable timeout.
105-
Serial.println(F("Got stored Credentials. Timeout 60s"));
113+
Serial.println(F("Got stored Credentials but can't connect. Timeout 60s"));
106114
}
107115
else
108-
Serial.println(F("No stored Credentials. No timeout"));
116+
Serial.println(F("No stored or not valid Credentials. No timeout"));
109117

110118
// SSID to uppercase
111119
ssid.toUpperCase();
@@ -147,7 +155,9 @@ void setup()
147155
#else
148156
Serial.println("\nStart AutoConnect with ESP8266-AT WiFi module on " + String(BOARD_NAME));
149157
#endif
150-
158+
159+
Serial.println(ESP_AT_WIFIMANAGER_VERSION);
160+
151161
// initialize serial for ESP module
152162
EspSerial.begin(115200);
153163

@@ -164,8 +174,8 @@ void setup()
164174

165175
enterConfigPortal();
166176

167-
//if you get here you have connected to the WiFi
168-
Serial.println("WiFi connected");
177+
//if you get here you have exied from Config Portal
178+
Serial.println("Exit Config Portal");
169179
}
170180

171181
void loop()

examples/AutoConnect/defines.h

Lines changed: 17 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,15 @@
11
/****************************************************************************************************************************
2-
defines.h
3-
WiFi/Credentials Manager for SAM DUE, SAMD, nRF52, STM32F/L/H/G/WB/MP1, etc. boards running `ESP8266/ESP32-AT-command` shields
4-
5-
ESP_AT_WiFiManager is a library for the Teensy, SAM DUE, SAMD, nRF52, STM32F/L/H/G/WB/MP1, etc. boards running `ESP8266/ESP32-AT-command` shields
6-
(https://github.com/esp8266/Arduino) to enable easy configuration and reconfiguration of WiFi, etc. credentials using a Captive Portal
7-
8-
Based on and modified from Tzapu https://github.com/tzapu/WiFiManager
9-
and from Ken Taylor https://github.com/kentaylor
10-
11-
Built by Khoi Hoang https://github.com/khoih-prog/ESP_AT_WiFiManager
12-
Licensed under MIT license
13-
Version: 1.0.3
14-
15-
Version Modified By Date Comments
16-
------- ----------- ---------- -----------
17-
1.0.0 K Hoang 08/03/2020 Initial coding
18-
1.0.1 K Hoang 22/06/2020 Add support to nRF52 boards, such as AdaFruit Feather nRF52832, NINA_B302_ublox, etc.
19-
1.0.2 K Hoang 02/07/2020 Add support to ESP32-AT-command shields.
20-
1.0.3 K Hoang 28/07/2020 Add support to STM32F/L/H/G/WB/MP1 and Seeeduino SAMD21/SAMD51 boards. Add Packages' Patches.
2+
defines.h
3+
WiFi/Credentials Manager for SAM DUE, SAMD, nRF52, STM32F/L/H/G/WB/MP1, etc. boards running `ESP8266/ESP32-AT-command` shields
4+
5+
ESP_AT_WiFiManager is a library for the Teensy, SAM DUE, SAMD, nRF52, STM32F/L/H/G/WB/MP1, etc. boards running `ESP8266/ESP32-AT-command` shields
6+
(https://github.com/esp8266/Arduino) to enable easy configuration and reconfiguration of WiFi, etc. credentials using a Captive Portal
7+
8+
Based on and modified from Tzapu https://github.com/tzapu/WiFiManager
9+
and from Ken Taylor https://github.com/kentaylor
10+
11+
Built by Khoi Hoang https://github.com/khoih-prog/ESP_AT_WiFiManager
12+
Licensed under MIT license
2113
*****************************************************************************************************************************/
2214

2315
#ifndef defines_h
@@ -59,9 +51,9 @@
5951
#define ESP8266_AT_USE_SAM_DUE true
6052
#endif
6153

62-
#if ( defined(STM32F0) || defined(STM32F1) || defined(STM32F2) || defined(STM32F3) ||defined(STM32F4) || defined(STM32F7) || \
63-
defined(STM32L0) || defined(STM32L1) || defined(STM32L4) || defined(STM32H7) ||defined(STM32G0) || defined(STM32G4) || \
64-
defined(STM32WB) || defined(STM32MP1) )
54+
#if ( defined(STM32F0) || defined(STM32F1) || defined(STM32F2) || defined(STM32F3) ||defined(STM32F4) || defined(STM32F7) || \
55+
defined(STM32L0) || defined(STM32L1) || defined(STM32L4) || defined(STM32H7) ||defined(STM32G0) || defined(STM32G4) || \
56+
defined(STM32WB) || defined(STM32MP1) || defined(STM32L5) )
6557
#if defined(ESP8266_AT_USE_STM32)
6658
#undef ESP8266_AT_USE_STM32
6759
#endif
@@ -288,6 +280,9 @@
288280
#elif defined(STM32L4)
289281
#warning STM32L4 board selected
290282
#define BOARD_TYPE "STM32L4"
283+
#elif defined(STM32L5)
284+
#warning STM32L5 board selected
285+
#define BOARD_TYPE "STM32L5"
291286
#elif defined(STM32H7)
292287
#warning STM32H7 board selected
293288
#define BOARD_TYPE "STM32H7"

examples/AutoConnectWithFeedback/AutoConnectWithFeedback.ino

Lines changed: 37 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,24 @@
11
/****************************************************************************************************************************
2-
AutoConnectWithFeedBack.ino
3-
WiFi/Credentials Manager for SAM DUE, SAMD, nRF52, STM32F/L/H/G/WB/MP1, etc. boards running `ESP8266/ESP32-AT-command` shields
4-
5-
ESP_AT_WiFiManager is a library for the Teensy, SAM DUE, SAMD, nRF52, STM32F/L/H/G/WB/MP1, etc. boards running `ESP8266/ESP32-AT-command` shields
6-
(https://github.com/esp8266/Arduino) to enable easy configuration and reconfiguration of WiFi, etc. credentials using a Captive Portal
7-
8-
Based on and modified from Tzapu https://github.com/tzapu/WiFiManager
9-
and from Ken Taylor https://github.com/kentaylor
10-
11-
Built by Khoi Hoang https://github.com/khoih-prog/ESP_AT_WiFiManager
12-
Licensed under MIT license
13-
Version: 1.0.3
14-
15-
Version Modified By Date Comments
16-
------- ----------- ---------- -----------
17-
1.0.0 K Hoang 08/03/2020 Initial coding
18-
1.0.1 K Hoang 22/06/2020 Add support to nRF52 boards, such as AdaFruit Feather nRF52832, NINA_B302_ublox, etc.
19-
1.0.2 K Hoang 02/07/2020 Add support to ESP32-AT-command shields.
20-
1.0.3 K Hoang 28/07/2020 Add support to STM32F/L/H/G/WB/MP1 and Seeeduino SAMD21/SAMD51 boards. Add Packages' Patches.
2+
AutoConnectWithFeedBack.ino
3+
WiFi/Credentials Manager for SAM DUE, SAMD, nRF52, STM32F/L/H/G/WB/MP1, etc. boards running `ESP8266/ESP32-AT-command` shields
4+
5+
ESP_AT_WiFiManager is a library for the Teensy, SAM DUE, SAMD, nRF52, STM32F/L/H/G/WB/MP1, etc. boards running `ESP8266/ESP32-AT-command` shields
6+
(https://github.com/esp8266/Arduino) to enable easy configuration and reconfiguration of WiFi, etc. credentials using a Captive Portal
7+
8+
Based on and modified from Tzapu https://github.com/tzapu/WiFiManager
9+
and from Ken Taylor https://github.com/kentaylor
10+
11+
Built by Khoi Hoang https://github.com/khoih-prog/ESP_AT_WiFiManager
12+
Licensed under MIT license
13+
Version: 1.1.0
14+
15+
Version Modified By Date Comments
16+
------- ----------- ---------- -----------
17+
1.0.0 K Hoang 08/03/2020 Initial coding
18+
1.0.1 K Hoang 22/06/2020 Add support to nRF52 boards, such as AdaFruit Feather nRF52832, NINA_B302_ublox, etc.
19+
1.0.2 K Hoang 02/07/2020 Add support to ESP32-AT-command shields.
20+
1.0.3 K Hoang 28/07/2020 Add support to STM32F/L/H/G/WB/MP1 and Seeeduino SAMD21/SAMD51 boards. Add Packages' Patches.
21+
1.1.0 K Hoang 27/04/2021 Use new FlashStorage_STM32 library. Add support to new STM32 core v2.0.0 and STM32L5
2122
*****************************************************************************************************************************/
2223
// Credits of [Miguel Alexandre Wisintainer](https://github.com/tcpipchip) for this simple yet effective method
2324
// For some STM32, there is only definition of Serial in variant.h, and is used for Serial/USB Debugging
@@ -42,7 +43,7 @@
4243

4344
#include "defines.h"
4445

45-
void heartBeatPrint(void)
46+
void heartBeatPrint()
4647
{
4748
static int num = 1;
4849

@@ -81,7 +82,7 @@ void configModeCallback (ESP_AT_WiFiManager *myESP_WiFiManager)
8182
Serial.println("AP_SSID : " + myESP_WiFiManager->getConfigPortalSSID() + " and AP_PASS = " + myESP_WiFiManager->getConfigPortalPW());
8283
}
8384

84-
void enterConfigPortal(void)
85+
void enterConfigPortal()
8586
{
8687
//Local intialization. Once its business is done, there is no need to keep it around
8788
ESP_AT_WiFiManager ESP_AT_wiFiManager;
@@ -107,13 +108,20 @@ void enterConfigPortal(void)
107108
Router_SSID = ESP_AT_wiFiManager.WiFi_SSID();
108109
Router_Pass = ESP_AT_wiFiManager.WiFi_Pass();
109110

110-
if (Router_SSID != "")
111-
{
111+
if ( (Router_SSID != "") && ESP_AT_wiFiManager.isWiFiConfigValid() )
112+
{
113+
if (ESP_AT_wiFiManager.connectWifi(Router_SSID, Router_Pass) == WL_CONNECTED)
114+
{
115+
Serial.println(F("Got stored Credentials. Try to connect first"));
116+
117+
return;
118+
}
119+
112120
ESP_AT_wiFiManager.setConfigPortalTimeout(60); //If no access point name has been previously entered disable timeout.
113-
Serial.println(F("Got stored Credentials. Timeout 60s"));
121+
Serial.println(F("Got stored Credentials but can't connect. Timeout 60s"));
114122
}
115123
else
116-
Serial.println(F("No stored Credentials. No timeout"));
124+
Serial.println(F("No stored or not valid Credentials. No timeout"));
117125

118126
// SSID to uppercase
119127
ssid.toUpperCase();
@@ -156,6 +164,8 @@ void setup()
156164
Serial.println("\nStart AutoConnectWithFeedBack with ESP8266-AT WiFi module on " + String(BOARD_NAME));
157165
#endif
158166

167+
Serial.println(ESP_AT_WIFIMANAGER_VERSION);
168+
159169
// initialize serial for ESP module
160170
EspSerial.begin(115200);
161171

@@ -172,8 +182,8 @@ void setup()
172182

173183
enterConfigPortal();
174184

175-
//if you get here you have connected to the WiFi
176-
Serial.println("WiFi connected");
185+
//if you get here you have exied from Config Portal
186+
Serial.println("Exit Config Portal");
177187
}
178188

179189
void loop()

examples/AutoConnectWithFeedback/defines.h

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,15 @@
11
/****************************************************************************************************************************
2-
defines.h
3-
WiFi/Credentials Manager for SAM DUE, SAMD, nRF52, STM32F/L/H/G/WB/MP1, etc. boards running `ESP8266/ESP32-AT-command` shields
4-
5-
ESP_AT_WiFiManager is a library for the Teensy, SAM DUE, SAMD, nRF52, STM32F/L/H/G/WB/MP1, etc. boards running `ESP8266/ESP32-AT-command` shields
6-
(https://github.com/esp8266/Arduino) to enable easy configuration and reconfiguration of WiFi, etc. credentials using a Captive Portal
7-
8-
Based on and modified from Tzapu https://github.com/tzapu/WiFiManager
9-
and from Ken Taylor https://github.com/kentaylor
10-
11-
Built by Khoi Hoang https://github.com/khoih-prog/ESP_AT_WiFiManager
12-
Licensed under MIT license
13-
Version: 1.0.3
14-
15-
Version Modified By Date Comments
16-
------- ----------- ---------- -----------
17-
1.0.0 K Hoang 08/03/2020 Initial coding
18-
1.0.1 K Hoang 22/06/2020 Add support to nRF52 boards, such as AdaFruit Feather nRF52832, NINA_B302_ublox, etc.
19-
1.0.2 K Hoang 02/07/2020 Add support to ESP32-AT-command shields.
20-
1.0.3 K Hoang 28/07/2020 Add support to STM32F/L/H/G/WB/MP1 and Seeeduino SAMD21/SAMD51 boards. Add Packages' Patches.
2+
defines.h
3+
WiFi/Credentials Manager for SAM DUE, SAMD, nRF52, STM32F/L/H/G/WB/MP1, etc. boards running `ESP8266/ESP32-AT-command` shields
4+
5+
ESP_AT_WiFiManager is a library for the Teensy, SAM DUE, SAMD, nRF52, STM32F/L/H/G/WB/MP1, etc. boards running `ESP8266/ESP32-AT-command` shields
6+
(https://github.com/esp8266/Arduino) to enable easy configuration and reconfiguration of WiFi, etc. credentials using a Captive Portal
7+
8+
Based on and modified from Tzapu https://github.com/tzapu/WiFiManager
9+
and from Ken Taylor https://github.com/kentaylor
10+
11+
Built by Khoi Hoang https://github.com/khoih-prog/ESP_AT_WiFiManager
12+
Licensed under MIT license
2113
*****************************************************************************************************************************/
2214

2315
#ifndef defines_h
@@ -288,6 +280,9 @@
288280
#elif defined(STM32L4)
289281
#warning STM32L4 board selected
290282
#define BOARD_TYPE "STM32L4"
283+
#elif defined(STM32L5)
284+
#warning STM32L5 board selected
285+
#define BOARD_TYPE "STM32L5"
291286
#elif defined(STM32H7)
292287
#warning STM32H7 board selected
293288
#define BOARD_TYPE "STM32H7"

0 commit comments

Comments
 (0)