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

turn off brownout before deep sleep #4159

Merged

Conversation

dhalbert
Copy link
Collaborator

@dhalbert dhalbert commented Feb 8, 2021

Fixes #4025.

@dhalbert
Copy link
Collaborator Author

dhalbert commented Feb 8, 2021

@jfabernathy Could you test this fix? Thanks! It disables brownout detection just before doing a deep sleep. You can find a build for your board in the "Artifacts" dropdown on this page.

image

I tried testing with simpler test programs that did and did not use wifi but could not reliably generate the problem.

@jfabernathy
Copy link

Just so I'm clear. I double press reset on the Metro ESP32-S2 and then drag over the UF2 file I got from the "Artifacts" dropdown for Metro ESP32-S2 to the CIRCUITPY dir. The boot_out.txt shows:

Adafruit CircuitPython 6.2.0-beta.1-136-g5c129f813 on 2021-02-08; Adafruit Metro ESP32S2 with ESP32S2

My lib folder items are all from Feb 4 2021.
The app I'm testing is my full application that sends temp and humidity via miniMQTT and then deep sleeps for 60 sec. It also post it's loop count so I'll know if it comes out of deep sleep vs. poweron. Only exception would be if the app locks up and the WDT resets it. either way the loop count goes to 0. For the past week with my custom build with BOD disabled completely there have been no loop count resets.
So this is what I'll be testing unless you think something needs to change.

@dhalbert
Copy link
Collaborator Author

dhalbert commented Feb 8, 2021

Right, thanks, that's exactly what I would expect you to do. This build does not have brownout detection disabled completely like your previous test version. Instead it turns it off before just before deep sleep (and actually doesn't turn it back on -- not sure if we should or it's automatic).

Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good to me! Thanks!

@jfabernathy
Copy link

The first hour (67 loops) are flawless. I'll let you know tomorrow what the first day looks like.

@jfabernathy
Copy link

My test on the Metro ESP32-S2 has worked flawlessly for over 12 hours. I'd say it fixed. I also put the right .UF2 file on the Magtag with a test that reads temp, humidity, and the loop count from alarm.memory and displays them every 60 seconds and them deep sleeps. It's over 11 hours without a problem. I'd say it's fixed.

@dhalbert
Copy link
Collaborator Author

dhalbert commented Feb 9, 2021

@jfabernathy Thank you for the thorough testing!

@dhalbert dhalbert merged commit 5ba28e9 into adafruit:main Feb 9, 2021
@dhalbert dhalbert deleted the disable-brownout-before-deep-sleep-4025 branch February 11, 2021 19:14
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

Successfully merging this pull request may close these issues.

ESP32-S2 coming out of deep sleep with POWERON status
3 participants