You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/esp8266wifi/generic-class.rst
+27Lines changed: 27 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -35,13 +35,40 @@ A detailed explanation of ``WiFiEventHandler`` can be found in the section with
35
35
Alternatively, check the example sketch `WiFiEvents.ino <https://github.com/esp8266/Arduino/blob/master/libraries/ESP8266WiFi/examples/WiFiEvents/WiFiEvents.ino>`__ available in the examples folder of the ESP8266WiFi library.
36
36
37
37
38
+
.. _wifiOffAtBoot:
38
39
persistent
39
40
~~~~~~~~~~
40
41
41
42
.. code:: cpp
42
43
43
44
WiFi.persistent(persistent)
44
45
46
+
Starting from version 3 of this core, **persistence is disabled by default
47
+
and WiFi does not anymore automatically fires up at boot**.
48
+
49
+
(see PR `#7902 <https://github.com/esp8266/Arduino/pull/7902>`__).
50
+
51
+
Previously, SDK was automatically starting WiFi at boot. This was probably
52
+
intended for the Espressif AT FW which is interactive and preserves state
53
+
accross reboots. This behavior is generally irrelevant with the Arduino
54
+
API because sketches start with WiFi.begin() or softAP...
55
+
56
+
This change is harmless with standard sketches: Calls to
57
+
WiFi.mode()+WiFi.begin/WiFi.softAP(...) do enable radio as usual. It also
58
+
smooths current spikes at boot and also decrease DHCP stress.
59
+
60
+
Legacy behavior can be restored by calling `enableWiFiAtBoot()` anywhere in
61
+
the code (this is a weak void function intended to play with the linker).
62
+
63
+
.. code:: cpp
64
+
void setup () {
65
+
#ifdef WIFI_IS_OFF_AT_BOOT
66
+
enableWiFiAtBoot(); // can be called from anywhere with the same effect
67
+
#endif
68
+
....
69
+
}
70
+
71
+
When legacy behavior is restored thanks to this call,
45
72
ESP8266 is able to reconnect to the last used WiFi network or establishes the same Access Point upon power up or reset.
46
73
By default, these settings are written to specific sectors of flash memory every time they are changed in ``WiFi.begin(ssid, passphrase)`` or ``WiFi.softAP(ssid, passphrase, channel)``, and when ``WiFi.disconnect`` or ``WiFi.softAPdisconnect`` is invoked.
47
74
Frequently calling these functions could cause wear on the flash memory (see issue `#1054 <https://github.com/esp8266/Arduino/issues/1054>`__).
0 commit comments