File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -64,6 +64,9 @@ void GoToSleep()
6464 );
6565 Serial.flush ();
6666
67+ WiFi.disconnect (true );
68+ delay (1 );
69+
6770 IrDisable ();
6871 VanBusRx.Disable ();
6972
Original file line number Diff line number Diff line change @@ -331,6 +331,10 @@ void setup()
331331 digitalWrite (LED_BUILTIN , LED_OFF );
332332 #endif
333333
334+ WiFi.mode (WIFI_OFF );
335+ WiFi.forceSleepBegin ();
336+ delay (1 );
337+
334338 md5Checksum = ESP .getSketchMD5 ();
335339
336340 SetupSleep ();
@@ -537,4 +541,6 @@ void loop()
537541 VanBusRx.DumpStats (Serial);
538542 } // if
539543 #endif // SHOW_VAN_RX_STATS
544+
545+ delay (9 );
540546} // loop
Original file line number Diff line number Diff line change @@ -168,6 +168,12 @@ const char* SetupWifi()
168168
169169 static const char * wifiSsid = WIFI_SSID ;
170170
171+ WiFi.forceSleepWake ();
172+ delay (1 );
173+
174+ // Disable the WiFi persistence. The ESP8266 will not load and save WiFi settings in the flash memory.
175+ WiFi.persistent (false );
176+
171177 #ifdef WIFI_AP_MODE
172178
173179 #ifdef ON_DESK_MFD_ESP_MAC
@@ -224,7 +230,6 @@ const char* SetupWifi()
224230
225231 WiFi.mode (WIFI_STA ); // Otherwise it may be in WIFI_AP_STA mode, broadcasting an SSID like AI_THINKER_XXXXXX
226232 WiFi.disconnect (); // After reset via HW button sometimes cannot seem to reconnect without this
227- WiFi.persistent (false );
228233 #ifdef ARDUINO_ARCH_ESP32
229234 #if ESP_ARDUINO_VERSION >= ESP_ARDUINO_VERSION_VAL(3, 0, 0)
230235 WiFi.setAutoReconnect (true );
You can’t perform that action at this time.
0 commit comments