-->
Page 1 of 1

Sleep (not deepsleep?)

PostPosted: Wed Aug 26, 2015 8:45 am
by Sifourquier
Hi
For a project I need run code every 100ms and send data on wifi every minute.
The deepsleep take ~ 400ms to wakeup an go sleep and take high power in wekeup time. I don't can use deepsleep

Then i will use a sleep and not deepsleep but I have test

Code: Select allvoid user_rf_pre_init(void)
{
   system_phy_set_rfoption(4); //don't run RF
}

and
Code: Select allwifi_set_sleep_type(LIGHT_SLEEP_T ); in user_init


The power consumption are 12mA
But in this document he say we can have less of 1mA
https://nurdspace.nl/images/e/e0/ESP826 ... nglish.pdf

I have also test
while(1)
asm("WAITI 1\n"); //asm instruction for xtensa sleep
but after i have 70mA

Are you a idée for réducte to 1mA?

(in deep sleep I have <1mA and if I manualy stop the quartz by set a pad on gnd I have <1mA)

Re: Sleep (not deepsleep?)

PostPosted: Wed Aug 26, 2015 11:34 am
by lalo_uy
As far as I know you can not change the rf on/rf off but on reset after deep sleep.

Re: Sleep (not deepsleep?)

PostPosted: Thu Aug 27, 2015 10:35 pm
by willfly
Code: Select allwifi_set_sleep_type(LIGHT_SLEEP_T );

will reduce sleep current for the period ESP8266 is sleeping. It will wake up periodically (every few ms) and do its wifi housekeeping, process interrupts etc and go back to sleep. When awake and doing wifi etc, current draw is 60-70 mA. Deepsleep is the only user controlled API.

Also light sleep will not kick in if:
- ESP is not in station mode
- not connected to an AP
- user loop executes faster then wifi beacon interval