fix(esp32): skip RTC timer wake on user shutdown; TAP V2 OCV and partition#10739
Merged
thebentern merged 3 commits intoJun 18, 2026
Merged
Conversation
Do not arm esp_sleep_enable_timer_wakeup when msecToWake is portMAX_DELAY (UI shutdown), matching nRF52 system_off semantics. fix(rak_wismesh_tap_v2): Tag OCV curve and 16MB partition Add OCV_ARRAY matching WisMesh Tag for accurate SOC. Use 16MB flash partition scheme for TAP V2 hardware. Co-authored-by: Cursor <cursoragent@cursor.com>
Contributor
⚡ Try this PR in the Web FlasherWarning This is an automated, unreviewed CI test build. Back up your device configuration Supported boards built by this PR (24)
Build artifacts expire on 2026-07-18. Updated for |
Contributor
Firmware Size Report22 targets | vs
Show 17 more target(s)
Updated for f2c0089 |
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR fixes ESP32 “user shutdown” behavior so it no longer arms an RTC timer wake (preventing unintended wake/drain after long storage) and aligns the TAP V2 variant config with its hardware (battery OCV curve + 16 MB flash partitioning).
Changes:
- Avoid enabling ESP32 deep-sleep timer wake when shutdown requests an indefinite sleep (
portMAX_DELAY). - Add TAP V2-specific battery OCV curve (
OCV_ARRAY) for more stable SOC estimation. - Switch TAP V2 PlatformIO configuration to a 16 MB partition scheme.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
src/platform/esp32/main-esp32.cpp |
Skips RTC timer wake configuration for “forever” sleeps to behave like true shutdown. |
variants/esp32s3/rak_wismesh_tap_v2/variant.h |
Defines TAP V2 OCV curve to improve battery SOC stability. |
variants/esp32s3/rak_wismesh_tap_v2/platformio.ini |
Moves TAP V2 to 16 MB partition layout and metadata. |
thebentern
added a commit
that referenced
this pull request
Jun 18, 2026
…ition (#10739) * fix(esp32): skip RTC timer wake on user shutdown Do not arm esp_sleep_enable_timer_wakeup when msecToWake is portMAX_DELAY (UI shutdown), matching nRF52 system_off semantics. fix(rak_wismesh_tap_v2): Tag OCV curve and 16MB partition Add OCV_ARRAY matching WisMesh Tag for accurate SOC. Use 16MB flash partition scheme for TAP V2 hardware. Co-authored-by: Cursor <cursoragent@cursor.com> * Trunkt --------- Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
raghumad
pushed a commit
to raghumad/mezulla-firmware
that referenced
this pull request
Jun 25, 2026
…ition (meshtastic#10739) * fix(esp32): skip RTC timer wake on user shutdown Do not arm esp_sleep_enable_timer_wakeup when msecToWake is portMAX_DELAY (UI shutdown), matching nRF52 system_off semantics. fix(rak_wismesh_tap_v2): Tag OCV curve and 16MB partition Add OCV_ARRAY matching WisMesh Tag for accurate SOC. Use 16MB flash partition scheme for TAP V2 hardware. Co-authored-by: Cursor <cursoragent@cursor.com> * Trunkt --------- Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix(esp32): skip RTC timer wake on user shutdown; TAP V2 OCV and partition
Summary
This PR addresses WisMesh TAP V2 field reports where devices could not power on with the power button after long storage following factory UI shutdown.
Two classes of changes:
Problem
ESP32 user shutdown
UI shutdown calls
doDeepSleep(DELAY_FOREVER)whereDELAY_FOREVERisportMAX_DELAY(UINT32_MAXms ≈ 49.7 days).cpuDeepSleep()always calledesp_sleep_enable_timer_wakeup(), so shutdown was timed deep sleep, not true power-off.After the timer fires, the device cold-boots, does not shut down again, and can drain the battery while stored (e.g. factory UI shutdown → ship → customer first use weeks later). On TAP V2 TFT (
HAS_TFT, no PMIC), wake current is ~120 mA screen-off.TAP V2 battery SOC
TAP V2 had no
OCV_ARRAYinvariant.h, so SOC used a generic curve and could jump under load (e.g. 68% → 83% within minutes in channel testing).Fix
src/platform/esp32/main-esp32.cppOnly call
esp_sleep_enable_timer_wakeup()whenmsecToWake != portMAX_DELAY.Timed deep sleep (
sds_secs, telemetry night sleep, etc.) is unchanged.variants/esp32s3/rak_wismesh_tap_v2/variant.hAdd
OCV_ARRAYmatching WisMesh Tag / Pod / Pocket:4160, 4020, 3940, 3870, 3810, 3760, 3740, 3720, 3680, 3620, 2990variants/esp32s3/rak_wismesh_tap_v2/platformio.iniUse 16 MB partition scheme (
default_16MB.csv) for TAP V2 hardware.Testing
portMAX_DELAY— UI shutdown auto-rebooted in ~26 s withESP_SLEEP_WAKEUP_TIMER.doDeepSleep()durations still wake on timer as before.Shutdown deep-sleep current (~20 µA on battery path) was already correct; the issue is long-term timer wake, not leakage.
Scope / impact
| TAP V2 OCV / partition | TAP V2 only |
Boards with AXP/PPM
shutdown()onportMAX_DELAYremain compatible; this change closes the gap for boards without PMIC.Files changed
src/platform/esp32/main-esp32.cppvariants/esp32s3/rak_wismesh_tap_v2/variant.hvariants/esp32s3/rak_wismesh_tap_v2/platformio.ini