diff --git a/.github/workflows/pub-release.yml b/.github/workflows/pub-release.yml index 5e74964d..b18947bb 100644 --- a/.github/workflows/pub-release.yml +++ b/.github/workflows/pub-release.yml @@ -44,7 +44,10 @@ env: # FILTER_CHANNEL_PSKS = [channel_filter] in platformio.ini (#meshcore, Public, # #test -- public keys): compiles the repeater's `filter` (deny-forward by # sender name); inert until an operator adds a name. + # WITH_RX_POWERSAVING compiles `set radio.rxps` (SX1262 RX duty cycle); off + # until an operator sets it. PUB_FLAGS: >- + -D WITH_RX_POWERSAVING -D LORA_FREQ=869.432 -D LORA_BW=62.5 -D LORA_SF=7 -D LORA_CR=5 -D ADVERT_INTERVAL_DEFAULT=0 -D FLOOD_ADVERT_INTERVAL_DEFAULT=25 -D AIRTIME_FACTOR_DEFAULT=9.0 -D DEFAULT_REGIONS=\"cz,cs\" diff --git a/README.md b/README.md index 0f9b0c40..221ba25d 100644 --- a/README.md +++ b/README.md @@ -76,11 +76,20 @@ označený `CUSTOM (TeTeHacko)`. Nic z toho nemění protokol na rádiu. a záznam o hardfaultu přežijí teplý reset (`.noinit`); `clkreboot`. * Na solárních uzlech žádná blikající LED a pomalejší BLE advertising; stav baterie jako ikona na konci advertovaného jména (volitelné). +* Volitelný RX duty cycle (`set radio.rxps`, port PowerSaving z EasySkyMesh): + SX1262 mezi krátkými okny poslechu spí. Ve veřejných buildech je zabudovaný + a **vypnutý**; `max` na lavici ušetřil ~2,3 mA bez ztráty paketů + ([docs/power.md](docs/power.md)). Jen SX1262, ne LR1110 (T1000-E). ### Senzory a companiony * `simple_sensor`: telemetrie z externí stanice po UART (`BudkaLinkSensorManager`, jeden LPP kanál na veličinu), `sensor read`. +* Senzory, které jinak měří nepřetržitě (INA219, INA226, INA260, INA3221, + BMP280), mezi čteními telemetrie spí a měří jen na vyžádání (nápad a první + patch pro INA219: Alkel Brostl). Čipy INA se rozlišují podle ID, takže + INA226 už se nedetekuje jako INA219. Odpor bočníku se nastavuje za běhu + a ukládá se: `sensor set ina.shunt `. * Companion: `gps duty` přežije reboot, export klíče a PIN jsou na neověřeném USB spojení zamčené, kopie data sestavení má hlídanou délku. KISS modem: oprava o jedna vedle při zkracování jména. @@ -237,11 +246,21 @@ twice a day; everything below is on top of that. Our code is marked hardfault record survive a warm reset (`.noinit`); `clkreboot`. * No blinking LED and slower BLE advertising on solar nodes; battery level as an icon at the end of the advertised name (opt-in). +* Optional RX duty cycle (`set radio.rxps`, ported from EasySkyMesh + PowerSaving): the SX1262 sleeps between short listening windows. Built into + the public releases and **off**; `max` saved ~2.3 mA on the bench with no + packet loss ([docs/power.md](docs/power.md)). SX1262 only, not the LR1110 + (T1000-E). ### Sensors and companions * `simple_sensor`: telemetry from an external station over UART (`BudkaLinkSensorManager`, one LPP channel per meter), `sensor read`. +* Sensors that would otherwise convert continuously (INA219, INA226, INA260, + INA3221, BMP280) sleep between telemetry reads and measure on demand (idea + and first INA219 patch: Alkel Brostl). INA chips are told apart by their ID, + so an INA226 is no longer taken for an INA219. The shunt is set at runtime + and saved: `sensor set ina.shunt `. * Companion: `gps duty` persists, key export / PIN gated on an unauthenticated USB link, bounded build-date copy. KISS modem: off-by-one in the name clamp. diff --git a/docs/cli_commands.md b/docs/cli_commands.md index 80f62035..c80447ab 100644 --- a/docs/cli_commands.md +++ b/docs/cli_commands.md @@ -545,6 +545,45 @@ so the icon and the Grafana percentage tell one story. --- +#### View or change the RX duty cycle (rxps) -- CUSTOM (TeTeHacko) +**Usage:** +- `get radio.rxps` +- `set radio.rxps off|on|balanced|max` +- `set radio.rxps level <1-10> [preamble <16|32>]` +- `set radio.rxps max preamble <16|32>` + +The SX1262 sleeps between short listening windows (`SetRxDutyCycle`) instead +of listening all the time, and stays awake through a packet once it hears a +preamble. Ported from EasySkyMesh PowerSaving v18 (IoTThinks). Repeater, room +server and sensor; SX1262 only (an LR11x0 reports `supported=no`). Present +only in builds with `-D WITH_RX_POWERSAVING` (the public releases have it) and +off until you set it; the setting is saved. + +**Parameters:** +- `on` (= `conservative`, level 3), `balanced` (level 6), `max` (level 8): the + higher the level, the longer the sleep. The named presets assume senders + with a 16-symbol preamble (the MeshCore default), so they are safe on a + mixed mesh. +- `level `: the same scale by number; without `preamble` it follows the SF. + 9 (`overdrive`) and 10 (`riskyWorkingMax`) are past the datasheet's timing + condition -- 10 is known to lose packets. +- ` `: raw window lengths. + +`get radio.rxps` shows the requested and the effective state +(`desired=on,effective=armed`), the window lengths and two error counters. If +arming fails three times in a row, the radio falls back to continuous RX by +itself (`effective=continuous`, `fail` counts up). The noise-floor calibration +also runs in continuous RX. + +**Default:** `off` + +**Note:** Measured 12. 11. 2026 on a XIAO nRF52840 + Wio-SX1262 at 5 V +(866.5 MHz / SF8 / BW62.5, A/B/A/B, 15 min cells): `max` saves **~2.3 mA** +(cell repeatability 0.3 mA). A 3-board zero-hop test lost nothing on `max` +(0/120). See `docs/power.md`. + +--- + ### Routing #### View or change this node's repeat flag diff --git a/docs/power.md b/docs/power.md index 3db23982..ae130697 100644 --- a/docs/power.md +++ b/docs/power.md @@ -13,7 +13,7 @@ figures are. | **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 (EasySkyMesh "rxps") | ~2 mA on our SF7 preset | **not worth pre-release code** whose failure mode is a deaf repeater | +| RX duty cycle (`set radio.rxps`, from EasySkyMesh) | **~2.3 mA** at `max` (XIAO, 12. 11. 2026) | opt-in, off by default: worth it on a small panel, 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 | @@ -89,6 +89,39 @@ Bench boards keep both upstream behaviours (`-D RPT_BLE_CONN_LED=1`, 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 (20 rounds, each link witnessed by +another board) lost 0/120 with rxps off, 1/120 at `on` (level 3) and 0/120 at +`max`; rxps stayed armed with no error counts. One loss in 120 is not +distinguishable from chance. 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. + ## MCU sleep `powersaving on` makes the nRF52 wait in WFE between events (it wakes on any