Commit Graph
3558 Commits
Author SHA1 Message Date
Jason Huebert 32b8d4bdf5 ci: list changes since previous release in forced filter builds
Force-build runs left RANGE at HEAD, so the curated 'Filter changes in
this build' section had no lower bound and listed every filter commit
ever made instead of only commits since the channel's previous tag.
Set RANGE to <prev-tag>..HEAD in the forced path when a previous tag
exists; the skip gate is unaffected (forced builds still always build).
filter-v1.17.1-dev.9
2026-09-23 15:33:36 -05:00
Jason Huebert ad3872d3ef fix: bound CLI replies to the real 160-byte reply buffer
All radd() reply writers were bounded to MAX_PACKET_PAYLOAD (184), but the
actual CLI reply buffers are 160 B (serial/ethernet reply[160]) and 161 B
(mesh path: &temp[5] of temp[166]). With 9+ channels, 'filter chan'/'filter
chan list' wrote ~23 bytes past temp[166] and rebooted the repeater; the
same class of bug existed in the token echoes 'Err - expected key=value'
and 'Err - unknown param', reachable via a long mesh admin command.

- CliUtil.h: add CLI_REPLY_MAX (160); bound all radd() callers to it
  (PacketFilter.cpp x5, BatteryGate.cpp x1)
- PacketFilter.cpp: snprintf-bound the two user-token error echoes
- chan list format trimmed to '<idx>:<name>:<hash>' so a full 16-slot
  store fits in one reply
- filter stats reordered (globals first, per-rule hits last) with
  shortened labels so tail truncation sacrifices hits detail, not the
  summary counters
- tests: pin replies to the real buffer for chan list and token-echo
  errors; update stats/chan-list format assertions
2026-09-23 15:29:38 -05:00
Jason Huebert 8b52d7e2f0 Merge branch 'repeater-filter-throttle' into repeater-filter filter-v1.17.1-dev.8 2026-09-22 10:50:23 -05:00
Jason Huebert ab35f0b5e0 feat: per-rule throttle (throttle=N: pass one match per N seconds, decide the excess)
A rule with throttle=N lets at most one matching packet every N seconds
slip past untouched (fall-through, exactly like a failed prob roll); every
other match inside those N seconds triggers the rule's action (default:
drop). Over-rate drops do not extend the window, so a matching stream
sustains exactly one pass per N seconds however hard it is pushed (the
advert rate limiter's model, per rule). One budget per rule: scope the
rule with sender=/chan= to scope the budget.

- FilterRule: u16 throttle (config field) + RAM-only rate state after
  air_ms (travels with the rule on move/del, like hits)
- config v6: the record grows 4 B (u16 throttle + 2 reserved bytes); the
  v4/v5 record is a byte-identical prefix ending at offsetof(throttle) and
  reads back with throttle == 0 (= no limit). The v3 region-wipe and the
  prob-zeroing fixup are now record-exact so migrated v4/v5 rules keep
  their region= list and (from v5) their prob byte. load() accepts v3..v6
  — every version for which record-layout code exists.
- CLI: throttle=1..65535 (integer seconds); filter get echoes
  throttle=N pass=M (pass = within-budget deliveries)
- resetStats() clears pass= but never the rate clock (no free pass)
- Downgrade: pre-throttle firmware reading a v6 file fails the version
  guard and starts with an empty rule/channel set (same as v1/v2 had on
  upgrade)
- FILTER.md: throttle section, slowing-one-sender recipe, shadow-mode note
2026-09-22 10:50:05 -05:00
Jason Huebert 4565f6e871 Merge branch 'repeater-filter-prob-airtime' into repeater-filter 2026-09-21 12:52:12 -05:00
Jason Huebert 2b8c5220a3 fix: honest shadow-probe air wording + guard prob's tail-padding assumption
- FILTER.md claimed a shadow forward probe's hits come with an airtime-saved
  estimate; only DROP decisions bill air_ms, so a probe reads air=0. Say so.
- static_assert that prob fits in the tail padding before hits: a
  FILTER_REGION_LIST_LEN override with a 4-aligned regions end would shift
  hits, change the record size, and silently corrupt v4 config upgrades.
2026-09-21 12:52:09 -05:00
Jason Huebert d7037d1aef feat: saved-airtime telemetry (air, per-rule air_ms)
Every DROP decision bills the packet's estimated time-on-air into the
airtime telemetry: a new RAM-only air_saved_ms counter on FilterRules
(rule drops + rate-limiter drops) and a per-rule air_ms field placed
after hits, where the persist bytes already end - zero persisted bytes,
no version churn.

The estimate comes from the same source mainline bills airtime with:
the hook lines pass _radio->getEstAirtimeFor(packet->getRawLength())
into checkPacket()/checkContent() as a new est_air_ms parameter
(default 0 = unknown, nothing billed). Forward/allow verdicts bill
nothing; a stashed content verdict is billed once, where it decides.

filter stats gains '; air:<ms>' and filter get <idx> shows ' air=<ms>'
after the hit count - the same key on both surfaces - so a drop rule's
worth is visible in RF terms.
2026-09-21 12:43:09 -05:00
Jason Huebert 4d6208b728 feat: per-rule match probability (prob=) for dosing without cutoff
A rule field prob=1..100 makes the rule decide only that percentage of the
packets its predicates match; on a failed roll evaluation falls through to
the next rule exactly as if the predicates had not matched. Unset (default)
behaves as 100%, so existing rules and configs are unchanged.

The roll is deterministic per (packet, rule) - FNV-1a over the packet hash
salted with the rule digest - because rand() is never seeded and the
checkContent verdict stash must not re-roll on the packet-level rescan.

Persistence: prob slots into the tail padding after regions, so the persisted
record size is unchanged; the config version bumps to 5 to mark configs that
carry the field, and v4/v3 configs still load (their prob byte is zeroed).
Config fields sit before hits, so prob is included in the filter list digest.

hits now counts enforced decisions, not predicate matches (a packet passed
on a failed roll is not counted).
2026-09-21 12:33:21 -05:00
Jason Huebert a6e6fbc961 docs: warn against catch-all drop rules that lock out remote admin
First-match-wins means a broad early drop rule can silence the operator's
own remote-admin traffic (login replies ride the flood path). Add a note
under Limits and good-to-knows: admit your own traffic with an earlier
forward rule, and test it while serial access is still available.
2026-09-21 12:33:21 -05:00
Jason Huebert 799d287370 Merge remote-tracking branch 'fork/repeater-filter' into repeater-filter filter-v1.17.1-dev.7 2026-09-21 09:20:48 -05:00
Jason Huebert f1db70dfbf Merge branch 'filter-forward-action' into repeater-filter 2026-09-21 09:20:06 -05:00
Jason Huebert 931cce0137 fix: filter move no-op reply said 'no such rule' for valid indices
filter move N N rejects the no-op, but both indices are valid rules, so
the error message was misleading. Reply that source and target are the
same rule instead.
2026-09-21 09:17:33 -05:00
github-actions[bot] 69eb0e934a Merge remote-tracking branch 'origin/dev' into repeater-filter filter-v1.17.1-dev.6 2026-09-21 14:04:08 +00:00
Jason Huebert 040d191924 ci: normalize force_build boolean passed to filter-build
On schedule events the workflow_dispatch 'inputs' context is empty, so
${{ inputs.force_build }} evaluated to an empty string. Passing '' into
the reusable workflow's boolean input failed at job creation: the run
went red after the sync job with no build jobs created. Compare against
true instead so the expression always yields a concrete boolean.
2026-09-21 09:03:41 -05:00
fdlamotte f4ae72dc12 Merge pull request #3436 from Blake-Latchford/wio-e5-fix
WIO-E5 Fix: Pin Radiolab for stm32 and replace ltoa
2026-09-21 05:50:12 -04:00
github-actions[bot] b8c61e699e Merge remote-tracking branch 'origin/dev' into repeater-filter 2026-09-21 09:13:42 +00:00
ripplebiz 65737d48f4 Merge pull request #3402 from meshcore-dev/sensor-improvements
Sensor improvements
2026-09-21 19:03:18 +10:00
fdlamotte f8f9bd4daf Merge pull request #3463 from fdlamotte/thinknode_m4
Thinknode m4
Doing the merge now as it doesn't touch anything outside its own variant dir and its board file ;)
2026-09-20 16:22:47 -04:00
Florent 8bf072a6f0 M4: Handle poweroff 2026-09-20 16:13:15 -04:00
Florent 0a15c487d8 m4: inital port 2026-09-20 15:25:18 -04:00
Blake Latchford 12a8c8d4d4 Add missing include, and revert removal of lota 2026-09-20 15:16:33 -04:00
Liam Cottle 0886259701 Merge pull request #3108 from tjdownes/muzi-base
Add Muzi Base board support (Duo + Uno + SuperIO)
2026-09-20 22:56:32 +12:00
TJ Downes 114cf9f4fc Use the default BLE TX power on Muzi Base
Drop BLE_TX_POWER=0 from the companion envs so they use the default of
4 dBm, like most other variants. The lower power was carried over from
the original Base Duo PR and real-world range is better at the default.
2026-09-20 03:46:25 -07:00
ripplebiz b37e7dd955 Merge pull request #3431 from meshcore-dev/abstract-ui-overhaul
Abstract UI overhaul
2026-09-20 18:08:29 +10:00
TJ Downes 798ce636df Address review feedback on Muzi Base support
- rename the board class and files to MuziBaseBoard
- uppercase the build flags (MUZI_BASE, MUZI_BASE_SUPERIO)
- name the superIO envs muzi_base_{duo,uno}_superIO_companion_radio_ble so
  build.sh picks them up
- set MAX_CONTACTS to 350 like the other variants
- move the pin setup from initVariant() into MuziBaseBoard::begin()
2026-09-19 21:47:24 -07:00
Liam Cottle 4d9a292084 Merge pull request #3459 from liamcottle/board/thinknode-m7-wifi
Add wifi support to ThinkNode M7 BLE variant
2026-09-20 15:25:08 +12:00
liamcottle 4021a341f8 add wifi support to thinknode m7 ble variant 2026-09-20 15:11:21 +12:00
Liam Cottle fac7bf5dd3 Merge pull request #3458 from liamcottle/cli/wifi-pwd
Allow fetching configured wifi password via companion cli
2026-09-20 14:34:48 +12:00
liamcottle 73afe3a0f5 allow fetching configured wifi password via companion cli 2026-09-20 14:22:13 +12:00
fdlamotte 2c700d1689 Merge pull request #3449 from IoTThinks/MCdev-KeepLEDOffBeforePowerOff-20260919
Off LED before powering off for repeaters
2026-09-19 15:06:17 -04:00
Jason Huebert 76d276172e docs: drop section numbers from BATTERY.md headings 2026-09-19 12:02:34 -05:00
Jason Huebert e2c46a2791 fix: replace stash age guard with content-hash identity
The content-verdict stash keyed a packet by raw pointer plus a 500ms age
tag. A lingering drop verdict (checkPacket is never called for dropped
packets) could pointer-match a pool-reused buffer within the window and
serve its stale verdict to an unrelated packet.

Tag the stash with the packet's content hash (calculatePacketHash, the
same primitive core uses for seen-dedup) and consume only on pointer AND
hash match. Identity is now exact instead of heuristic; any mismatch
clears the stash and runs the normal packet-level scan.
2026-09-19 11:56:25 -05:00
Jason Huebert 6933c2213b feat: terminal forward action, single-pass rule evaluation, filter move
- rename the logonly action to forward (same stored byte value, so persisted
  configs load identically in both directions; CLI accepts only drop|forward)
- single-pass whole-rule evaluation: for decrypted group packets the entire
  rule list runs once, in listed order, at content time (checkContent);
  checkPacket consumes a pointer+age-tagged verdict stash instead of running
  an independent second scan (fixes the two-pass ordering surprises)
- new 'filter move <from> <to>' CLI command (rule ends up AT the target
  index, hits travel with it); usage line updated
- CLI surface: list digest letters D/F, get prints forward
- FILTER.md: evaluation-order explanation, shadow-mode probe placement,
  allowlist-within-a-channel setup, behavior-change and downgrade notes
- 28 new native tests (159 total, all green)
2026-09-19 10:24:41 -05:00
Scott Powell 64434c5326 * misc 2026-09-19 20:13:18 +10:00
Kevin Le c425648bfc Off LED before powering off for repeater 2026-09-19 11:26:42 +07:00
Scott Powell 843598724c * fix for X1 2026-09-18 19:03:20 +10:00
Liam Cottle 166f75c1b6 Merge pull request #3442 from liamcottle/feature/companion-cli-commands
added reboot, shutdown and poweroff to companion cli commands
2026-09-18 18:25:33 +12:00
liamcottle 242e401a2c added reboot, shutdown and poweroff to companion cli commands 2026-09-18 18:17:52 +12:00
Blake Latchford 8d2a5657ac Pin Radiolab for stm32 and replace ltoa
The major rev from 19.x to 20.x breaks Radiolab, so pin it for now. This should fix the failing wio-e5-mini_repeater builds.

ltoa is removed upstream, so it was replaced with snprintf. The p[] buffer is always 16 bytes. Copy/paste for why claude thinks this is fine below, but also if this is broken it wouldn't be new.
```
exp2 in [23, 30] (int_part = mantissa << (exp2 - 23)): this is where int_part can reach its true max, up to 2,147,483,520 — 10 digits. That's what the snprintf bound of 11 (10 digits + NUL) is sized for. But in this branch frac_part is never assigned anything other than its initial 0, so only *p++ = '0' runs for the fraction — 1 char, not 7.

exp2 in [0, 22] (int_part = mantissa >> (23 - exp2)): this is the only branch where frac_part can also be nonzero and enter the 7-digit loop. Here int_part < 2^23 by construction, so it's capped at 7 digits, never 10.
```
2026-09-17 22:12:53 -04:00
Liam Cottle 3244e3ec13 Merge pull request #3382 from Blake-Latchford/wifi-disconnect-reason-logging
Extend WiFi disconnect logging to specify reason
2026-09-18 12:01:30 +12:00
Blake Latchford 1077331e31 Extend WiFi disconnect logging to specify reason
Today if a user builds firmware with an incorrect WiFi SSID or password,
they get a generic `WiFi disconnected.` error message.

Extend logging to descirbe the reason that WiFi was disconnected.

I gathered the updated logs for the 3 scenarios below.

```
WiFi: Attempting manual WiFi reconnect...
WiFi: WiFi disconnected (reason=ASSOC_LEAVE). Flagging for reconnect...
WiFi: WiFi disconnected (reason=4WAY_HANDSHAKE_TIMEOUT). Flagging for reconnect...
WiFi: WiFi disconnected (reason=4WAY_HANDSHAKE_TIMEOUT). Flagging for reconnect...
WiFi: WiFi disconnected (reason=4WAY_HANDSHAKE_TIMEOUT). Flagging for reconnect...
```

```
WiFi: WiFi disconnected (reason=NO_AP_FOUND). Flagging for reconnect...
```

```
WiFi: WiFi connected successfully!
WiFi: Got connection
```
2026-09-17 19:39:51 -04:00
github-actions[bot] 7f797b4435 Merge remote-tracking branch 'origin/dev' into repeater-filter filter-v1.17.1-dev.5 2026-09-17 23:03:54 +00:00
Jason Huebert 26b619b3e5 Merge branch 'docs/filter-examples-tinyregex' into repeater-filter
Plain-language rewrite of FILTER.md: quick start, common setups, clarified
rule indexes and status-line formats, and documented filter list tokens.
2026-09-17 16:02:52 -07:00
Jason Huebert 583ac2a0ba docs: document the filter list per-rule token format
Decode the on N/16 token: index, enabled flag, drop/logonly flag, and
the 12-bit content digest, and note the digest doubles as a change
indicator.
2026-09-17 16:01:32 -07:00
Jason Huebert 4d5a8c8bdf docs: clarify rule indexes, status lines, and wildcard basics in FILTER.md
- State that rule commands take a 0-based index (printed by filter add)
  and that the short code shown by filter list is display-only
- Decode the filter/filter list status line formats
- Note 0-based numbering in Quick start; give a delete re-indexing example
- Add a contains/starts-with/exactly mini-table to the sender/text section
2026-09-17 15:55:47 -07:00
Jason Huebert d84c4f00df docs: drop section numbers and use markdown anchors in FILTER.md
Replace numbered headings and § cross-references with named headings
and intra-document links, and replace the multi-region drop recipe with
an exclude-one-region-from-one-channel example (keeping the unscoped
example).
2026-09-17 15:48:24 -07:00
Jason Huebert dcdd3c35dc docs: rewrite FILTER.md as a plain-language user guide
Restructure for operators who don't need code internals: lead with a
quick start and common setups, move per-condition examples and the
pattern-language reference behind them, and compress implementation
detail (evaluation phases, byte/symbol budgets, storage internals) into
short good-to-know notes. Examples now use the default drop action;
logonly is documented once in a dedicated shadow-mode section.
2026-09-17 15:25:32 -07:00
Jason Huebert 573dbeebd5 docs: expand FILTER.md with per-predicate examples and TinyRegex guide
- Section 2: make AND-within-rule vs comma-list OR vs separate-rules
  semantics explicit, with a worked match/non-match table and notes on
  first-match ordering within each evaluation phase
- Section 7: add example tables for every predicate key (type, route,
  hops, len, snr, path, hsize, chan, chanhash, region, sender, text)
  plus action/enable/stats controls, boundary cases, and common pitfalls
- Section 11 (new): TinyRegex reference - supported syntax, unsupported
  constructs vs JavaScript/Python/PCRE/POSIX, migration recipes, CLI
  quoting and host-language escaping, UTF-8 byte semantics, limits,
  fail-open behavior, and troubleshooting
- Correct limit documentation: usable pattern lengths (23/47 bytes),
  29-symbol compile budget, class-buffer limit, and \s semantics
2026-09-17 10:20:53 -07:00
Scott Powell b3b17025e3 * more MyMesh::Listener interface hooks 2026-09-17 17:33:36 +10:00
Scott Powell 30dd723c26 * MyMesh::begin() refactor, removing last display concepts 2026-09-17 14:25:41 +10:00