Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upESP8266.deepSleep(micros, option) to discuss #1102
Comments
This comment has been minimized.
This comment has been minimized.
Great, so I will create a PR in the next days |
This comment has been minimized.
This comment has been minimized.
@MaBecker this would be excellent!! I have been trying to get deepsleep of any kind working on esp8266... It keeps locking or needing a forced reset. Looking forward to your work! |
This comment has been minimized.
This comment has been minimized.
Hi @TrevorJTClarke, did you connect gpio16 to rest? I guess it is not part of of the reference, will plan to add this. |
This comment has been minimized.
This comment has been minimized.
Made a decision: I will add "bool system_deep_sleep_set_option(uint8 option)" as additional function |
This comment has been minimized.
This comment has been minimized.
@MaBecker thanks for the reply!! |
This comment has been minimized.
This comment has been minimized.
Yes |
This comment has been minimized.
This comment has been minimized.
@MaBecker working now! Appreciate the help! |
@gfwilliams please add ESP8266 and enhancement label.
Asking for a possible way to control power consumption on wakeup by adding a second parameter to ESP8266.deepSleep().
Any comment, suggestion or advise?
Call type:
ESP8266.deepSleep(micros, option)
Description
Put the ESP8266 into 'deep sleep' for the given number of microseconds, reducing power consumption drastically.
meaning of option values:
0 - the 108th Byte of init parameter decides whether RF calibration will be performed or not.
1 - run RF calibration after waking up. Power consumption is high.
2 - no RF calibration after waking up. Power consumption is low.
4 - no RF after waking up. Power consumption is the lowest.
Note: unlike normal Espruino boards' 'deep sleep' mode, ESP8266 deep sleep actually turns off the processor. After the given number of microseconds have elapsed, the ESP8266 will restart as if power had been turned off and then back on. All contents of RAM will be lost.
Special: 0 microseconds cause sleep forever until external wakeup RST pull down occurs.
Parameters
micros - Number of microseconds to sleep.
option - possible values are 0, 1, 2 or 4