Skip to content

ThinkNode M6: enable status LED, button and low-battery shutdown (run UITask)#2837

Open
benskigomez wants to merge 1 commit into
meshcore-dev:devfrom
benskigomez:feature/m6-status-led-pr
Open

ThinkNode M6: enable status LED, button and low-battery shutdown (run UITask)#2837
benskigomez wants to merge 1 commit into
meshcore-dev:devfrom
benskigomez:feature/m6-status-led-pr

Conversation

@benskigomez

@benskigomez benskigomez commented Jun 24, 2026

Copy link
Copy Markdown

Problem

The Elecrow ThinkNode M6's two LEDs work in the bootloader and on other firmware, but the MeshCore companion builds give no status indication. The red LED (P0.12) is initialised off and never used again; the blue LED only blinks on LoRa TX.

Cause

The companion status LED, user-button handling, and low-battery auto-shutdown all live in UITask, which is only instantiated when DISPLAY_CLASS is defined. The M6 is screenless, so UITask never ran — PIN_STATUS_LED was never set, the button was inert, and even the AUTO_SHUTDOWN_MILLIVOLTS=3300 flag already in the env had no effect.

Fix

Run UITask headless with NullDisplayDriver, exactly as the other screenless boards (t1000-e, RAK WisMesh Tag) do, and define PIN_STATUS_LED. This enables, on both companion_radio_ble and companion_radio_usb:

  • Status LED on the previously-unused red LED — heartbeat (brief blink every ~4 s, longer when there are unread messages). The blue LED keeps its LoRa-TX function.
  • User button — navigation + long-press select, same as other screenless boards. Groundwork toward the button-shutdown request in Shutdown for ThinkNode M6 #2313.
  • Low-battery auto-shutdown at 3.3 V — previously configured but dormant.

Screenless-safe button menu

Because the M6 has no screen, this also hides the Bluetooth toggle page from the button menu, behind a new opt-in UI_HIDE_BLUETOOTH_PAGE flag (no effect on boards that don't set it). On a screenless node, a blind long-press on that page would silently disable BLE with no way to see it or undo it. With it hidden, the reachable button actions are send-advert / GPS-toggle / hibernate, which are all safe to trigger blind.

The LED pins/polarity were already correct (RED=12, BLUE=7, active-high), so no hardware-config change is needed — only target.h (use NullDisplayDriver), the two env definitions, and the UI_HIDE_BLUETOOTH_PAGE guards in UITask.cpp.

Testing

Built and flashed on a ThinkNode M6: the red LED shows the heartbeat and blinks longer with unread messages; the blue TX blink is unchanged; the Bluetooth page is gone from the menu. Both companion BLE and USB build and run.

Notes

Relates to #2313 (Shutdown for ThinkNode M6) — this makes the user button active, a prerequisite for button-driven shutdown, though it doesn't add a dedicated long-press-shutdown/wakeup mapping itself.

@benskigomez benskigomez force-pushed the feature/m6-status-led-pr branch from a85f938 to dd9f70b Compare June 26, 2026 14:45
@benskigomez benskigomez changed the base branch from main to dev June 26, 2026 14:45
…utdown)

The M6's two LEDs work in the bootloader and on other firmware, but the
MeshCore companion builds gave no status indication: the red LED (P0.12)
was initialised off and never used, and the blue LED only blinked on
LoRa TX.

The companion status LED, user-button handling and low-battery
auto-shutdown all live in UITask, which is only instantiated when
DISPLAY_CLASS is defined. The M6 is screenless, so UITask never ran and
none of those worked - including AUTO_SHUTDOWN_MILLIVOLTS, which was set
in the env but had no effect.

Run UITask headless via NullDisplayDriver, the same way the other
screenless boards (t1000-e, RAK WisMesh Tag) do, and define
PIN_STATUS_LED. This enables, on both companion_radio_ble and
companion_radio_usb:
 - status LED on the previously-unused red LED (heartbeat, longer blink
   on unread messages); blue keeps its LoRa-TX function
 - the user button (navigation + long-press), groundwork for the
   shutdown request in meshcore-dev#2313
 - the already-configured low-battery auto-shutdown (3.3V)

Because the M6 is screenless, also hide the Bluetooth toggle page from
the button menu (new UI_HIDE_BLUETOOTH_PAGE flag, opt-in, no effect on
boards that don't set it). On a screenless node a blind long-press on
that page would silently disable BLE with no way to see or undo it;
removing it leaves advert / GPS-toggle / hibernate, which are safe.

The LED pins/polarity were already correct (RED=12, BLUE=7,
active-high), so no hardware-config change is needed.

Relates to meshcore-dev#2313.
@benskigomez benskigomez force-pushed the feature/m6-status-led-pr branch from dd9f70b to 2742f16 Compare June 26, 2026 19:33
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.

2 participants