Skip to content
This repository was archived by the owner on Feb 9, 2022. It is now read-only.

Commit 363eecd

Browse files
authored
v1.6.0 to use ESP8266 core v3.0.0
### Major Releases v1.6.0 1. Fix AP connect issue caused by **breaking ESP8266 core v3.0.0**. Caused by multiple core changes, but the new solution results a better and faster connection to AP. 2. Fix SSL issue caused by breaking ESP8266 core v3.0.0. Now the better **BearSSL** is used in both ESP32 and ESP8266 to replace the ESP8266 deprecated `axTLS`. Check [Remove axTLS from code and documentation #7437](esp8266/Arduino#7437) 3. Fix the `BLYNK_INFO_DEVICE`displaying the generic ESP8266 board with Blynk logo. Caused by new ESP8266 core changes of `build.board`. For example from `ESP8266_NODEMCU` in core v2.7.4 to `ESP8266_NODEMCU_ESP12E` in core v3.0.0 4. Fix many warnings only displayed in new core ESP8266 v3.0.0 5. Make code compatible for either new ESP8266 core v3.0.0+ or ealier cores v2.7.4-
1 parent 089b453 commit 363eecd

8 files changed

+441
-95
lines changed

CONTRIBUTING.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ If you don't find anything, please [open a new issue](https://github.com/khoih-p
1515
Please ensure to specify the following:
1616

1717
* Arduino IDE version (e.g. 1.8.13) or Platform.io version
18-
* `ESP8266` or `ESP32` Core Version (e.g. ESP8266 core v2.7.4 or ESP32 v1.0.6)
18+
* `ESP8266` or `ESP32` Core Version (e.g. ESP8266 core v3.0.0 or ESP32 v1.0.6)
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.13
30-
ESP8266 Core Version 2.7.4
29+
Arduino IDE version: v1.8.13
30+
ESP8266 Core Version v3.0.0
3131
OS: Ubuntu 20.04 LTS
32-
Linux Inspiron 5.4.0-72-generic #80-Ubuntu SMP Mon Apr 12 17:35:00 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
32+
Linux Inspiron 5.4.0-73-generic #82-Ubuntu SMP Wed Apr 14 17:39:42 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
3333
3434
Context:
3535
The board couldn't autoreconnect to Local Blynk Server after router power recycling.
@@ -40,6 +40,7 @@ Steps to reproduce:
4040
3. ...
4141
4. ...
4242
```
43+
4344
### Sending Feature Requests
4445

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

README.md

Lines changed: 134 additions & 17 deletions
Large diffs are not rendered by default.

library.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "Blynk_Async_WM",
3-
"version": "1.5.0",
4-
"description": "Library, using AsyncWebServer instead of (ESP8266)WebServer, for configuring/auto(re)connecting ESP32 (including ESP32-S2 and ESP32-C3), ESP8266 modules to best or available MultiWiFi APs and MultiBlynk servers at runtime. Enable adding dynamic custom parameters from sketch and input using the same Config Portal (CP). CP will be auto-adjusted to match the number of dynamic parameters. Optional default Credentials to be autoloaded into CP to use or change instead of manually input. Static STA IP and DHCP Hostname as well as Config Portal AP channel, IP, SSID, Password can be configured. Config. Data saved in ESP8266/ESP32 LittleFS, SPIFFS or EEPROM. Multi, Double DetectDetector or Virtual CP Switch feature permits entering CP as requested. Configurable Customs HTML Headers, including Customs Style, Customs Head Elements, CORS Header.",
3+
"version": "1.6.0",
4+
"description": "Library, using AsyncWebServer instead of (ESP8266)WebServer, for configuring/auto(re)connecting ESP32 (including ESP32-S2 and ESP32-C3), ESP8266 modules to best or available MultiWiFi APs and MultiBlynk servers at runtime. Enable adding dynamic custom parameters from sketch and input using the same Config Portal (CP). CP will be auto-adjusted to match the number of dynamic parameters. Optional default Credentials to be autoloaded into CP to use or change instead of manually input. Static STA IP and DHCP Hostname as well as Config Portal AP channel, IP, SSID, Password can be configured. Config. Data saved in ESP8266/ESP32 LittleFS, SPIFFS or EEPROM. Multi, Double DetectDetector or Virtual CP Switch feature permits entering CP as requested. Configurable Customs HTML Headers, including Customs Style, Customs Head Elements, CORS Header. Now with scanning of WiFi networks for selection in Configuration Portal and working with new ESP8266 core v3.0.0 and ESP32 core v1.0.6",
55
"keywords": "control, device, communication, blynk, iot, wifi, esp8266, esp32, esp32-s2, esp32-c3, async, drd, mrd, double-reset, multi-reset, config-portal, credentials, dynamic-params, customs-header, smartphone, mobile, app, web, cloud, sensors, m2m, protocol, ble, bluetooth, Manager, DynamicParameters, dynamic, configportal, usb, serial, ethernet, data, http, portal ",
66
"authors":
77
{

library.properties

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
name=Blynk_Async_WM
2-
version=1.5.0
2+
version=1.6.0
33
author=Khoi Hoang
44
license=MIT
55
maintainer=Khoi Hoang <[email protected]>
6-
sentence=Simple Async WiFiManager for Blynk and ESP32 (including ESP32-S2, ESP32-C3), ESP8266 with or without SSL, configuration data saved in either LittleFS, SPIFFS or EEPROM
7-
paragraph=Library, using AsyncWebServer instead of (ESP8266)WebServer, for configuring/auto(re)connecting ESP32 (including ESP32-S2, ESP32-C3), ESP8266 modules to best or available MultiWiFi APs and MultiBlynk servers at runtime. Enable adding dynamic custom parameters from sketch and input using the same Config Portal (CP). CP will be auto-adjusted to match the number of dynamic parameters. Optional default Credentials to be autoloaded into CP to use or change instead of manually input. Static STA IP and DHCP Hostname as well as Config Portal AP channel, IP, SSID, Password can be configured. Config. Data saved in ESP8266/ESP32 LittleFS, SPIFFS or EEPROM. Multi, Double DetectDetector or Virtual CP Switch feature permits entering CP as requested. Configurable Customs HTML Headers, including Customs Style, Customs Head Elements, CORS Header.
6+
sentence=Simple Async WiFiManager for Blynk and ESP32 (including ESP32-S2, ESP32-C3), ESP8266 with or without SSL, configuration data saved in either LittleFS, SPIFFS or EEPROM. Now working with new ESP8266 core v3.0.0 and ESP32 core v1.0.6
7+
paragraph=Library, using AsyncWebServer instead of (ESP8266)WebServer, for configuring/auto(re)connecting ESP32 (including ESP32-S2, ESP32-C3), ESP8266 modules to best or available MultiWiFi APs and MultiBlynk servers at runtime. Enable adding dynamic custom parameters from sketch and input using the same Config Portal (CP). CP will be auto-adjusted to match the number of dynamic parameters. Optional default Credentials to be autoloaded into CP to use or change instead of manually input. Static STA IP and DHCP Hostname as well as Config Portal AP channel, IP, SSID, Password can be configured. Config. Data saved in ESP8266/ESP32 LittleFS, SPIFFS or EEPROM. Multi, Double DetectDetector or Virtual CP Switch feature permits entering CP as requested. Configurable Customs HTML Headers, including Customs Style, Customs Head Elements, CORS Header. Now with scanning of WiFi networks for selection in Configuration Portal.
88
category=Communication
99
url=https://github.com/khoih-prog/Blynk_Async_WM
1010
architectures=esp8266,esp32

src/BlynkSimpleEsp32_Async_WM.h

Lines changed: 33 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
@date Jan 2015
1818
@brief
1919
20-
Version: 1.5.0
20+
Version: 1.6.0
2121
2222
Version Modified By Date Comments
2323
------- ----------- ---------- -----------
@@ -33,6 +33,7 @@
3333
Fix SSL issue with Blynk Cloud Server
3434
1.4.1 K Hoang 24/04/2021 Fix issue of custom Blynk port (different from 8080 or 9443) not working on ESP32
3535
1.5.0 K Hoang 25/04/2021 Enable scan of WiFi networks for selection in Configuration Portal
36+
1.6.0 K Hoang 19/05/2021 Fix AP connect and SSL issues caused by breaking ESP8266 core v3.0.0
3637
********************************************************************************************************************************/
3738

3839
#pragma once
@@ -44,7 +45,34 @@
4445
#error This code is intended to run on the ESP32 platform! Please check your Tools->Board setting.
4546
#endif
4647

47-
#define BLYNK_ASYNC_WM_VERSION "Blynk_Async_WM for ESP32 v1.5.0"
48+
#define BLYNK_ASYNC_WM_VERSION "Blynk_Async_WM for ESP32 v1.6.0"
49+
50+
//////////////////////////////////////////////
51+
// From v1.6.0 to display correct BLYNK_INFO_DEVICE
52+
53+
#define BLYNK_USE_128_VPINS
54+
55+
#if defined(BLYNK_INFO_DEVICE)
56+
#undef BLYNK_INFO_DEVICE
57+
#endif
58+
59+
#define BLYNK_BUFFERS_SIZE 4096
60+
61+
#if defined(BLYNK_INFO_DEVICE)
62+
#undef BLYNK_INFO_DEVICE
63+
#endif
64+
65+
#if defined(ARDUINO_BOARD)
66+
#define BLYNK_INFO_DEVICE ARDUINO_BOARD
67+
#elif defined(BOARD_NAME)
68+
#define BLYNK_INFO_DEVICE BOARD_NAME
69+
#elif defined(BOARD_TYPE)
70+
#define BLYNK_INFO_DEVICE BOARD_TYPE
71+
#else
72+
#define BLYNK_INFO_DEVICE "ESP32"
73+
#endif
74+
75+
/////////////////////////////////////////////
4876

4977
#define BLYNK_SEND_ATOMIC
5078

@@ -2696,22 +2724,21 @@ class BlynkWifi
26962724

26972725
static int channel;
26982726
// Use random channel if WiFiAPChannel == 0
2699-
// Use random channel if WiFiAPChannel == 0
27002727
if (WiFiAPChannel == 0)
27012728
{
27022729
//channel = random(MAX_WIFI_CHANNEL) + 1;
27032730
channel = (millis() % MAX_WIFI_CHANNEL) + 1;
27042731
}
27052732
else
27062733
channel = WiFiAPChannel;
2734+
2735+
// KH, Must be here for ESP8266 core v3.0.0. Good for v2.7.4- and ESP32 as well
2736+
WiFi.softAPConfig(portal_apIP, portal_apIP, IPAddress(255, 255, 255, 0));
27072737

27082738
WiFi.softAP(portal_ssid.c_str(), portal_pass.c_str(), channel);
27092739

27102740
BLYNK_LOG4(BLYNK_F("\nstConf:SSID="), portal_ssid, BLYNK_F(",PW="), portal_pass);
27112741
BLYNK_LOG4(BLYNK_F("IP="), portal_apIP.toString(), ",ch=", channel);
2712-
2713-
delay(100); // ref: https://github.com/espressif/arduino-esp32/issues/985#issuecomment-359157428
2714-
WiFi.softAPConfig(portal_apIP, portal_apIP, IPAddress(255, 255, 255, 0));
27152742

27162743
if (!server)
27172744
{

src/BlynkSimpleEsp32_SSL_Async_WM.h

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
@date Jan 2015
1818
@brief
1919
20-
Version: 1.5.0
20+
Version: 1.6.0
2121
2222
Version Modified By Date Comments
2323
------- ----------- ---------- -----------
@@ -33,6 +33,7 @@
3333
Fix SSL issue with Blynk Cloud Server
3434
1.4.1 K Hoang 24/04/2021 Fix issue of custom Blynk port (different from 8080 or 9443) not working on ESP32
3535
1.5.0 K Hoang 25/04/2021 Enable scan of WiFi networks for selection in Configuration Portal
36+
1.6.0 K Hoang 19/05/2021 Fix AP connect and SSL issues caused by breaking ESP8266 core v3.0.0
3637
********************************************************************************************************************************/
3738

3839
#pragma once
@@ -44,7 +45,34 @@
4445
#error This code is intended to run on the ESP32 platform! Please check your Tools->Board setting.
4546
#endif
4647

47-
#define BLYNK_ASYNC_WM_VERSION "Blynk_Async_WM SSL for ESP32 v1.5.0"
48+
#define BLYNK_ASYNC_WM_VERSION "Blynk_Async_WM SSL for ESP32 v1.6.0"
49+
50+
//////////////////////////////////////////////
51+
// From v1.6.0 to display correct BLYNK_INFO_DEVICE
52+
53+
#define BLYNK_USE_128_VPINS
54+
55+
#if defined(BLYNK_INFO_DEVICE)
56+
#undef BLYNK_INFO_DEVICE
57+
#endif
58+
59+
#define BLYNK_BUFFERS_SIZE 4096
60+
61+
#if defined(BLYNK_INFO_DEVICE)
62+
#undef BLYNK_INFO_DEVICE
63+
#endif
64+
65+
#if defined(ARDUINO_BOARD)
66+
#define BLYNK_INFO_DEVICE ARDUINO_BOARD
67+
#elif defined(BOARD_NAME)
68+
#define BLYNK_INFO_DEVICE BOARD_NAME
69+
#elif defined(BOARD_TYPE)
70+
#define BLYNK_INFO_DEVICE BOARD_TYPE
71+
#else
72+
#define BLYNK_INFO_DEVICE "ESP32_SSL"
73+
#endif
74+
75+
/////////////////////////////////////////////
4876

4977
#if defined(BLYNK_SSL_USE_LETSENCRYPT)
5078
static const char BLYNK_DEFAULT_ROOT_CA[] =
@@ -2778,14 +2806,14 @@ class BlynkWifi
27782806
}
27792807
else
27802808
channel = WiFiAPChannel;
2809+
2810+
// KH, Must be here for ESP8266 core v3.0.0. Good for v2.7.4- and ESP32 as well
2811+
WiFi.softAPConfig(portal_apIP, portal_apIP, IPAddress(255, 255, 255, 0));
27812812

27822813
WiFi.softAP(portal_ssid.c_str(), portal_pass.c_str(), channel);
27832814

27842815
BLYNK_LOG4(BLYNK_F("\nstConf:SSID="), portal_ssid, BLYNK_F(",PW="), portal_pass);
27852816
BLYNK_LOG4(BLYNK_F("IP="), portal_apIP.toString(), ",ch=", channel);
2786-
2787-
delay(100); // ref: https://github.com/espressif/arduino-esp32/issues/985#issuecomment-359157428
2788-
WiFi.softAPConfig(portal_apIP, portal_apIP, IPAddress(255, 255, 255, 0));
27892817

27902818
if (!server)
27912819
{

src/BlynkSimpleEsp8266_Async_WM.h

Lines changed: 88 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
@date Jan 2015
1818
@brief
1919
20-
Version: 1.5.0
20+
Version: 1.6.0
2121
2222
Version Modified By Date Comments
2323
------- ----------- ---------- -----------
@@ -33,6 +33,7 @@
3333
Fix SSL issue with Blynk Cloud Server
3434
1.4.1 K Hoang 24/04/2021 Fix issue of custom Blynk port (different from 8080 or 9443) not working on ESP32
3535
1.5.0 K Hoang 25/04/2021 Enable scan of WiFi networks for selection in Configuration Portal
36+
1.6.0 K Hoang 19/05/2021 Fix AP connect and SSL issues caused by breaking ESP8266 core v3.0.0
3637
********************************************************************************************************************************/
3738

3839
#pragma once
@@ -44,10 +45,89 @@
4445
#error This code is intended to run on the ESP8266 platform! Please check your Tools->Board setting.
4546
#endif
4647

47-
#define BLYNK_ASYNC_WM_VERSION "Blynk_Async_WM for ESP8266 v1.5.0"
48+
#define BLYNK_ASYNC_WM_VERSION "Blynk_Async_WM for ESP8266 v1.6.0"
4849

4950
#include <version.h>
5051

52+
/////////////////////////////////////////////
53+
54+
#if (ARDUINO_ESP8266_GIT_VER == 0xefb0341a)
55+
#define USING_ESP8266_CORE_VERSION 30000
56+
#define ESP8266_CORE_VERSION "ESP8266 core v3.0.0"
57+
#warning USING_ESP8266_CORE_VERSION "3.0.0"
58+
#elif (ARDUINO_ESP8266_GIT_VER == 0x2843a5ac)
59+
#define USING_ESP8266_CORE_VERSION 20704
60+
#define ESP8266_CORE_VERSION "ESP8266 core v2.7.4"
61+
#warning USING_ESP8266_CORE_VERSION "2.7.4"
62+
#elif (ARDUINO_ESP8266_GIT_VER == 0x5d3af165)
63+
#define USING_ESP8266_CORE_VERSION 20703
64+
#define ESP8266_CORE_VERSION "ESP8266 core v2.7.3"
65+
#warning USING_ESP8266_CORE_VERSION "2.7.3"
66+
#elif (ARDUINO_ESP8266_GIT_VER == 0x39c79d9b)
67+
#define USING_ESP8266_CORE_VERSION 20702
68+
#define ESP8266_CORE_VERSION "ESP8266 core v2.7.2"
69+
#warning USING_ESP8266_CORE_VERSION "2.7.2"
70+
#elif (ARDUINO_ESP8266_GIT_VER == 0xa5432625)
71+
#define USING_ESP8266_CORE_VERSION 20701
72+
#define ESP8266_CORE_VERSION "ESP8266 core v2.7.1"
73+
#warning USING_ESP8266_CORE_VERSION "2.7.1"
74+
#elif (ARDUINO_ESP8266_GIT_VER == 0x3d128e5c)
75+
#define USING_ESP8266_CORE_VERSION 20603
76+
#define ESP8266_CORE_VERSION "ESP8266 core v2.6.3"
77+
#warning USING_ESP8266_CORE_VERSION "2.6.3"
78+
#elif (ARDUINO_ESP8266_GIT_VER == 0x482516e3)
79+
#define USING_ESP8266_CORE_VERSION 20602
80+
#define ESP8266_CORE_VERSION "ESP8266 core v2.6.2"
81+
#warning USING_ESP8266_CORE_VERSION "2.6.2"
82+
#elif (ARDUINO_ESP8266_GIT_VER == 0x482516e3)
83+
#define USING_ESP8266_CORE_VERSION 20601
84+
#define ESP8266_CORE_VERSION "ESP8266 core v2.6.1"
85+
#warning USING_ESP8266_CORE_VERSION "2.6.1"
86+
#elif (ARDUINO_ESP8266_GIT_VER == 0x643ec203)
87+
#define USING_ESP8266_CORE_VERSION 20600
88+
#define ESP8266_CORE_VERSION "ESP8266 core v2.6.0"
89+
#warning USING_ESP8266_CORE_VERSION "2.6.0"
90+
#elif (ARDUINO_ESP8266_GIT_VER == 0x8b899c12)
91+
#define USING_ESP8266_CORE_VERSION 20502
92+
#define ESP8266_CORE_VERSION "ESP8266 core v2.5.2"
93+
#warning USING_ESP8266_CORE_VERSION "2.5.2"
94+
#elif (ARDUINO_ESP8266_GIT_VER == 0x00000000)
95+
#define USING_ESP8266_CORE_VERSION 20402
96+
#define ESP8266_CORE_VERSION "ESP8266 core v2.4.2"
97+
#warning USING_ESP8266_CORE_VERSION "2.4.2"
98+
#elif (ARDUINO_ESP8266_GIT_VER == 0x643ec203)
99+
#define USING_ESP8266_CORE_VERSION 0
100+
#define ESP8266_CORE_VERSION "ESP8266 core too old"
101+
#warning USING_ESP8266_CORE_VERSION "0.0.0"
102+
#endif
103+
104+
//////////////////////////////////////////////
105+
// From v1.6.0 to display correct BLYNK_INFO_DEVICE
106+
107+
#define BLYNK_USE_128_VPINS
108+
109+
#if defined(BLYNK_INFO_DEVICE)
110+
#undef BLYNK_INFO_DEVICE
111+
#endif
112+
113+
#define BLYNK_BUFFERS_SIZE 4096
114+
115+
#if defined(BLYNK_INFO_DEVICE)
116+
#undef BLYNK_INFO_DEVICE
117+
#endif
118+
119+
#if defined(ARDUINO_BOARD)
120+
#define BLYNK_INFO_DEVICE ARDUINO_BOARD
121+
#elif defined(BOARD_NAME)
122+
#define BLYNK_INFO_DEVICE BOARD_NAME
123+
#elif defined(BOARD_TYPE)
124+
#define BLYNK_INFO_DEVICE BOARD_TYPE
125+
#else
126+
#define BLYNK_INFO_DEVICE "ESP8266"
127+
#endif
128+
129+
/////////////////////////////////////////////
130+
51131
#if ESP_SDK_VERSION_NUMBER < 0x020200
52132
#error Please update your ESP8266 Arduino Core
53133
#endif
@@ -2664,23 +2744,25 @@ class BlynkWifi
26642744

26652745
static int channel;
26662746
// Use random channel if WiFiAPChannel == 0
2667-
// Use random channel if WiFiAPChannel == 0
26682747
if (WiFiAPChannel == 0)
26692748
{
26702749
//channel = random(MAX_WIFI_CHANNEL) + 1;
26712750
channel = (millis() % MAX_WIFI_CHANNEL) + 1;
26722751
}
26732752
else
26742753
channel = WiFiAPChannel;
2754+
2755+
// KH, Must be here for ESP8266 core v3.0.0. Good for v2.7.4- and ESP32 as well
2756+
WiFi.softAPConfig(portal_apIP, portal_apIP, IPAddress(255, 255, 255, 0));
26752757

26762758
WiFi.softAP(portal_ssid.c_str(), portal_pass.c_str(), channel);
26772759

26782760
BLYNK_LOG4(BLYNK_F("\nstConf:SSID="), portal_ssid, BLYNK_F(",PW="), portal_pass);
26792761
BLYNK_LOG4(BLYNK_F("IP="), portal_apIP.toString(), ",ch=", channel);
26802762

2681-
delay(100); // ref: https://github.com/espressif/arduino-esp32/issues/985#issuecomment-359157428
2682-
WiFi.softAPConfig(portal_apIP, portal_apIP, IPAddress(255, 255, 255, 0));
2683-
2763+
IPAddress myIP = WiFi.softAPIP();
2764+
BLYNK_LOG2(BLYNK_F("AP IP address: "), myIP);
2765+
26842766
if (!server)
26852767
{
26862768
server = new AsyncWebServer(HTTP_PORT);

0 commit comments

Comments
 (0)