Jason Huebert 2ee4d29fce fix(filter): bracket the content verdict, gate content on the battery, and
start advert windows on admission

Three receive-path defects, all about state that outlived the operation that
produced it.

The content verdict stash was cleared only inside `if (content_verdict.pkt ==
pkt)`, so a verdict for a packet that never reached the forwarding hook — dropped
earlier, or on a path that skips forwarding — lingered until some later packet
reused that buffer. It is now consumed unconditionally in checkPacket(), and
MyMesh::onRecvPacket() brackets one whole receive with clearContentVerdict() on
both sides, which is what actually bounds its life. The pointer+hash guard stays
as defence in depth against pool reuse. Any rule or channel mutation clears it
too (markDirty() is the one place they all pass through), as do enable toggles
and reload, so a verdict can never be honoured under a rule list it was not
decided under.

The battery gate outranked the filter only for packets that could not be
decrypted. Decryptable group traffic ran the content rules and banked hits and
airtime while a suspended repeater was refusing to relay it, and could spend a
content throttle's free-pass budget — two different stories for one suspension.
onGroupDataRecv() now returns early while suspended, so the packet is accounted
as a battery drop at forwarding admission, once. Battery sampling also moved
before Mesh::loop(), so a receive that crosses a sampling boundary sees that
loop's reading rather than the previous one. No per-packet ADC read was added.

The advert rate limiter recorded a node's window inside the check, which runs
before every stock forwarding check — so a repeater left in `set off`, or
refusing adverts for hop-limit, unknown-region or loop reasons, silently stopped
relaying those nodes for the rest of the 48 h window. drop() is split into
wouldDrop(), which only answers, and recordForward(), called from
onForwardAllowed() at the successful end of allowPacketForward(). The window now
means "relayed", not "received". FILTER.md says so, including the honest limit
that a queued advert that never reaches the air still counts as admitted.

Existing limiter tests assumed check implied commit, which was true before and
would have silently tested nothing after. They now drive a forwardPacket()
helper that mirrors the real hook: check, then commit only on survival.

369 cases green across all four native envs, 315 clean under sanitizers, all four
firmware targets compile, RAM unchanged at 20.6%.
2026-10-09 18:28:45 +00:00
2026-04-28 21:39:34 +10:00
2026-09-30 14:52:58 +13:00
2025-01-13 14:07:48 +11:00
2025-06-05 20:35:40 +12:00
2026-08-13 00:53:58 +10:00
2026-02-03 13:47:43 +13:00
2026-03-23 14:26:56 +01:00
2025-01-20 10:20:42 +11:00
2025-01-25 23:09:09 +11:00
2026-03-31 00:51:15 +13:00
2026-10-05 10:46:04 +00:00
2025-03-03 18:08:00 +13:00
2026-06-05 21:25:25 +12:00

MeshCore — Repeater Firmware with a Remote-Configurable Packet Filter

This is a feature fork of MeshCore. It tracks upstream automatically (synced weekly) and adds two repeater-focused capabilities on top of stock firmware. Everything else — supported boards, clients, protocols, build system — is identical to upstream; see the upstream README for the general project, hardware support, and getting-started guide.

What this fork adds

📡 Packet filter

A remote-configurable drop-rule engine for the simple_repeater firmware. Rules match on packet type, route type, region, hop count, channel, and — on decrypted payloads — channel identity and sender/text patterns. Rules are managed over the repeater CLI, locally via serial or remotely over the mesh by an authenticated admin. No rebuild, no physical access.

Independently of the rules, flood-route adverts can be rate-limited per originating node: each node's advert is forwarded at most once per window (up to 30 days), taming advert storms on busy channels while every node stays discoverable.

→ Full guide, including the complete predicate reference and CLI commands: FILTER.md

🔋 Battery gate

A configurable low-battery cut-off: below a set voltage the repeater stops forwarding (but stays reachable and keeps advertising); when the battery recovers it resumes automatically. Debounce + hysteresis keep it from flapping, and the admin can check voltage and tune thresholds over the mesh.

→ Full guide: BATTERY.md

Why run this instead of stock repeater firmware?

Stock repeaters forward everything they hear, until the battery dies. This fork is for operators who want policy and resilience at the node:

  • Shared / community nodes — mute noisy senders or channels that eat your airtime, without asking anyone to change their setup.
  • OpenHop-style policy, nothing extra to run — the rule engine is modelled after the policy filters in OpenHop and lives entirely in the repeater firmware, so you get about the same functionality with just the node itself — no computer, companion app, or other hardware needed.
  • Solar / off-grid sites — the node goes quiet while it can still answer you, instead of disappearing dark, and wakes itself when there's sun again.

Getting the firmware

Prebuilt binaries for all supported boards are on the Releases page. Two channels:

Channel Branch Based on Tags
dev repeater-filter upstream dev (merged weekly by CI) filter-v*-dev.N
stable repeater-filter-stable upstream main releases filter-v*

Flash as you would stock firmware, then follow FILTER.md to set your first rules over the CLI.

S
Description
No description provided
Readme MIT
21 MiB
0 Stars 1 Watchers 0 Forks
Languages
C++ 52.7%
C 44.3%
Python 1.9%
Shell 1%