Library to deep sleep for days for esp8366

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.
User avatar
kfricke
Posts: 342
Joined: Mon May 05, 2014 9:13 am
Location: Germany

Re: Library to deep sleep for days for esp8266

Post by kfricke » Thu Jun 22, 2017 9:46 am

pythoncoder wrote:
kfricke wrote:This Espressif link claims 10μA. Is this not achievable?
Sure it is, but i have not seen that many boards with nearly down to no power draining components. The Wemos Mini might be different and at least hours of sleep time can negate the time of high power usage when the MCU us acitve and using WIFI.

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

Re: Library to deep sleep for days for esp8366

Post by pythoncoder » Thu Jun 22, 2017 10:56 am

Fair point. This rules out any board with a USB interface. The Adafruit Huzzah looks promising, though https://learn.adafruit.com/adafruit-huz ... /downloads. Assuming the pins with resistors go hi-z on sleep there's not much there to use power. The regulator takes 80μA max (55μA typical) which (based on max) gives ~800mA/H for a year's operation - plus whatever is required to actually do something useful ;)
Peter Hinch
Index to my micropython libraries.

crizeo
Posts: 42
Joined: Sun Aug 06, 2017 12:55 pm
Location: Germany

Re: Library to deep sleep for days for esp8366

Post by crizeo » Sat Jul 14, 2018 1:47 pm

Does anyone know if long sleeping times are a problem even if you are not setting rtc.alarm?

So e.g. if you run this code to put the ESP8266 to deepsleep mode, will it wakeup automatically after some time (e.g. 71 min) without connecting RST to GND/Pin16?

Code: Select all

import machine
rtc = machine.RTC()
rtc.irq(trigger=rtc.ALARM0, wake=machine.DEEPSLEEP)
### rtc.alarm(rtc.ALARM0, 10000)  ! don't do this, only hard wakeups allowed

newb
Posts: 43
Joined: Wed Jan 10, 2018 8:19 pm
Location: Bulgaria

Re: Library to deep sleep for days for esp8366

Post by newb » Mon Dec 10, 2018 7:36 am

I know the library is a bit old, but it seems line 53 of hourlysleeper.py:

Code: Select all

esp.deepsleep(1000000 * duration)
doesn't do anything. The ESP resets without going to deep sleep. I'm not sure why.
I had to replace it with the rtc.ALARM approach to get the long hours sleep working.

Post Reply