deep sleep problem need help

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.
Post Reply
moetaz
Posts: 39
Joined: Sun Oct 31, 2021 11:33 am

deep sleep problem need help

Post by moetaz » Sun Nov 07, 2021 3:50 pm

hello
i building esp8266 with breakout board logger

i use the RTC to adjust logging time and date

i try to use this function to implement the deep sleep mode
def deep_sleep(msecs):
rt = machine.RTC()
rt.irq(trigger=rtc.ALARM0, wake=machine.DEEPSLEEP)
rt.alarm(rtc.ALARM0, msecs)
machine.deepsleep()

the system before deep sleep use 74 mA
but after enter un deep sleep and try to walk up
the power consumption go to be 32 mA
and the system going to freeze
i connect RST with GPIO 16
also the RST is connected from the board itself to VCC with res 10 K

and suggestion to how to solve this

User avatar
Roberthh
Posts: 3668
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: deep sleep problem need help

Post by Roberthh » Mon Nov 08, 2021 9:16 pm

I tried this command sequence with my Wemos D1 Mini, and it works well. The device comes up properly after deep sleep. Commands used (just yours):
import machine
rtc= machine.RTC()
rtc.irq(trigger=rtc.ALARM0, wake=machine.DEEPSLEEP)
rtc.alarm(rtc.ALARM0, 30000)
machine.deepsleep()

moetaz
Posts: 39
Joined: Sun Oct 31, 2021 11:33 am

Re: deep sleep problem need help

Post by moetaz » Tue Nov 09, 2021 12:06 am

when i try to do this code
this is the result
rr$r$ and some symbol not can copy it
and the esp8266 freeze

please note
i use it without any support board so i direct connect GPIO 16 to RST

i think the issue is hardware or it need some resistor or something like this

what you suggest

User avatar
Roberthh
Posts: 3668
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: deep sleep problem need help

Post by Roberthh » Tue Nov 09, 2021 7:18 am

In addition to the Pull-up at Reset you need at least a pull-up at GPIO0. With GPIO0 low at Reset the device will go into bootloader mode. Pull-Up Resistors at GPIO2, EN are helpful as well, and a pull-down at GPIO15. The EN pin can be used to switch the device on/off.

moetaz
Posts: 39
Joined: Sun Oct 31, 2021 11:33 am

Re: deep sleep problem need help

Post by moetaz » Tue Nov 09, 2021 2:12 pm

i do all but still the same issue

i think the problem come from pin 16
the negative pulse is too short so it doesn't make the rst down

User avatar
Roberthh
Posts: 3668
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: deep sleep problem need help

Post by Roberthh » Tue Nov 09, 2021 2:49 pm

It works with my ESP8266. How long is the Reset pulse? You could add a 100nF capacitor between reset and GND. That extends the pulse a little bit.

moetaz
Posts: 39
Joined: Sun Oct 31, 2021 11:33 am

Re: deep sleep problem need help

Post by moetaz » Tue Nov 09, 2021 8:23 pm

capacitor idea not working

i think about transistor that can work on the negative pulse from gpio16
so will connect rst to gnd direct

do have idea about this transistor

User avatar
Roberthh
Posts: 3668
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: deep sleep problem need help

Post by Roberthh » Tue Nov 09, 2021 8:42 pm

A single transistor will not work. And it would not extend the pulse width.
I'm still wondering why the GPIO16 to RST connection does not work. Do you have any tool to measure the existence and length of the pulse? A simpe 10$ logic analyzer would be suitable for that.

moetaz
Posts: 39
Joined: Sun Oct 31, 2021 11:33 am

Re: deep sleep problem need help

Post by moetaz » Tue Nov 09, 2021 10:21 pm

i found this issue with a lot of user especially with esp produced from espressif Co.
but with ESp from AI co. deep sleep work
i will post this discussion

but at the moment hard rest work with chip , deep sleep not walk up the chip

so i try to find cheap solution to reduce the power consumption

that why i go to transistor to test

do you have any other advice

moetaz
Posts: 39
Joined: Sun Oct 31, 2021 11:33 am

Re: deep sleep problem need help

Post by moetaz » Tue Nov 09, 2021 10:25 pm

also may be the function machine.deepsleep() need amendment

and i don't know how to access it and amend

Post Reply