diff --git a/docs/power.md b/docs/power.md index 580ef3d3..9c562ba0 100644 --- a/docs/power.md +++ b/docs/power.md @@ -170,6 +170,30 @@ a half-drained `rxlog`/`pktlog` page would otherwise wait for the next connection event — the bridge drains those on a 2-minute duty cycle, so a slower drain directly costs collected frames. +## A mast that runs flat (boot protection) + +A panel that gets no direct sun in winter (remote-mast faces east, 11/2026: +-50 mV a day from mid-November with consumption unchanged) eventually drains +the cell. Without protection the node then browns out, and every bit of +light restarts it on a cell that cannot hold it -- a boot loop at the edge. + +`SenseCap_Solar_repeater` builds with `NRF52_POWER_MANAGEMENT` (upstream code, +wired in `variants/sensecap_solar`, only the switch was off): at boot the +node reads the battery and, below **3.3 V** (`PWRMGT_VOLTAGE_BOOTLOCK`), goes to +SYSTEMOFF with the LPCOMP armed on the battery input; it wakes when the +battery rises past the comparator threshold (3/8 VDD, ~3.4-3.7 V on the cell +per `variant.h`) and boots normally. USB power skips the check. + +What it does **not** do: switch off a running node as the battery falls -- +nothing in the firmware calls the runtime low-voltage shutdown. It protects +the restart, not the discharge. The clock goes back to the build epoch after +such a restart, as after any power loss (`gps duty` resyncs it, `time` sets it). + +**Not yet verified on hardware**: the thresholds come from `variant.h`. Bench +test with an adjustable supply on the battery terminals: boot at 3.2 V must +stay dark, raising it to ~3.8 V must wake the node by itself; `get boot` +then shows `RESETREAS=0x00020000` (bit 17, wake from LPCOMP). + ## Measuring this yourself — two traps 1. **A solar node measured on its USB side measures the CHARGER.** With a diff --git a/docs/tth-commands.md b/docs/tth-commands.md index ea2e16b1..4df4eb14 100644 --- a/docs/tth-commands.md +++ b/docs/tth-commands.md @@ -192,6 +192,7 @@ The ones that change what a node does; set in `platformio.ini` / | `ACL_TS_MAX_AHEAD` | `86400` (s) | a client timestamp further ahead of the node's clock is not stored as the replay floor | | `LOCKED_NODE` | unset | a node that keeps its secrets from whoever holds it: `get prv.key`, `get guest.password` and `get bridge.secret` answer `Error: locked build` to everyone (USB and BLE console, an admin over the mesh); a companion serves only paired BLE (USB, UART and WiFi get the device info and nothing else) and its rescue CLI refuses `set pin`. Only half of it: [locked-bootloader.md](locked-bootloader.md) | | `LOGIN_FAIL_MAX`, `LOGIN_FAIL_SECS` | `4`, `180` (s) | after that many wrong passwords in the window no password is checked until it ends (an admin already in the ACL always gets in) | +| `NRF52_POWER_MANAGEMENT` | upstream: off; on in `SenseCap_Solar_repeater` (the masts) | boot protection: below `PWRMGT_VOLTAGE_BOOTLOCK` (SenseCAP: 3300 mV) the node does not start but sleeps in SYSTEMOFF until the battery recovers. Only at boot, nothing switches off a running node -- see [power.md](power.md) | Prefs saved on the node override the build defaults: a reflash keeps what a node already has; only a new node or one after `erase` takes them. diff --git a/variants/sensecap_solar/platformio.ini b/variants/sensecap_solar/platformio.ini index af189aa4..67a18454 100644 --- a/variants/sensecap_solar/platformio.ini +++ b/variants/sensecap_solar/platformio.ini @@ -65,6 +65,12 @@ build_flags = ; CUSTOM (TeTeHacko): ...and off again, with the blue TX LED: a solar node in ; an enclosure blinks for no one. SenseCapSolarBoard.h. -D SENSECAP_SOLAR_NO_LEDS=1 + ; CUSTOM (TeTeHacko): boot protection for a mast that runs flat in winter. + ; Below PWRMGT_VOLTAGE_BOOTLOCK (3.3 V, variant.h) the node does not start but + ; goes to SYSTEMOFF and the LPCOMP wakes it once the cell recovers, instead + ; of a brown-out boot loop on a weak panel. variant.h and + ; SenseCapSolarBoard.cpp had it all wired, only this switch was missing. + -D NRF52_POWER_MANAGEMENT ; -D MESH_PACKET_LOGGING=1 ; -D MESH_DEBUG=1 build_src_filter = ${SenseCap_Solar.build_src_filter}