Deepsleep not working anymore

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.
Post Reply
crizeo
Posts: 42
Joined: Sun Aug 06, 2017 12:55 pm
Location: Germany

Deepsleep not working anymore

Post by crizeo » Sun Jul 15, 2018 8:48 pm

Unfortunatly I updated to the newest micropython firmware and esp-open-sdk. After doing this, many things are not working anymore. How can I enter deepsleep mode and register WAKE pin to wake the device?

Previously I used this code, that made the ESP sleep forever (no 71min timelimit as I read on the forum) and could be woken up using WAKE pin...

Code: Select all

import machine
rtc = machine.RTC()
rtc.irq(trigger=rtc.ALARM0, wake=machine.DEEPSLEEP)
machine.deepsleep()
Now, when I execute the above code, the ESP prints a message "enter deep sleep". Then, I can't do anything. Only connecting RST pin to GND will wake the device. But when I run

Code: Select all

rtc.alarm(rtc.ALARM0, 10000)
before calling deepsleep, this will not wakeup the ESP after 10 seconds again (as described in docs), but really put it into deepsleep mode after 10 sec (so then wakeing is possible).

Is this the new way to do it? In the previous version setting up rtc.alarm() would lead to waking up again after 10 sec (as described in the docs).

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: Deepsleep not working anymore

Post by pythoncoder » Thu Jul 19, 2018 11:13 am

This does seem to be broken. I've raised an issue.
Peter Hinch
Index to my micropython libraries.

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Solution

Post by pythoncoder » Fri Jul 20, 2018 4:09 am

@Damien responded with:
Thanks for reporting. I'm pretty sure you need to connect pin 16 to the reset pin (RST) to be able to wake from deep sleep. On the ESP8266, pin 16 is connected to the RTC domain and must be externally wired to RST to fully reset the rest of the system (other MCUs would do this internally). I tried this and it works with the above code.
Peter Hinch
Index to my micropython libraries.

Post Reply