Replies: 5 comments 9 replies
-
Let's first address the errors in your code that stops it running at all:
Here is your code, formatted according to the instructions in Welcome (Please read before posting): from machine import Pin, RTC, deepsleep, DEEPSLEEP
from time import sleep
led = Pin(14, Pin.OUT)
def deep_sleep(msec):
print("gehe schlafen!")
led.value(0)
rtc = RTC()
rtc.irq(trigger=rtc.ALARM0, wake=DEEPSLEEP)
rtc.alarm(rtc.ALARM0, msec)
deepsleep()
def main():
print("bin wach!")
led.value(1)
sleep(5)
deep_sleep(5000)
main() Under v1.24.0, this runs once, then hangs (tested on an Adafruit Huzzah, with modifications for its LED pin and active low status) |
Beta Was this translation helpful? Give feedback.
-
I agree that the behavior is strange. deepsleep() with an argument should sleep for the given time and then reset the board. The reset after the sleep time seems to happen, but it sends a different boot message at 74880 baud:
|
Beta Was this translation helpful? Give feedback.
-
Danke für Ihre Bemühungen. Das Problem besteht leider weiter. Die Verbindung zwischen D0 (GPIO16) und RST habe ich bereits zu Beginn hergestellt.
Damit ist das Problem leider nicht gelöst. Werde morgen mal die vorletzte Version von Micropython flashen, vielleicht ist es ein Fehler in der Software.
Von: Robert Hammelrath ***@***.***>
Gesendet: Samstag, 1. Februar 2025 18:28
An: micropython/micropython ***@***.***>
Cc: Woga57 ***@***.***>; Author ***@***.***>
Betreff: Re: [micropython/micropython] ESP8266 Amica problem with deepsleep (Discussion #16674)
Actually yes, looking into the documentation: https://docs.micropython.org/en/latest/esp8266/quickref.html#deep-sleep-mode
The sample code there restarts the boards properly. It is important to connect GPIO16 with RST. Then a proper reset is done.
—
Reply to this email directly, view it on GitHub <#16674 (reply in thread)> , or unsubscribe <https://github.com/notifications/unsubscribe-auth/BNLWGUY22MRF4APJXNEAH5L2NT73VAVCNFSM6AAAAABWHJZLTOVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTEMBSG4ZTIMA> .
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Thank you. I wiill try it tomorrow with version 1.24.0 and if it doesn’t runs with the next earlyer version.
Von: Stewart Russell ***@***.***>
Gesendet: Samstag, 1. Februar 2025 21:01
An: micropython/micropython ***@***.***>
Cc: Woga57 ***@***.***>; Author ***@***.***>
Betreff: Re: [micropython/micropython] ESP8266 Amica problem with deepsleep (Discussion #16674)
Yes, I'm confirming the problem you have. There have been some problems/changes/regressions with deepsleep on other platforms recently. Maybe try it with an older stable firmware: something like v1.20.0, which is still available for download <https://micropython.org/download/ESP8266_GENERIC/> .
—
Reply to this email directly, view it on GitHub <#16674 (reply in thread)> , or unsubscribe <https://github.com/notifications/unsubscribe-auth/BNLWGU5BDWCLILORLS6XFAL2NURWDAVCNFSM6AAAAABWHJZLTOVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTEMBSHAYTKMA> .
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Your code from the initial post works fine here on three different ESP8266 boards, two with recent firmware and one with v1.22. Two boards are Wemos D1, the other is an Adafruit ESP8266 board. SO there must be something else wrong with your set-up. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
to test deepsleep I use this code:
from machine import Pin, RTC, deepsleep
from time import sleep
led=pin(14,Pin.OUT)
def deep_sleep(msec):
print('gehe schlafen!')
led.value(0)
rtc=RTC()
rtc.irq(trigger=rtc.ALARM0, wake=machine.DEEPSLEEP)
rtc.alarm(rtc.ALARM0, msec)
deepsleep()
def main():
print('bin wach!')
led.value(1)
sleep(5)
deep_sleep(5000)
main()
The program runs one time than I get:
bin wach!
gehe schlafen!
rl
The ESP doesn't wake up, Where is the failure?
Beta Was this translation helpful? Give feedback.
All reactions