-
Notifications
You must be signed in to change notification settings - Fork 54
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
Comments
lovyan03
added a commit
that referenced
this issue
Dec 17, 2023
Hello, @sbesselsen |
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
When I call
M5.Power.deepSleep(10 * 1000000, true)
on the M5Paper, the deep sleep always ends after around 2 seconds withesp_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 toesp_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:M5.Display.sleep()
I addM5.Display.waitDisplay()
.while (m5gfx::gpio_in(wpin) == false)
loop, I addM5.update()
, as suggested here: https://community.m5stack.com/topic/5802/m5paper-touchscreen-wakeup-on-gpio-36-constantly-triggeringI 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!
The text was updated successfully, but these errors were encountered: