Skip to content

Commit c15cb5d

Browse files
committed
doc
1 parent 7fd4116 commit c15cb5d

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

doc/esp8266wifi/generic-class.rst

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,40 @@ A detailed explanation of ``WiFiEventHandler`` can be found in the section with
3535
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.
3636

3737

38+
.. _wifiOffAtBoot:
3839
persistent
3940
~~~~~~~~~~
4041

4142
.. code:: cpp
4243
4344
WiFi.persistent(persistent)
4445
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,
4572
ESP8266 is able to reconnect to the last used WiFi network or establishes the same Access Point upon power up or reset.
4673
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.
4774
Frequently calling these functions could cause wear on the flash memory (see issue `#1054 <https://github.com/esp8266/Arduino/issues/1054>`__).

doc/faq/readme.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,3 +177,9 @@ will need to implement an additional (short) deep sleep using
177177
``WAKE_RF_DEFAULT``.
178178

179179
Ref. `#3072 <https://github.com/esp8266/Arduino/issues/3072>`__
180+
181+
My WiFi was previously automatically connected wight after booting
182+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
183+
184+
This was WiFi persistence. WiFi is now indeed off at boot and is powered on
185+
only when using the regular API. Read more at :ref:`wifiOffAtBoot`.

0 commit comments

Comments
 (0)