Repository navigation
ThinkNode-M1: deep sleep with key wake, dual-GPS support, LEDs and low-voltage handling - #3734
Elecrow-RD wants to merge 1 commit into
Conversation
…w-voltage handling Board support for the Elecrow ThinkNode-M1 (nRF52840 + SX1262 + 1.54" e-paper), following the 2026-08-21 design review. - hibernate(): enter SYSTEMOFF and wake on a short page-key press. The pin table is taken from Meshtastic's variant_shutdown(); the pins that must hold a defined level (radio NRESET/NSS, backlight-rail enable, LEDs, GNSS standby) are driven *after* the generic high-Z pass and the peripheral rail (P0.12) is cut last. Measured on V1.5: 1.88 mA -> 320 uA with the GNSS switch off, 30 mA -> 391 uA with it on. - e-paper: keep the sleep page on screen and deep-sleep the panel on turn-off (~1.7 mA static draw -> uA, image retained). - GPS: detect V1.5 (L76K) vs V2.0 (AG3352) from the P0.08/P1.01 hardware signature, run the matching bring-up/sleep path, try both paths as a fallback, and request NMEA output from both command families. - LEDs: BLE pairing blink, RX pulse, low-battery red blink (charger IC keeps control while charging). - Low voltage: hibernate after consecutive 3.45 V readings, power off at 3.28 V. - Battery gauge: 3.0 V reference, longer sample-and-hold, averaging, offset calibration.
|
Thank you for this big PR that will give us lots of insights on the M1 internals ;) Sadly I don't have an M1 to test it ... I don't think it will be pulled as is, because there is too much device dependent code (in UI_Task for instance) and if we start going this way, the main code would become unreadable, but I'll try to digest it, backport some of the interesting functionalities here, break things in smaller PRs and try to incorporate things mainstream It's nice to have your support ... |
|
As an M1 owner this PR looks so intriguing to me. I hope most of it can find the way into the firmware. So nice to see official support from Elecrow here :) |
|
I have flashed this version to my M1. Here's what I found: Positive:
Buggy:
|
current upstream is dev ... is it not working for you ? Or do you talk about 1.18 which is now largely outdated and known not to work on this device ? Maybe you can try this firmware About the firmware in this PR, this is really a great contribution from the Elecrow team. It can be used for people to test their view of the firmware, which is really good, and I think it's a good way for working together, by doing a custom firmware for their devices We'll try to backport things in dev branch, but it has to be done thinking how things fit with the whole ecosystem. For instance for GPS part, there is an urge to clean all the mess between EnvironmentSensorManager and LocationProvider |
Oh, you are right. By upstream I meant the 1.18 release. Sorry for using the wrong term here. I flashed the current dev branch (actual upstream) now. That version works good with the E-Ink display as well. And it doesn't have the hibernation problem from this PR that disables BLE. I'll keep it for now on my M1 🙂 |
|
You say that
but that PR meshtastic/firmware#12306 contains the following
Which one is correct ? |
ThinkNode-M1: deep sleep with key wake, dual-GPS support, LED and low-voltage handling
Board-level work for the Elecrow ThinkNode-M1 (nRF52840 + SX1262 + 1.54" e-paper),
reviewed on 2026-08-21 and rebased onto
dev.Summary
hibernate()→SYSTEMOFF, wake on a short page-key press; progress markers on the boot screen; controlled reboot ifSYSTEMOFFfailsDeep sleep
ThinkNodeM1Board::hibernate()entersSYSTEMOFFand wakes onSENSE_LOWon the page key(
P1.10). The order of the shutdown sequence is what mattered most and is documented inm1_hibernate_pin_table():OUTPUT+0→ high-Z, except the radio SPI/CS/NRESET pins, NFC and buttons(same table Meshtastic's
variant_shutdown()uses);NRESETlow,NSShigh, backlight-rail enable low, LEDs off, GNSS standby low;PERIPHERAL_EN, P0.12) is pulled low, cutting VDD (QSPI flash,e-paper, battery divider);
SYSTEMOFF.Driving the pins before the generic pin table was the bug behind the old sleep current:
the table released
NRESETand the GNSS standby pin again, which left the SX1262 inSTDBY_RC(~1.2-1.5 mA) and the GNSS receiver tracking (~28 mA).E-paper
GxEPDDisplay::turnOff(false)now leaves the last frame on screen and sends the panel todeep sleep. A driven e-paper controller keeps drawing ~1.7 mA even for a static image,
while deep sleep is in the µA range, and the panel is bistable, so the sleep page stays
visible at almost no cost.
GPS: V1.5 and V2.0 in one firmware
P1.01→ 0.8 V regulator enableP1.02= WAKE_UP (high = run),P1.05= RESET_N (low = reset)P1.05→ transistor → RESET_N (high = reset)P0.08hard-wired toBAT_ADCP0.08has a 100 kΩ pull-upBoth bring-up paths are tried, so a wrong detection can never leave the device without GPS.
P1.01on V1.5 is only a 2 MΩ switch-position sense input and must be read as a plaininput;
P0.08must never be driven on V1.5 because it is the battery-sense node. The UARTpins/baud are matched per revision, and NMEA output is requested from both command families
(
$PMTK314/$PAIR062), so either module starts reporting.LEDs and low voltage
firmware does not drive it while charging).
power off.
Verification
pio run -e ThinkNode_M1_companion_radio_bleagainst this branch.hardware; sleep-current numbers above were measured on V1.5 with USB unplugged.
Base branch for this PR:
dev.