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
[BREAKING] Disable WiFi at boot by default (#7902)
* Disable WiFi at boot by default
* +define WIFI_IS_OFF_AT_BOOT
* remove now useless example
* mv enableWiFiAtBootTime() to core_esp8266_features.h
* sync with master
* per @earlephilhower review: a file was missing
* doc
* WiFi persistence is now false by default
* fix doc
* ditto
* doc: remove sphinx warnings (fix links and formatting)
* fix link name
* fix doc
* legacy: restore persistence
* undeprecate preinit()
* move force modem up to when mode has changed (per @mcspr review)
* do not wake up from sleep when mode if OFF
* fix doc per review
Copy file name to clipboardExpand all lines: doc/esp8266wifi/generic-class.rst
+27
Original file line number
Diff line number
Diff line change
@@ -42,6 +42,33 @@ persistent
42
42
43
43
WiFi.persistent(persistent)
44
44
45
+
Starting from version 3 of this core, **persistence is disabled by default
46
+
and WiFi does not start automatically at boot** (see PR `#7902 <https://github.com./esp8266/Arduino/pull/7902>`__).
47
+
48
+
Previously, SDK was automatically starting WiFi at boot. This was probably
49
+
intended for the Espressif AT FW which is interactive and preserves WiFi
50
+
state accross reboots. This behavior is generally irrelevant with the
51
+
Arduino API because sketches start with ``WiFi.begin()`` or
52
+
``WiFi.softAP()``.
53
+
54
+
This change is harmless with standard sketches: Calls to ``WiFi.mode()`` do
55
+
enable radio as usual. It also smooths current spikes at boot and decreases
56
+
DHCP stress.
57
+
58
+
Legacy behavior can be restored by calling ``enableWiFiAtBootTime()`` from
59
+
anywhere in the code (it is a weak void function intended to play with the
60
+
linker).
61
+
62
+
.. code:: cpp
63
+
64
+
void setup () {
65
+
#ifdef WIFI_IS_OFF_AT_BOOT
66
+
enableWiFiAtBootTime(); // 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>`__).
Copy file name to clipboardExpand all lines: doc/libraries.rst
+1-1
Original file line number
Diff line number
Diff line change
@@ -87,7 +87,7 @@ Some ESP-specific APIs related to deep sleep, RTC and flash memories are availab
87
87
88
88
``ESP.getHeapFragmentation()`` returns the fragmentation metric (0% is clean, more than ~50% is not harmless)
89
89
90
-
``ESP.getMaxFreeBlockSize()`` returns the largest contiguous free RAM block in the heap, useful for checking heap fragmentation. **NOTE:** Maximum ``malloc()``able block will be smaller due to memory manager overheads.
90
+
``ESP.getMaxFreeBlockSize()`` returns the largest contiguous free RAM block in the heap, useful for checking heap fragmentation. **NOTE:** Maximum ``malloc()`` -able block will be smaller due to memory manager overheads.
91
91
92
92
``ESP.getChipId()`` returns the ESP8266 chip ID as a 32-bit integer.
Copy file name to clipboardExpand all lines: doc/ota_updates/readme.rst
+1-1
Original file line number
Diff line number
Diff line change
@@ -161,7 +161,7 @@ If signing is desired, sign the gzip compressed file *after* compression.
161
161
Updating apps in the field to support compression
162
162
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
163
163
164
-
If you have applications deployed in the field and wish to update them to support compressed OTA uploads, you will need to first recompile the application, then _upload the uncompressed `.bin` file once_. Attempting to upload a `gzip` compressed binary to a legacy app will result in the Updater rejecting the upload as it does not understand the `gzip` format. After this initial upload, which will include the new bootloader and `Updater` class with compression support, compressed updates can then be used.
164
+
If you have applications deployed in the field and wish to update them to support compressed OTA uploads, you will need to first recompile the application, then _upload the uncompressed `.bin` file once. Attempting to upload a `gzip` compressed binary to a legacy app will result in the Updater rejecting the upload as it does not understand the `gzip` format. After this initial upload, which will include the new bootloader and `Updater` class with compression support, compressed updates can then be used.
0 commit comments