|
17 | 17 | @date Jan 2015
|
18 | 18 | @brief
|
19 | 19 |
|
20 |
| - Version: 1.5.0 |
| 20 | + Version: 1.6.0 |
21 | 21 |
|
22 | 22 | Version Modified By Date Comments
|
23 | 23 | ------- ----------- ---------- -----------
|
|
33 | 33 | Fix SSL issue with Blynk Cloud Server
|
34 | 34 | 1.4.1 K Hoang 24/04/2021 Fix issue of custom Blynk port (different from 8080 or 9443) not working on ESP32
|
35 | 35 | 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 |
36 | 37 | ********************************************************************************************************************************/
|
37 | 38 |
|
38 | 39 | #pragma once
|
|
44 | 45 | #error This code is intended to run on the ESP8266 platform! Please check your Tools->Board setting.
|
45 | 46 | #endif
|
46 | 47 |
|
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" |
48 | 49 |
|
49 | 50 | #include <version.h>
|
50 | 51 |
|
| 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 | + |
51 | 131 | #if ESP_SDK_VERSION_NUMBER < 0x020200
|
52 | 132 | #error Please update your ESP8266 Arduino Core
|
53 | 133 | #endif
|
@@ -2664,23 +2744,25 @@ class BlynkWifi
|
2664 | 2744 |
|
2665 | 2745 | static int channel;
|
2666 | 2746 | // Use random channel if WiFiAPChannel == 0
|
2667 |
| - // Use random channel if WiFiAPChannel == 0 |
2668 | 2747 | if (WiFiAPChannel == 0)
|
2669 | 2748 | {
|
2670 | 2749 | //channel = random(MAX_WIFI_CHANNEL) + 1;
|
2671 | 2750 | channel = (millis() % MAX_WIFI_CHANNEL) + 1;
|
2672 | 2751 | }
|
2673 | 2752 | else
|
2674 | 2753 | 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)); |
2675 | 2757 |
|
2676 | 2758 | WiFi.softAP(portal_ssid.c_str(), portal_pass.c_str(), channel);
|
2677 | 2759 |
|
2678 | 2760 | BLYNK_LOG4(BLYNK_F("\nstConf:SSID="), portal_ssid, BLYNK_F(",PW="), portal_pass);
|
2679 | 2761 | BLYNK_LOG4(BLYNK_F("IP="), portal_apIP.toString(), ",ch=", channel);
|
2680 | 2762 |
|
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 | + |
2684 | 2766 | if (!server)
|
2685 | 2767 | {
|
2686 | 2768 | server = new AsyncWebServer(HTTP_PORT);
|
|
0 commit comments