Editing
esp
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===ESP.deepSleep()=== 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 <b>ESP.deepSleepMax()</b> 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. ;Steps to use the Deep-sleep mode: # Connect the module with the Wi-Fi AP # Perform a task like reading a sensor value, publishing an MQTT message, etc. # Sleep for a defined number of microseconds # Repeat the above process again Sleep time is defined in microseconds. According to the ESP8266 SDK, you can only sleep for 4,294,967,295 µs which is about ~71 minutes. Example: Serial.println("deep sleep for 15 seconds"); ESP.deepSleep(15e6); The system goes into Deep-sleep mode via the following interface: ESPdeepSleep(uint32 time_in_us) If time is == 0, then the chip won’t be woken up at regular intervals, i.e., won’t wake up automatically. ESP.dsleep(0) //Will cause the ESP to sleep forever. The mode WAKE_RF_DISABLED doesn't change how deep-sleep works, the mode changes what happens when the device wakes up. In deep-sleep WiFi is always off, no matter what mode you give it. WAKE_RF_DISABLED disables WiFi when you reset the device/it wakes up. {{template:toponly}}
Summary:
Please note that all contributions to Notebook may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Notebook:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Search
Navigation
Home Page
C++ Reference
ESP Hardware
ESPHome
Home Assistant
Network Stuff
Tools
What links here
Related changes
Special pages
Page information