Skip to content

Commit 27ef03f

Browse files
authored
Add documentation on recovering from deep sleep with WAKE_RF_DISABLED (esp8266#7338)
* Clarify how to enable WiFi after DeepSleep * Add FAQ item for recovering from DeepSleep * Reference issue * Update issue URL
1 parent 0d43338 commit 27ef03f

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

doc/faq/readme.rst

+14-2
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ For reference:
136136

137137
Time-wait PCB state helps TCP not confusing two consecutive connections with the
138138
same (s-ip,s-port,d-ip,d-port) when the first is already closed but still
139-
having duplicate packets lost in internet arriving later during the second.
139+
having duplicate packets lost in internet arriving later during the second.
140140
Artificially clearing them is a workaround to help saving precious heap.
141141

142142
The following lines are compatible with both lwIP versions:
@@ -147,7 +147,7 @@ The following lines are compatible with both lwIP versions:
147147
struct tcp_pcb;
148148
extern struct tcp_pcb* tcp_tw_pcbs;
149149
extern "C" void tcp_abort (struct tcp_pcb* pcb);
150-
150+
151151
void tcpCleanup (void) {
152152
while (tcp_tw_pcbs)
153153
tcp_abort(tcp_tw_pcbs);
@@ -168,3 +168,15 @@ This script is also used to manage uncommon options that are currently not
168168
available in the IDE menu.
169169

170170
`Read more <a05-board-generator.rst>`__.
171+
172+
My WiFi won't reconnect after deep sleep using ``WAKE_RF_DISABLED``
173+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
174+
175+
When you implement deep sleep using ``WAKE_RF_DISABLED``, this forces what
176+
appears to be a bare metal disabling of WiFi functionality, which is not
177+
restored using ``WiFi.forceSleepWake()`` or ``WiFi.mode(WIFI_STA)``. If you need
178+
to implement deep sleep with ``WAKE_RF_DISABLED`` and later connect to WiFi, you
179+
will need to implement an additional (short) deep sleep using
180+
``WAKE_RF_DEFAULT``.
181+
182+
Ref. `#3072 <https://github.com/esp8266/Arduino/issues/3072>`__

doc/libraries.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ SPI
4141

4242
SPI library supports the entire Arduino SPI API including transactions, including setting phase (CPHA). Setting the Clock polarity (CPOL) is not supported, yet (SPI\_MODE2 and SPI\_MODE3 not working).
4343

44-
The usual SPI pins are:
44+
The usual SPI pins are:
4545

4646
- ``MOSI`` = GPIO13
4747
- ``MISO`` = GPIO12
@@ -73,7 +73,7 @@ ESP-specific APIs
7373

7474
Some ESP-specific APIs related to deep sleep, RTC and flash memories are available in the ``ESP`` object.
7575

76-
``ESP.deepSleep(microseconds, mode)`` will put the chip into deep sleep. ``mode`` is one of ``WAKE_RF_DEFAULT``, ``WAKE_RFCAL``, ``WAKE_NO_RFCAL``, ``WAKE_RF_DISABLED``. (GPIO16 needs to be tied to RST to wake from deepSleep.) The chip can sleep for at most ``ESP.deepSleepMax()`` microseconds.
76+
``ESP.deepSleep(microseconds, mode)`` will put the chip into deep sleep. ``mode`` is one of ``WAKE_RF_DEFAULT``, ``WAKE_RFCAL``, ``WAKE_NO_RFCAL``, ``WAKE_RF_DISABLED``. (GPIO16 needs to be tied to RST to wake from deepSleep.) The chip can sleep for at most ``ESP.deepSleepMax()`` microseconds. If you implement deep sleep with ``WAKE_RF_DISABLED`` and require WiFi functionality on wake up, you will need to implement an additional ``WAKE_RF_DEFAULT`` before WiFi functionality is available.
7777

7878
``ESP.deepSleepInstant(microseconds, mode)`` works similarly to ``ESP.deepSleep`` but sleeps instantly without waiting for WiFi to shutdown.
7979

0 commit comments

Comments
 (0)