Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

M5Paper wakes too soon from deep sleep when touch wakeup is enabled - with solution #91

Open
sbesselsen opened this issue Nov 20, 2023 · 2 comments

Comments

@sbesselsen
Copy link

When I call M5.Power.deepSleep(10 * 1000000, true) on the M5Paper, the deep sleep always ends after around 2 seconds with esp_sleep_get_wakeup_cause() == ESP_SLEEP_WAKEUP_EXT0. I think this is because the behavior of GPIO pin 36 is not as PowerClass::deepSleep() expects. If I remove the call to esp_deep_sleep_start() and instead monitor the state of pin 36 for a while, I see it going from HIGH to LOW after about 2 seconds and then staying there. This is what triggers the ext0 wakeup. I have solved this by creating my own version of deepSleep() with 2 modifications:

I can confirm that with these two changes, deepSleep with touch wakeup works as expected, and when I remove either of these two changes, it reverts to its erroneous behavior.

I do notice that all this adds around another 4 seconds before esp_deep_sleep_start() is actually called, so if the wakeup timing needs to be precise, perhaps some adjustment of the remaining micro_seconds would be in order, but that is not a decision for me to make.

Hope this helps!

@lovyan03
Copy link
Collaborator

Hello, @sbesselsen
I am sorry for the late response. Thank you for giving me this information.
Since the develop branch has been updated, if there are no problems, it will be reflected in the next update release.

@mdxs
Copy link

mdxs commented Apr 17, 2024

I assume this has been resolved; there have been several releases since. If so, the ticket can be closed as resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants