Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

How set esp8266 in light sleep mode?

 
Post new topic   Reply to topic    www.mcselec.com Forum Index -> Various
View previous topic :: View next topic  
Author Message
krolikbest

Bascom Member



Joined: 02 Jan 2017
Posts: 74

poland.gif
PostPosted: Sun Dec 27, 2020 10:11 pm    Post subject: How set esp8266 in light sleep mode? Reply with quote

Hi,
perhaps a little off-topic, so then I'm sorry. Now I'm working on communicating PC-esp8266-uC. All commands between uC and esp8266 are as AT commands included in Bascom code on uC side. There is no issues. But lately I came to idea of using battery instead of regular power. The problem is now that esp8266 has a reall big power's consumption. Ok, I've found one of three sleep modes- Light Sleep mode. The advantage of this mode is that I can wake esp8266 up from one of his GPIO's - lets say one of uC's pin set to high for a while then low and should work:) Unfortunately it is not so simply to set it in sleep mode. So far I did:
-in Bascom code I send to esp8266 some config and in the 6th line I define which gpio's pint is to wake esp8266 up and then in last line I expected that esp8266 should go into light sleep mode. But nothing like that happens.
Code:

Wait 1
Print "AT+CIPMUX=1"
Wait 1
Print "AT+CIPSERVER=1,80"
Wait 1
Print "AT+WAKEUPGPIO=1,0,1"
Wait 1
Print "AT+SLEEP=1"
 

Form the espressif api I got procedures but they don't correspond to using AT commands. So maybe someone has an idea how with AT commands set esp8266 in light sleep mode?

Regards,



(BASCOM-AVR version : 2.0.8.2 , Latest : 2.0.8.3 )
Back to top
View user's profile
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 5157
Location: Holland

blank.gif
PostPosted: Mon Dec 28, 2020 10:47 am    Post subject: Reply with quote

this chip is not suited for very low power. for a design i used a fet switch to turn the esp on/off. but of course it depends on your design if that will work or not.
_________________
Mark
Back to top
View user's profile Visit poster's website
krolikbest

Bascom Member



Joined: 02 Jan 2017
Posts: 74

poland.gif
PostPosted: Mon Dec 28, 2020 4:07 pm    Post subject: Reply with quote

Thank you for the response. I considered something similar but having so much ahead to write on RaspPi and uC I gave this idea up (I consider myself more a programmer than electronic engineer). But checked light-sleep mode once again and it seems to work - at beginning I send the previous code form uC and then esp8266 goes into sleep mode if GPIO0 pin is low and wakes up if this pin goes high and then as long as this pin is high esp8266 works. GPIO0 is controlled from one of uC's pins.

Regards,
Back to top
View user's profile
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 5157
Location: Holland

blank.gif
PostPosted: Tue Dec 29, 2020 1:43 pm    Post subject: Reply with quote

all depends on what you find acceptable for the power consumption. for the application i had the esp was off most of the time and every uA counted.
_________________
Mark
Back to top
View user's profile Visit poster's website
krolikbest

Bascom Member



Joined: 02 Jan 2017
Posts: 74

poland.gif
PostPosted: Wed Dec 30, 2020 2:54 pm    Post subject: Reply with quote

What i've noticed that not always it works (my previous description light-sleep). Don't know why. Anyhow yesterday I've bought esp8266-12 and it has reset pin set out on pcb. Tested At command "AT+GSLP=<time>" and after this time connected for short time RST to GND in order to wake it up. Works well so far.
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    www.mcselec.com Forum Index -> Various All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum