-->
Page 1 of 1

node.sleep() again - returning immediately

PostPosted: Sat May 12, 2018 3:27 pm
by lyakh
Hi,
I've searched forums and other sources and haven't found any solution so far: I'm trying to put my NodeMCU into the light sleep mode to be woken up by a GPIO, I enabled TIMER_SUSPEND_ENABLE and PMSLEEP_ENABLE, rebuilt and flashed the firmware, but calling node.sleep() returns immediately. I tried both the "master" and the "dev" branches of the firmware. I traced the sleep down to the ets_timer_arm_new() function in ESP libraries, but that function seems only to arm a new timer, but I don't see it actually putting the CPU to sleep? What am I missing?

Re: node.sleep() again - returning immediately

PostPosted: Mon Jun 25, 2018 2:50 pm
by marcelstoer
You did follow the instructions in the API docs at http://nodemcu.readthedocs.io/en/latest ... #nodesleep, right?

Re: node.sleep() again - returning immediately

PostPosted: Mon Jun 25, 2018 3:05 pm
by Bonzo
Are you using the correct time format as sleep uses microseconds and not milliseconds so you could be a factor of 1000 out?

Re: node.sleep() again - returning immediately

PostPosted: Sat Jul 07, 2018 7:20 am
by lyakh
Replying to both comments: I did follow instructions, yes. And the timeout is irrelevant, because I was trying to wake up on a GPIO interrupt.