Skip to content

Commit 586f39e

Browse files
authored
[WiFi] Disable wifi initialization at boot
See: - esp8266/Arduino#2111 - https://github.com/esp8266/Arduino/pull/5395/files Hopefully it will help for modules which have a hard time to connect to WiFi, which may be caused by weak power supply. It will also not start unintended DHCP-client services which lead to strange issues when using static IP configuration. Tests should reveal if it will also help to lessen the chaos which may happen now the 'May deal' is off, so please perform some tests and we'll see the coming days. At least it will save some peak power at startup.
1 parent f973bef commit 586f39e

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/ESPEasy.ino

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,19 @@ int firstEnabledBlynkController() {
103103

104104
//void checkRAM( const __FlashStringHelper* flashString);
105105

106+
#ifdef CORE_2_5_0
107+
/*********************************************************************************************\
108+
* Pre-init
109+
\*********************************************************************************************/
110+
void preinit() {
111+
// Global WiFi constructors are not called yet
112+
// (global class instances like WiFi, Serial... are not yet initialized)..
113+
// No global object methods or C++ exceptions can be called in here!
114+
//The below is a static class method, which is similar to a function, so it's ok.
115+
ESP8266WiFiClass::preinitWiFiOff();
116+
}
117+
#endif
118+
106119
/*********************************************************************************************\
107120
* SETUP
108121
\*********************************************************************************************/

0 commit comments

Comments
 (0)