Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add documentation on recovering from deep sleep with WAKE_RF_DISABLED #7338

Merged
merged 5 commits into from
May 29, 2020
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions doc/faq/readme.rst
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ For reference:

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

The following lines are compatible with both lwIP versions:
Expand All @@ -147,7 +147,7 @@ The following lines are compatible with both lwIP versions:
struct tcp_pcb;
extern struct tcp_pcb* tcp_tw_pcbs;
extern "C" void tcp_abort (struct tcp_pcb* pcb);

void tcpCleanup (void) {
while (tcp_tw_pcbs)
tcp_abort(tcp_tw_pcbs);
Expand All @@ -168,3 +168,15 @@ This script is also used to manage uncommon options that are currently not
available in the IDE menu.

`Read more <a05-board-generator.rst>`__.

My WiFi won't reconnect after deep sleep using ``WAKE_RF_DISABLED``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

When you implement deep sleep using ``WAKE_RF_DISABLED``, this forces what
appears to be a bare metal disabling of WiFi functionality, which is not
restored using ``WiFi.forceSleepWake()`` or ``WiFi.mode(WIFI_STA)``. If you need
to implement deep sleep with ``WAKE_RF_DISABLED`` and later connect to WiFi, you
will need to implement an additional (short) deep sleep using
``WAKE_RF_DEFAULT``.

Ref. `#3072 <https://github.com/esp8266/Arduino/issues/3072>`__
4 changes: 2 additions & 2 deletions doc/libraries.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ SPI

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).

The usual SPI pins are:
The usual SPI pins are:

- ``MOSI`` = GPIO13
- ``MISO`` = GPIO12
Expand Down Expand Up @@ -73,7 +73,7 @@ ESP-specific APIs

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

``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.
``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.

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

Expand Down