Skip to content
This repository was archived by the owner on Nov 25, 2021. It is now read-only.

Commit 07d0d04

Browse files
authored
v1.0.8
### Releases v1.0.8 1. Fix [AP-staying-open bug](#2). 2. Add clearConfigData() to enable forcing into ConfigPortal Mode when necessary
1 parent 591e22a commit 07d0d04

File tree

4 files changed

+175
-22
lines changed

4 files changed

+175
-22
lines changed

README.md

+155-16
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,25 @@
22

33
[![arduino-library-badge](https://www.ardu-badge.com/badge/Blynk_WiFiManager.svg?)](https://www.ardu-badge.com/Blynk_WiFiManager)
44

5-
I'm inspired by [`EasyBlynk8266`] (https://github.com/Barbayar/EasyBlynk8266)
5+
I'm inspired by [`EasyBlynk8266`](https://github.com/Barbayar/EasyBlynk8266)
66

77
To help you to eliminate `hardcoding` your Wifi and Blynk credentials for ESP8266 and ESP32 (with / wwithout SSL), and updating/reflashing every time when you need to change them.
88

9+
With version `v1.0.7` or later, you now can configure:
10+
11+
1. `Multiple WiFi Credentials (SSID, Password) and system will autoconnect to the best and available WiFi SSID.`
12+
2. `Multiple Blynk Credentials (Server, Token) and system will autoconnect to the available Blynk Servers.`
13+
14+
With version `v1.0.5` or later, you now can configure:
15+
16+
1. `Config Portal Static IP address, Name and Password.`
17+
2. `Static IP address, Gateway, Subnet Mask and 2 DNS Servers IP addresses.`
18+
919
### Installation
1020

1121
The suggested way to install is to:
1222

13-
1. Navigate to [Blynk_WM] (https://github.com/khoih-prog/Blynk_WM) page.
23+
1. Navigate to [Blynk_WM](https://github.com/khoih-prog/Blynk_WM) page.
1424
2. Download the latest release `Blynk_WM-master.zip`.
1525
3. Extract the zip file to `Blynk_WM-master` directory
1626
4. Copy whole `Blynk_WM-master/src` folder to Arduino libraries' `src` directory such as `~/Arduino/libraries/Blynk/src`.
@@ -36,8 +46,8 @@ to use SPIFFS or
3646
```
3747
#define USE_SPIFFS false
3848
```
39-
to use EEPROM ( 172 bytes from address EEPROM_START ) to save your configuration data.
40-
EEPROM_SIZE can be specified from 256 to 4096 bytes. See examples [ESP32WM_Config] (https://github.com/khoih-prog/Blynk_WM/tree/master/examples/ESP32WM_Config) and [ESP8266WM_Config] (https://github.com/khoih-prog/Blynk_WM/tree/master/examples/ESP8266WM_Config).
49+
to use EEPROM ( 176 bytes from address EEPROM_START ) to save your configuration data.
50+
EEPROM_SIZE can be specified from 256 to 4096 bytes. See examples [ESP32WM_Config](https://github.com/khoih-prog/Blynk_WM/tree/master/examples/ESP32WM_Config) and [ESP8266WM_Config](https://github.com/khoih-prog/Blynk_WM/tree/master/examples/ESP8266WM_Config).
4151

4252

4353
```
@@ -76,18 +86,86 @@ Also see examples:
7686
If it cannot connect to the Blynk server in 30 seconds, it will switch to `Configuration Mode`. You will see your built-in LED turned ON. In `Configuration Mode`, it starts an access point called `ESP_xxxxxx`. Connect to it using password `MyESP_xxxxxx` .
7787

7888
<p align="center">
79-
<img src="https://github.com/khoih-prog/Blynk_WM/blob/master/pics/Selection_004.jpg">
89+
<img src="https://github.com/khoih-prog/Blynk_WM/blob/master/pics/PortalAuth.jpg">
8090
</p>
8191

8292
After you connected, please, go to http://192.168.4.1.
8393

8494
<p align="center">
85-
<img src="https://github.com/khoih-prog/Blynk_WM/blob/master/pics/Selection_005.jpg">
95+
<img src="https://github.com/khoih-prog/Blynk_WM/blob/master/pics/ConfigPortal.png">
8696
</p>
8797

8898
Enter your credentials, then click `Save`. After you restarted, you will see your built-in LED turned OFF. That means, it connected to your Blynk server successfully.
8999

90-
This `Blynk.begin()` is not a blocking call, so you can use it for critical functions requiring in loop().
100+
The following is the sample terminal output when running example [ESP8266WM_Config](examples/ESP8266WM_Config)
101+
102+
```
103+
Starting ...
104+
[65] RFC925 Hostname = ESP8266-WM-Config
105+
[66] Calc Cksum = 0x309d, Read Cksum = 0x309d
106+
[66] Header = ESP8266, Board Name = ESP8266-Multi-WM
107+
[67] SSID = ****, PW = ****
108+
[70] SSID1 = ****1, PW1 = ****1
109+
[74] Server = 192.168.2.112, Token = ****
110+
[80] Server1 = account.duckdns.org, Token1 = ****
111+
[86] Port = 8080
112+
[88] Connecting MultiWifi...
113+
[11276] WiFi connected after time: 2
114+
[11276] SSID: ****, RSSI = -45 <= Connected to SSID
115+
[11276] Channel: 2, IP address: 192.168.2.91
116+
[11277] bg: WiFi connected. Try Blynk
117+
[11279]
118+
___ __ __
119+
/ _ )/ /_ _____ / /__
120+
/ _ / / // / _ \/ '_/
121+
/____/_/\_, /_//_/_/\_\
122+
/___/ v0.6.1 on NodeMCU
123+
124+
[11292] BlynkArduinoClient.connect: Connecting to 192.168.2.112:8080 <= Try Server
125+
[11325] Ready (ping: 19ms). <= Connected to Server
126+
[11392] Connected to Blynk Server = 192.168.2.112, Token = ****
127+
[11392] bg: WiFi+Blynk connected
128+
Blynk ESP8288 using EEPROM connected. Board Name : ESP8266-Multi-WM
129+
EEPROM size = 4096 bytes, EEPROM start address = 512 / 0x200
130+
BRB
131+
[101232] run: WiFi lost. Reconnect WiFi+Blynk <= Lost SSID
132+
[101232] Connecting MultiWifi...
133+
[106316] WiFi connected after time: 1
134+
[106317] SSID: ****1, RSSI = -62 <= Connected to SSID1
135+
[106317] Channel: 4, IP address: 192.168.2.91
136+
[106317] run: WiFi reconnected. Connect to Blynk
137+
[106320] BlynkArduinoClient.connect: Connecting to 192.168.2.112:8080 <= Try Server
138+
[106352] Ready (ping: 11ms). <= Connected to Server
139+
[106419] run: WiFi+Blynk reconnected
140+
RB
141+
[165434] Heartbeat timeout <= Lost Server
142+
[165735] run: Blynk lost. Connect Blynk
143+
[165735]
144+
___ __ __
145+
/ _ )/ /_ _____ / /__
146+
/ _ / / // / _ \/ '_/
147+
/____/_/\_, /_//_/_/\_\
148+
/___/ v0.6.1 on NodeMCU
149+
150+
[165741] BlynkArduinoClient.connect: Connecting to 192.168.2.112:8080 <= Try Server not OK
151+
[170741]
152+
___ __ __
153+
/ _ )/ /_ _____ / /__
154+
/ _ / / // / _ \/ '_/
155+
/____/_/\_, /_//_/_/\_\
156+
/___/ v0.6.1 on NodeMCU
157+
158+
[170743] BlynkArduinoClient.connect: Connecting to account.duckdns.org:8080 <= Try Server1
159+
[170781] Ready (ping: 9ms).
160+
[170848] Connected to Blynk Server = account.duckdns.org, Token = **** <= Connected to Server1
161+
[170848] run: Blynk reconnected
162+
RBRBRBRBRBRBRB RBRB
163+
164+
```
165+
166+
You can see that the system automatically detect and connect to the best or avaiable WiFi APs and/or Blynk Servers, whenever interruption happens. This feature is very useful for systems requiring high degree of reliability.
167+
168+
Moreover, this `Blynk.begin()` is not a blocking call, so you can use it for critical functions requiring in loop().
91169
Anyway, this is better for projects using Blynk just for GUI (graphical user interface).
92170

93171
In operation, if WiFi or Blynk connection is lost, `Blynk.run()` will try reconnecting automatically. Therefore, `Blynk.run()` must be called in the `loop()` function. Don't use:
@@ -112,21 +190,27 @@ void loop()
112190
```
113191

114192
## Prerequisite
115-
* `ESP8266 core 2.5.2 or later` for Arduino (https://github.com/esp8266/Arduino#installing-with-boards-manager)
116-
* `Blynk library 0.6.1 or later` (https://www.arduino.cc/en/guide/libraries#toc3)
193+
* [`ESP8266 core 2.6.3 or later` for Arduino](https://github.com/esp8266/Arduino#installing-with-boards-manager)
194+
* [`Blynk library 0.6.1 or later`](https://www.arduino.cc/en/guide/libraries#toc3)
117195

118196
## TO DO
119197

120198
1. Same features for other boards with WiFi.
121199

122200
## DONE
123201

124-
1. Permit EEPROM size and location configurable to avoid conflict with others.
125-
2. More flexible to configure reconnection timeout.
126-
3. For fresh config data, don't need to wait for connecting timeout before entering config portal.
127-
4. If the config data not entered completely (SSID, password, Server and Blynk token), entering config portal
128-
5. Correct the operation of BUILTIN_LED
129-
6. Modify code to be compatible with ESP8266 core pre-2.5.2.
202+
1. Permit EEPROM size and location configurable to avoid conflict with others.
203+
2. More flexible to configure reconnection timeout.
204+
3. For fresh config data, don't need to wait for connecting timeout before entering config portal.
205+
4. If the config data not entered completely (SSID, password, Server and Blynk token), entering config portal
206+
5. Correct the operation of BUILTIN_LED
207+
6. Modify code to be compatible with ESP8266 core pre-2.5.2.
208+
7. Add RFC952 hostname
209+
8. Add configurable Config Portal IP, SSID and Password
210+
9. Add configurable Static IP, GW, Subnet Mask and 2 DNS Servers' IP Addresses.
211+
10. Add checksum for more reliable data
212+
11. Add MultiWiFi feature to enable reconnect to the best / available WiFi AP.
213+
12. Add MultiBlynk feature to enable reconnect to the best / available Blynk Server.
130214

131215
## Example
132216
Please take a look at examples, as well.
@@ -154,7 +238,7 @@ Please take a look at examples, as well.
154238
#define CONFIG_TIMEOUT_RETRYTIMES_BEFORE_RESET 5
155239
// Those above #define's must be placed before #include <BlynkSimpleEsp8266_WM.h>
156240
157-
#define USE_SSL true
241+
#define USE_SSL false
158242
159243
#if USE_SSL
160244
#include <BlynkSimpleEsp8266_SSL_WM.h>
@@ -164,6 +248,21 @@ Please take a look at examples, as well.
164248
165249
void setup()
166250
{
251+
....
252+
253+
// From v1.0.5
254+
// Set config portal SSID and Password
255+
Blynk.setConfigPortal("TestPortal", "TestPortalPass");
256+
// Set config portal IP address
257+
Blynk.setConfigPortalIP(IPAddress(192, 168, 220, 1));
258+
259+
// From v1.0.5, select either one of these to set static IP + DNS
260+
Blynk.setSTAStaticIPConfig(IPAddress(192, 168, 2, 230), IPAddress(192, 168, 2, 1), IPAddress(255, 255, 255, 0));
261+
//Blynk.setSTAStaticIPConfig(IPAddress(192, 168, 2, 220), IPAddress(192, 168, 2, 1), IPAddress(255, 255, 255, 0),
262+
// IPAddress(192, 168, 2, 1), IPAddress(8, 8, 8, 8));
263+
//Blynk.setSTAStaticIPConfig(IPAddress(192, 168, 2, 220), IPAddress(192, 168, 2, 1), IPAddress(255, 255, 255, 0),
264+
// IPAddress(4, 4, 4, 4), IPAddress(8, 8, 8, 8));
265+
167266
// Use this to default DHCP hostname to ESP8266-XXXXXX or ESP32-XXXXXX
168267
//Blynk.begin();
169268
// Use this to personalize DHCP hostname (RFC952 conformed)
@@ -176,6 +275,41 @@ void loop()
176275
Blynk.run();
177276
}
178277
```
278+
### Releases v1.0.8
279+
280+
***Why this version***
281+
282+
1. Fix [AP-staying-open bug](https://github.com/khoih-prog/Blynk_WM/issues/2). Thanks to [chriskio](https://github.com/chriskio) to report.
283+
2. Add clearConfigData().
284+
285+
### Releases v1.0.7
286+
287+
***Why this version***
288+
289+
1. Add checksum for more reliable data
290+
2. Add MultiWiFi feature to enable reconnect to the best / available WiFi AP.
291+
3. Add MultiBlynk feature to enable reconnect to the best / available Blynk Server.
292+
293+
### Releases v1.0.6
294+
295+
***Why this version***
296+
297+
Optimize, fix ESP32 EEPROM size to 2K from 4K, shorten code size, add functions, use dynamically allocated Config Portal WebServer.
298+
299+
### Releases v1.0.5
300+
301+
***Why this version***
302+
303+
Normally, the `default Portal IP (192.168.4.1)`, SSID and PW as well as the `dynamically allocated` board's IP address are good enough.
304+
In special cases where there is conflict, if static IP is required or bad router's DNS settings, you can use the new features to force the configurable IP addresses. ***But please use with care to avoid potential issues.***
305+
306+
***New in this version***
307+
308+
Add new features to enable :
309+
310+
1. configuring Portal Static IP address, Name and Password.
311+
2. configuring Static IP address, Gateway, Subnet Mask and 2 DNS Servers IP addresses.
312+
179313
### Releases v1.0.4
180314

181315
***Why this version***
@@ -216,6 +350,11 @@ Now you can easily specify and have the friendly, identifiable, RFC-952-conforme
216350

217351
3. Correct the operation of BUILTIN_LED
218352

353+
### Contributions and thanks
354+
355+
1. Thanks to [chriskio](https://github.com/chriskio) to report [AP-staying-open bug](https://github.com/khoih-prog/Blynk_WM/issues/2).
356+
357+
219358
## Contributing
220359

221360
If you want to contribute to this project:

keywords.txt

+16-3
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ WidgetMap KEYWORD1
1313
WidgetTable KEYWORD1
1414
BlynkParam KEYWORD1
1515
BlynkParamAllocated KEYWORD1
16+
WiFi_Credentials KEYWORD1
17+
Blynk_Credentials KEYWORD1
18+
Blynk_WF_Configuration KEYWORD1
1619

1720
#######################################
1821
# Methods and Functions (KEYWORD2)
@@ -34,12 +37,22 @@ logEvent KEYWORD2
3437
loadConfigData KEYWORD2
3538
saveConfigData KEYWORD2
3639
getConfigData KEYWORD2
37-
connectToWifi KEYWORD2
40+
connectMultiWiFi KEYWORD2
41+
connectMultiBlynk KEYWORD2
3842
handleRequest KEYWORD2
3943
startConfigurationMode KEYWORD2
40-
getBoardName KEYWORD2
4144
setHostname KEYWORD2
42-
45+
setConfigPortalIP KEYWORD2
46+
setConfigPortal KEYWORD2
47+
setSTAStaticIPConfig KEYWORD2
48+
getServerName KEYWORD2
49+
getToken KEYWORD2
50+
getBlynkBTToken KEYWORD2
51+
getBlynkBLEToken KEYWORD2
52+
getBoardName KEYWORD2
53+
getHWPort KEYWORD2
54+
getFullConfigData KEYWORD2
55+
clearConfigData KEYWORD2
4356

4457
# Handler helpers
4558
BLYNK_READ KEYWORD2

library.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "Blynk_WM",
3-
"version": "1.0.4",
3+
"version": "1.0.8",
44
"description": "Build a smartphone app for your project in minutes. Blynk allows creating IoT solutions easily. It supports WiFi, BLE, Bluetooth, Ethernet, GSM, USB, Serial. Works with many boards like ESP8266, ESP32, Arduino UNO, Nano, Due, Mega, Zero, MKR100, Yun, Raspberry Pi, Particle, Energia, ARM mbed, Intel Edison/Galileo/Joule, BBC micro:bit, DFRobot, RedBearLab, Microduino, LinkIt ONE ...",
55
"keywords": "sensors, control, device, smartphone, mobile, app, web, cloud, communication, protocol, iot, m2m, wifi, ble, bluetooth, ethernet, usb, serial, gsm, gprs, 3g, data, esp8266, http",
66
"authors":

library.properties

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
name=Blynk_WiFiManager
2-
version=1.0.4
2+
version=1.0.8
33
author=Khoi Hoang
44
license=MIT
55
maintainer=Khoi Hoang <[email protected]>
66
sentence=Simple WiFiManager for Blynk and ESP8266/ESP32 with or without SSL, configuration data saved in either SPIFFS or EEPROM
7-
paragraph=Library for configuring/auto(re)connecting ESP8266/ESP32 modules to WiFi and Blynk at runtime.
7+
paragraph=Library for configuring/auto(re)connecting ESP8266/ESP32 modules to MultiWiFi and MultiBlynk at runtime.
88
category=Communication
99
url=https://github.com/khoih-prog/Blynk_WM
1010
architectures=esp8266,esp32
11+
depends=Blynk

0 commit comments

Comments
 (0)