Skip to content

ThinkNode M6: button shutdown/wake for repeater and room server - #3066

Open
codemonkeybr wants to merge 1 commit into
meshcore-dev:devfrom
codemonkeybr:thinknode-m6-shutdown-wake
Open

ThinkNode M6: button shutdown/wake for repeater and room server#3066
codemonkeybr wants to merge 1 commit into
meshcore-dev:devfrom
codemonkeybr:thinknode-m6-shutdown-wake

Conversation

@codemonkeybr

Copy link
Copy Markdown

Problem

Fixes #2313. The ThinkNode M6's battery isn't physically accessible, so there was no way to power the device off to conserve battery when idle.

Fix

Hold the Function Button for ~5s to power off (matches the timing of Elecrow's stock firmware for this board). A single press wakes it back up — the chip is fully halted in SYSTEMOFF while off, so there's no way to measure a hold duration on wake, only on the way down. The power LED (red) blinks 3 times on both shutdown and wake/boot as visual confirmation the action registered.

ThinkNodeM6Board::powerOff() now arms the button pin as a GPIO wake source (pull-up + SENSE_LOW) before entering SYSTEMOFF via NRF52Board::powerOff().

Scope

Limited to simple_repeater and simple_room_server. companion_radio is intentionally left out — #2837 is already moving that build's button handling into UITask (running headless via NullDisplayDriver), and duplicating a second independent button-read loop there would conflict with that approach rather than complement it.

Testing

Built and flashed on a physical ThinkNode M6 repeater:

  • Hold ~5s → LED blinks 3x, device powers off, mesh goes unreachable
  • Single press → LED blinks 3x, device reboots, mesh reachable again
  • Repeated the cycle multiple times, consistent behavior each time
  • ThinkNode_M6_room_server and SenseCap_Solar_repeater (shared guard, unaffected) build clean; room_server not flash-tested on hardware

Fixes meshcore-dev#2313. Hold the Function Button ~5s to power off (matches the
board's stock firmware timing); any press wakes it back up, since the
chip is fully halted in SYSTEMOFF and can't measure hold duration
while off. The power LED blinks 3x on both shutdown and wake/boot to
confirm the action registered.

ThinkNodeM6Board::powerOff() now arms the button as a GPIO wake source
(pull-up + SENSE_LOW) before entering SYSTEMOFF via NRF52Board::powerOff().

Scoped to simple_repeater and simple_room_server only, since
companion_radio already has an in-flight change (meshcore-dev#2837) moving its
button handling into UITask.

Tested on hardware: shutdown, wake, and LED feedback all verified on
a physical ThinkNode M6 repeater.
@codemonkeybr

Copy link
Copy Markdown
Author

Btw i used the 5000ms from the electrow website.. i could swap to use the same as sensecap 1500ms if the team prefers. nbd for me

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.

1 participant