192 lines
11 KiB
Markdown
192 lines
11 KiB
Markdown
# Power saving on a solar repeater — what it costs, measured
|
||
|
||
Everything here was measured on the deployment hardware (SenseCAP Solar Node
|
||
P1-Pro, nRF52840 + SX1262 + L76K) on 2026-08-05/06 with `tools/power_ab.py`, not
|
||
taken from a datasheet. Numbers are input current on the 5 V USB side; the delta
|
||
between two states is what the paired design measures, and that is what these
|
||
figures are.
|
||
|
||
## The order that matters
|
||
|
||
| lever | measured | verdict |
|
||
|---|---|---|
|
||
| **GPS running continuously** | **46.0 mA** (spread 43.7-47.5) | `gps duty` recovers 42-45 of it |
|
||
| BLE advertising + Bluefruit's blinking LED | see below | defaults changed, LED off, 1 s interval |
|
||
| `powersaving on` (MCU light sleep) | **~1 mA, not separable from zero** | keep it on (free), but it is not a lever |
|
||
| RX duty cycle (`set radio.rxps`, from EasySkyMesh) | **~2.3 mA** at `max` (XIAO, 12. 11. 2026) | **no** on a live node: -16 % received and a TX stall on mast-three, see below |
|
||
| `radio.rxgain off` | ~0.7 mA | **no** — 1-3 dB of sensitivity is what a mast node is for |
|
||
| FEM LNA control | n/a | SenseCap has no FEM, only an RXEN switch |
|
||
|
||
A whole node in the shipping configuration, with the battery charged and GPS
|
||
duty-cycled, sits at **~24 mA**. Continuous GPS alone would nearly triple that.
|
||
|
||
## GPS is the whole game
|
||
|
||
The receiver on this board draws 46 mA, and a mast repeater runs GPS for one
|
||
reason only: the RTC is volatile, and a node whose clock is wrong has its
|
||
replies dropped by clients. It does not need a continuous fix — it needs the
|
||
clock set.
|
||
|
||
GPS is no longer the *only* way to get that (since 7. 8. 2026 a node starts at
|
||
its build epoch and any attached host sets it — see `docs/cli_commands.md` under
|
||
`time`). A reboot still throws the clock back to the build epoch: carrying it
|
||
across one in retained RAM was tried and measured not to work, because the
|
||
bootloader's stack owns the top of RAM. GPS is still
|
||
what makes a mast node's clock **absolutely** right months after the flash, with
|
||
nobody there to set it, so this reasoning stands for anything on a mast. What
|
||
changed is that a node without GPS is no longer stuck in 2024.
|
||
|
||
`gps duty` (`gps_enabled == 2`, so no prefs-layout change) powers the receiver
|
||
only around a sync, once a day (until 11/2026 every 30 minutes, the cadence
|
||
`gps on` re-syncs at). The LF crystal is ±20 ppm plus ~40 ppm at −10 °C, so a
|
||
day costs ~5 s of clock — far below what the mesh notices — and a reboot syncs
|
||
at once anyway. Verified on hardware in both paths (with the old 30 min / 1 h
|
||
timers):
|
||
|
||
- with sky (`mast-three`): `duty, asleep, fix, 7 sats` — got a fix, set the clock,
|
||
cut power to the receiver;
|
||
- without (indoors, `bench-rpt`): `awake` for exactly 300 s
|
||
(`GPS_DUTY_MAX_AWAKE_SECS`), then `asleep` with an hourly retry, so a blocked
|
||
sky cannot turn duty mode back into "always on".
|
||
|
||
Worst case (fix never obtained) still saves 42 mA; a normal 30 s fix saves 45.
|
||
Going from 30 min to 24 h saves another 0.25–0.75 mA (hot vs. warm start, not
|
||
measured per window), and the retry from 1 h to 6 h takes a node whose dome is
|
||
under snow from 3.8 mA (300 s at 46 mA hourly) to 0.64 mA.
|
||
Knobs: `GPS_DUTY_SYNC_INTERVAL_SECS` (86400), `GPS_DUTY_MAX_AWAKE_SECS` (300),
|
||
`GPS_DUTY_RETRY_SECS` (21600).
|
||
|
||
Upstream later (v1.18 dev, 11/2026) added its own `gps period <s>`. It is not a
|
||
replacement: a periodic acquisition has no timeout until the first fix ever, so
|
||
the indoor case above would stay at 46 mA for good. `gps duty` sets the period
|
||
to 0, and `gps on` / `gps off` leave duty mode.
|
||
|
||
**One visible side effect:** `querySensors()` only adds the GPS channel to
|
||
telemetry while the receiver is powered, so a duty-cycled node reports position
|
||
in telemetry only during its sync windows (well under 1 % of the time). What a repeater
|
||
*advertises* is unaffected — that comes from prefs via `set advert.loc prefs` (formerly `gps advert prefs`) — and
|
||
`node_lat/lon` keep the last fix. Confirmed in the field: `mast-three`'s scrape now
|
||
carries `voltage/temperature/humidity` and no `gps` field.
|
||
|
||
## BLE: two defaults that were quietly expensive
|
||
|
||
- **The blinking LED.** Bluefruit drives `LED_BLUE` while advertising and holds
|
||
it on while connected. On SenseCap Solar that pin is **12 — the same pin as
|
||
`P_LORA_TX_LED`**, so a sealed mast node spent solar charge blinking an LED
|
||
nobody can see, and the LoRa TX indicator lied as a bonus.
|
||
`RPT_BLE_CONN_LED` now defaults to 0.
|
||
- **The advertising rate.** Upstream leaves the slow interval at 244 units =
|
||
152.5 ms, i.e. three channels ~6.5 times a second, forever.
|
||
`RPT_BLE_ADV_SLOW` now defaults to 1600 = 1 s; the first
|
||
`RPT_BLE_ADV_FAST_SECS` (30) after boot or disconnect stay fast so discovery
|
||
is still immediate when someone is looking.
|
||
|
||
Bench boards keep both upstream behaviours (`-D RPT_BLE_CONN_LED=1`,
|
||
`-D RPT_BLE_ADV_SLOW=244` in `xiao_analyzer`): on a desk the blinking LED is the
|
||
"this thing is alive" indicator.
|
||
|
||
`ble off` remains the big BLE lever for a deployed node, but the deployment rule
|
||
stands: ship with BLE **on**, verify the node on site, and only then turn it off
|
||
over the mesh — otherwise a node that does not come up has no way in.
|
||
|
||
## RX duty cycle (rxps)
|
||
|
||
Ported from EasySkyMesh PowerSaving v18 behind `-D WITH_RX_POWERSAVING` (the
|
||
public releases have it), SX1262 only, **off until set**. The radio listens in
|
||
short windows and sleeps between them, staying awake through a packet once it
|
||
hears a preamble; after three failed arms it falls back to continuous RX by
|
||
itself. Commands: `docs/cli_commands.md`, `radio.rxps`.
|
||
|
||
Measured 12. 11. 2026 on a XIAO nRF52840 + Wio-SX1262 (not the SenseCAP of
|
||
the rest of this page), bench preset 866.5 MHz / SF8 / BW62.5, fed at 5 V
|
||
through an INA226 (10 mOhm) read every 5 s; the only other load was a UC96 on
|
||
the XIAO's USB port. A/B/A/B, 15 min cells, the first 2 min of each dropped:
|
||
|
||
| cell | rxps | mean | median |
|
||
|---|---|---|---|
|
||
| 1 | off | 33.84 mA | 32.2 mA |
|
||
| 2 | max | 31.31 mA | 30.5 mA |
|
||
| 3 | off | 33.53 mA | 32.5 mA |
|
||
| 4 | max | 31.36 mA | 30.3 mA |
|
||
|
||
`max` (level 8) against the mean of its neighbours: **-2.4 / -2.2 mA**, pooled
|
||
-2.35 mA (medians -1.95 mA); off vs off differs by 0.3 mA, max vs max by
|
||
0.05 mA. That is the radio's share, so it carries over to other SX1262 boards
|
||
in absolute terms; the 33 mA base is this bench (meter, BLE advertising), not
|
||
a node. Behind the XIAO's linear regulator the battery sees the same current:
|
||
~7-8 mW at 3.3 V.
|
||
|
||
Reception: a 3-board zero-hop matrix (x1, x3, x4; rxps switched on x1 and x4,
|
||
x3 the reference with rxps off; 20 rounds per phase, each link witnessed by
|
||
another board), run twice -- on the development build, then repeated on the
|
||
public release `v1.18.0+tth.20261112` (`ver` v1.18.0-tthd4afea1):
|
||
|
||
| phase | development build | public release | together |
|
||
|---|---|---|---|
|
||
| rxps off | 0/120 | 1/120 | 1/240 |
|
||
| `on` (level 3) | 1/120 | 2/120 | 3/240 |
|
||
| `max` (level 8) | 0/120 | 0/120 | **0/240** |
|
||
|
||
rxps stayed armed throughout, no error counts. Single losses happen with rxps
|
||
off as well, and of the three at level 3 one was on x3, which had rxps off: the
|
||
bench shows no degradation at any level. Not measured: mixed SF/preamble senders, a busy
|
||
live mesh. On a mast, where 2 mA of ~24 is not the problem, leave it off.
|
||
|
||
**On the live mesh it failed (mast-three, 14. 11. 2026, `max`).** Against ob1 as
|
||
the reference for the hour-to-hour traffic, the node received ~16 % fewer
|
||
packets (2.08 vs 2.47 per ob1 packet) with ~30 % more `recv_errors`, and within
|
||
two hours of switching it on it stopped transmitting altogether: `sent` frozen,
|
||
queue full (32), no `tx_start_fail`/`tx_timeout`, RX still counting -- so no
|
||
adverts and no replies to an admin login, for 6+ hours. `radiostat` showed
|
||
`irq=0x0014` (preamble + header valid, no RX done). `set radio.rxps off` did
|
||
NOT bring TX back; a reboot did. The mechanism is not proven, and the radio
|
||
silence watchdog cannot see it (it watches RX only). Do not enable rxps on a
|
||
node that has to answer.
|
||
|
||
## MCU sleep
|
||
|
||
`powersaving on` makes the nRF52 wait in WFE between events (it wakes on any
|
||
interrupt, including LoRa DIO1). Upstream ships it **off**, and it was missing
|
||
from our provisioning, so every node built from that file ran the core at 64 MHz
|
||
around the clock. It is now in our provisioning file.
|
||
|
||
**But it buys about 1 mA, not the 3-4 that seemed obvious.** Measured with GPS
|
||
held off so its sync windows could not pollute the cells: paired estimate
|
||
-0.96 mA over three pairs, spread -1.97 to +0.07, against a measured
|
||
cell-to-cell repeatability of 1.16 mA — i.e. the effect is the same size as this
|
||
rig's noise and cannot be told from zero. That fits the mechanism: the loop
|
||
still polls the SX1262 over SPI on every pass and the SoftDevice wakes the core
|
||
for each advertising event, so there is not much idle left to sleep through.
|
||
Keep it on (it is free and cannot hurt), but do not budget for it.
|
||
|
||
Blocking the loop task instead of waiting for an event (so that FreeRTOS can
|
||
sleep tickless) changes nothing either: `delay(10)` against `sd_app_evt_wait()`,
|
||
XIAO x4, A/B/A/B 30 min cells (14. 11. 2026): paired difference **0.04 mA**,
|
||
cell repeatability 0.1-0.4 mA. The tick wakeups are not where the current goes.
|
||
|
||
One fork-specific fix goes with it: the sleep is also held off while the BLE
|
||
console still has queued output (`bleTxPending()`), because on the observer node
|
||
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.
|
||
|
||
## Measuring this yourself — two traps
|
||
|
||
1. **A solar node measured on its USB side measures the CHARGER.** With a
|
||
charging cell the meter reads 500-700 mA, pulsing, and the node's own tens of
|
||
mA ride on top of a drifting number. Wait for the charge to finish (it fell
|
||
0.71 → 0.53 → 0.22 → 0.05 A over about an hour here) or the numbers are
|
||
fiction. There is **no INA226 on this board** to cross-check with — the `i2c`
|
||
command reports nothing at all on the only bus the variant has — on three
|
||
separate P1-Pro units (`bench-rpt`, `mast-rpt-two`, `tth-mast-repeater-one`),
|
||
against a sensor table that expects `38 76 70 44 5C 42 40 41 5A 29 77`. So it
|
||
is the board, not one dead part, and the cross-check for a power measurement
|
||
has to be a second *board*.
|
||
2. **With `gps duty` enabled you cannot measure anything under ~5 mA.** A sync
|
||
window lands in a random cell and adds ~17 mA to a 10-minute average (seen:
|
||
40.9 mA against 24.1-24.5 in its neighbours). Put `gps off` in every cell of
|
||
such a run and restore `gps duty` afterwards.
|
||
|
||
See `tools/power_ab.py --help` for the alternating-cell design that makes
|
||
these deltas trustworthy in the first place.
|