Skip to content

ThinkNode M6: expose external-power and charger state - #3202

Open
F4FPR wants to merge 5 commits into
meshcore-dev:devfrom
F4FPR:m6-power-observability
Open

ThinkNode M6: expose external-power and charger state#3202
F4FPR wants to merge 5 commits into
meshcore-dev:devfrom
F4FPR:m6-power-observability

Conversation

@F4FPR

@F4FPR F4FPR commented Aug 13, 2026

Copy link
Copy Markdown

What

  • adds MainBoard::isChargerActive() with a safe default of false;
  • defines the ThinkNode M6 external-power and charger-status lines using the
    existing EXT_PWR_DETECT / EXT_CHRG_DETECT conventions;
  • overrides isExternalPowered() and isChargerActive() on the M6;
  • adds an exact power CLI command returning battery millivolts, external-power
    state and charger-source state.

Example:

batt:4012 mV ext:yes charger:yes

Why

The generic nRF52 implementation only checks MCU USB VBUS. The ThinkNode M6 also
has dedicated board signals for external input (P0.13, active HIGH) and its solar
charger (P0.15, active LOW). Exposing both makes USB/powerbank and solar behavior
observable without changing the charging path.

Semantics

  • ext:yes means that the dedicated external-input line, the active charger
    line, or the nRF52 USB-VBUS fallback detects an external source;
  • charger:yes means that the solar charger signal is active or an external USB
    charging source is present;
  • with USB input, the available board signals cannot distinguish active battery
    current from charge completion.

Scope

  • other boards retain the default isChargerActive() == false;
  • no change to GPS, ADC conversion, charger control, sleep policy or radio
    configuration;
  • the command uses an exact strcmp, so it does not overlap with poweroff;
  • no Meshtastic code is copied; only documented board pin facts are reused.

Testing

The board-state logic was compiled and exercised in an isolated C++11 harness
for no source, external USB input and active solar charging. Full target build
and on-device validation remain for CI/hardware.

Expected hardware checks:

  1. no external source: ext:no charger:no;
  2. USB-C/powerbank connected: ext:yes charger:yes;
  3. solar charging in sufficient light: ext:yes charger:yes;
  4. unplugging the source restores ext:no charger:no once the charger line is
    inactive.

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