Search code examples
esp8266nodemcu

ESP8266 not waking up?


i have been playing around with my ESP8266 devkit board and i have found some strange results, the module when put to sleep NEVER wakes up unless restarted. although specified in the documentation here that it can be done. I have modified the line needed but i found something strange that it only said to comment out 1 line regarding PMSLEEP_ENABLE when doing that the module refused until i commented out another line TIMER_SUSPEND_ENABLE which i noticed the comment beside at first but thought to follow the instructions of the makers.

now however trying to put the module to sleep is not working , everytime the module goes to sleep with int_type property set to node.INT_BOTH, the module wouldnt wake up unless i restart it via switch on the board. so for a workaound i would put the module to sleep with the int_type property set to node.LOW or node.High however neither of them work, the module does go to sleep briefly i can see the current dropping then the module just restarts with a watchdog timer reset.

any ideas for reliable ways to put the module to sleep ? or am i just doing something wrong that i completely missed?

sorry for my bad English but i hope i explained it well enough.

EDIT

Further debugging i found out that i cannot use the same pin in my programming and at the same time use that same pin to wake the module up , meaning if i have a sensor connected to pinX and use the change value function to wake up the module and this same pinX i am using somewhere else in my code with interrupts whatsoever then it wont work , what i did as a workaround for that is use a different pin and use the same output from my switch to wake the module up, this however can only be done through levels as when the module sleeps it does not detect at all the rising and falling edges.


Solution

  • Turns out even re initializing the port doesnt change the intialization, thus as a workaround , a new port must be used just to wake and sleep the module which is strange since if i re initialized the port using the appropriate lines it still wont change the mode as far as i understand through debugging