Hi,
I have an esp8266 running micropython v1.9.3 , I'm trying to work with the deep sleep and it work, but also if I have a connection between reset and GPIO16, using the script like the example in the documentation, the chip go in sleep mode but I can wake it only with a reset to gnd.
Seems alarm0 don't work properly.
what is wrong?
thanks
esp8266 won't wake from sleep
Re: esp8266 won't wake from sleep
Hello, please post the code to see what can go wrong
Re: esp8266 won't wake from sleep
Hi,
this one from the documentation:
this one from the documentation:
Code: Select all
import machine
# configure RTC.ALARM0 to be able to wake the device
rtc = machine.RTC()
rtc.irq(trigger=rtc.ALARM0, wake=machine.DEEPSLEEP)
# check if the device woke from a deep sleep
if machine.reset_cause() == machine.DEEPSLEEP_RESET:
print('woke from a deep sleep')
# set RTC.ALARM0 to fire after 10 seconds (waking the device)
rtc.alarm(rtc.ALARM0, 10000)
# put the device to sleep
machine.deepsleep()
Re: esp8266 won't wake from sleep
I disconnect gpio16 when I flash and reconnect after flashing.
when I use this script the device go to sleep but wake up only with manual reset
when I use this script the device go to sleep but wake up only with manual reset
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: esp8266 won't wake from sleep
How are you checking for the awake message? If you're connected via USB it's very likely that the USB interface remains down after the board wakes. I would expect the code sample only to work on a serial connected device (e.g Adafruit Huzzah rather than the Feather series).
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.
Re: esp8266 won't wake from sleep
Ho,
I have a led to a gpio that turn on for ten seconds in the main.py file after boot file, after this time start a script with the sleep function, so if the awake do a reset, I believe I can see the led on after wake, but it turn on only if I do a manual reset.
I’m using an esp8266 with a usb to serial, not a board, but it’s the same .
There’s maybe some issue in firmware version?
After the flash i connect gpio 16 to rst pin ( i have 10 sec to do it!) , the device go in sleep ( i can see with serial garbage after the print message in the script, but the led stay off.
Thanks
I have a led to a gpio that turn on for ten seconds in the main.py file after boot file, after this time start a script with the sleep function, so if the awake do a reset, I believe I can see the led on after wake, but it turn on only if I do a manual reset.
I’m using an esp8266 with a usb to serial, not a board, but it’s the same .
There’s maybe some issue in firmware version?
After the flash i connect gpio 16 to rst pin ( i have 10 sec to do it!) , the device go in sleep ( i can see with serial garbage after the print message in the script, but the led stay off.
Thanks
Re: esp8266 won't wake from sleep[SOLVED]
Hi,
I’ve found the problem: power source.
I’m using esp8266 only with resistor and cap and with an external usbtoserial converter, no nodemcu or huzzah board.
When I power device with a strong power source and not from vcc of usb, wake normally, and it’s no problem, I can see the serial message anywhere.
Thanks
I’ve found the problem: power source.
I’m using esp8266 only with resistor and cap and with an external usbtoserial converter, no nodemcu or huzzah board.
When I power device with a strong power source and not from vcc of usb, wake normally, and it’s no problem, I can see the serial message anywhere.
Thanks
Re: esp8266 won't wake from sleep
hi
I have this problem too
change power source did not solve it
use usb power or battery power it will not wake up too
I have this problem too
change power source did not solve it
use usb power or battery power it will not wake up too
Re: esp8266 won't wake from sleep
抱歉 我的英文是如此的匮乏,表达不来下面的意思
之前,我在程序启动时候初始化rtc 然后设置关于deepsleep的参数
rtc.irq(trigger=rtc.ALARM0, wake=machine.DEEPSLEEP)
rtc.alarm(rtc.ALARM0, deep_sleep_time)
这种情况下,在进入deepsleep之后不会醒来
但是当我把上面两行放到了程序结尾,在他后面就是
machine.deepsleep()
他顺利的工作了
之前,我在程序启动时候初始化rtc 然后设置关于deepsleep的参数
rtc.irq(trigger=rtc.ALARM0, wake=machine.DEEPSLEEP)
rtc.alarm(rtc.ALARM0, deep_sleep_time)
这种情况下,在进入deepsleep之后不会醒来
但是当我把上面两行放到了程序结尾,在他后面就是
machine.deepsleep()
他顺利的工作了