-->
Page 1 of 2

Esp8266-7 deep sleep variable

PostPosted: Tue Feb 11, 2020 9:48 pm
by txsrooster
I am trying to write a code that uses a variable for deep sleep. I want to be able to change the deep sleep duration remotely depending on sensor data. basically it is just

Code: Select alllong sleepTime = 60000
ESP.deepSleep (sleepTime);


This should put the ESP into deep sleep for 1 min, but it basically just goes into deep sleep and immediately wakes up and reconnects then wash, rinse, repeat.
Is the ESP capable of utilizing a variable for the deep sleep duration?

Re: Esp8266-7 deep sleep variable

PostPosted: Wed Feb 12, 2020 12:57 pm
by schufti
Deepsleep duration is us not ms, so you are off a factor 1000

Re: Esp8266-7 deep sleep variable

PostPosted: Wed Feb 12, 2020 1:30 pm
by txsrooster
schufti wrote:Deepsleep duration is us not ms, so you are off a factor 1000

Oh. Thanks for the info. Still trying to find out if the deep sleep can use a variable to determine duration.

Re: Esp8266-7 deep sleep variable

PostPosted: Fri Feb 14, 2020 5:33 pm
by pipi61