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

ESP8266.deepSleep(micros, option) to discuss #1102

Closed
MaBecker opened this issue Mar 5, 2017 · 8 comments
Closed

ESP8266.deepSleep(micros, option) to discuss #1102

MaBecker opened this issue Mar 5, 2017 · 8 comments

Comments

@MaBecker
Copy link
Contributor

@MaBecker MaBecker commented Mar 5, 2017

@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

@MaBecker

This comment has been minimized.

Copy link
Contributor Author

@MaBecker MaBecker commented Mar 17, 2017

Great, so I will create a PR in the next days

@TrevorJTClarke

This comment has been minimized.

Copy link

@TrevorJTClarke TrevorJTClarke commented Mar 17, 2017

@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!

@MaBecker

This comment has been minimized.

Copy link
Contributor Author

@MaBecker MaBecker commented Mar 17, 2017

Hi @TrevorJTClarke,

did you connect gpio16 to rest?

I guess it is not part of of the reference, will plan to add this.

@MaBecker

This comment has been minimized.

Copy link
Contributor Author

@MaBecker MaBecker commented Mar 17, 2017

Made a decision:

I will add "bool system_deep_sleep_set_option(uint8 option)" as additional function

@TrevorJTClarke

This comment has been minimized.

Copy link

@TrevorJTClarke TrevorJTClarke commented Mar 17, 2017

@MaBecker thanks for the reply!!
No, i didn't realize I needed to do this! Is there documentation somewhere about this? Im not familiar enough with the esp side of things i suppose.
So if i connect 16 to reset, it should allow for ESP8266.deepSleep(micros) correct? (I understand the second param is the discussion here).

@MaBecker

This comment has been minimized.

Copy link
Contributor Author

@MaBecker MaBecker commented Mar 17, 2017

So if i connect 16 to reset, it should allow for ESP8266.deepSleep(micros) correct?

Yes

@TrevorJTClarke

This comment has been minimized.

Copy link

@TrevorJTClarke TrevorJTClarke commented Mar 17, 2017

@MaBecker working now! Appreciate the help!

@MaBecker

This comment has been minimized.

Copy link
Contributor Author

@MaBecker MaBecker commented Apr 18, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.