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
TTGO LORA32 v2.1(1.6) incorrectly wakes from deep sleep #322
Comments
reason 3 is apparently |
disabling BUTTON_PIN in configuration.h avoids the boot loop, but then of course no working button. |
Could this be a brownout ? Do you have any mean to measure the power voltage ? |
The detected voltage is deliberately wrong on the example above to force it to sleep. It's powered by USB with no battery for testing. It only seems to occur when trying to sleep due to low battery. And the problem is clearly related to trying to use the RTC interrupts to wake up on button press, since without code related to button pins, it does go to sleep and stays asleep. While I have had past issues with brownouts in other projects, with the ESP 32 it has reliably set the reset reason to RTCWDT_BROWN_OUT_RESET |
Oh I know the problem! We are probably not setting the wake pin correctly
for lora32 - because the internal pull-up resistor is not turned on for
that board?!
(Sent from a phone - please ignore typos)
…On Sun, Aug 16, 2020, 13:50 tschundler ***@***.***> wrote:
The detected voltage is deliberately wrong on the example above to force
it to sleep. It's powered by USB with no battery for testing.
It only seems to occur when trying to sleep due to low battery. And the
problem is clearly related to trying to use the RTC interrupts to wake up
on button press, since without code related to button pins, it does go to
sleep and stays asleep.
While I have had past issues with brownouts in other projects, with the
ESP 32 it has reliably set the reset reason to RTCWDT_BROWN_OUT_RESET
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#322 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABXB2I3CLFQX2YOGS7YJIDSBBA73ANCNFSM4QA6TNPA>
.
|
I think I know what will fix this... @tschundler would you mind building and testing a version where you add BUTTON_NEED_PULLUP to configuration.h? (I don't have one of these boards)
|
This issue has been mentioned on Meshtastic. There might be relevant details there: https://meshtastic.discourse.group/t/lilygo-ttgo-t3-lora32-868mhz-v2-1-6-esp32/1084/8 |
I added the requested line in configuration.h as shown in my file here: (proper formatting not shown due to copy and paste) I then modified power.cpp to simulate the low voltage condition. The unit still goes into a boot loop as before, with the following log file: |
ok thanks - I need to read the datasheet today, I dimly remember some extra call is needed to leave that pullup powered during sleep (all of the other boards have an external pullup, which is why they don't show this problem) |
This issue has been mentioned on Meshtastic. There might be relevant details there: https://meshtastic.discourse.group/t/ttgo-lora-v2-board-specific-issues/1138/4 |
oh - I think I found the problem (probably)! we were isolating gpio12 (which isn't used on other boards) to save power during sleep. gpio12 is the button for this board. @thomslik would you mind pulling this commit and seeing if it works better? |
oh - I think I found the problem (probably)! we were isolating gpio12 (which isn't used on other boards) to save power during sleep. gpio12 is the button for this board. @thomslik would you mind pulling this commit and seeing if it works better?
I think that's it! Loaded your version and simulated low battery with modified power.cpp. It goes to sleep as soon as it boots up. Pressing the added button (pin 12 to ground) immediately wakes it for a second before it returns to sleep. No more boot loop! |
yay! thanks for your help! |
Originally reported by @thomslik in #279 (comment) related to misreading the battery level. Even with correct battery measurement, when the battery gets low, the device goes into a boot loop.
To simulate with USB connected, I reverted 3de1607, and here is the output:
The text was updated successfully, but these errors were encountered: