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:mainfrom
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:mainfrom
benskigomez:feature/m6-status-led-pr

Conversation

@benskigomez

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 — meaning 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, the same behaviour as other screenless boards. This is groundwork toward the button-shutdown request in Shutdown for ThinkNode M6 #2313.
  • Low-battery auto-shutdown at 3.3 V — previously configured but dormant.

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 instead of the leftover e-paper include) and the two env definitions.

Testing

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

Notes

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

…w-battery shutdown

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:
 - 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)

Applied to both companion_radio_ble and companion_radio_usb. 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.
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