Jason Huebert e152803eea fix(persistence): back off a failed save and time both configs in 32 bits
After a failed save due() stayed true on every loop iteration, so a full or
failing filesystem was opened, truncated and removed at firmware-loop speed.
LazySave now has three named operations: clear() for a confirmed write,
retryLater() to stay dirty but wait out another full delay, and reset() to drop
pending work when a reload or a reset-to-defaults supersedes it. load() calls
reset() in both configs, so an edit cannot outlive the file it was meant for.

Timestamps are uint32_t with elapsed time computed in uint32_t. The host's
unsigned long is 64-bit, so writing these fields as unsigned long meant host
tests could not model the wrap the MCU actually has — the wrap tests below were
meaningless before this change.

Battery sampling no longer stores an absolute deadline with 0 as an
"unarmed" sentinel, which conflated a wrapped deadline with an unarmed timer.
It keeps last_sample_ms plus an explicit sample_pending, samples at most once per
loop (never twice to catch up missed intervals), arms on the first loop, re-arms
when thresholds are set or the gate is enabled, and disarms when it is turned
off. The two-consecutive-reading debounce and the immediate first sample are
unchanged; only resume still takes a single reading, as before.

The native shim gained the fault injection R16 anticipated: fail_open, fail_write
and a write-open attempt counter, so the retry cadence is asserted rather than
inferred from whether a file appeared.

Note: PlatformIO does not track the force-included NativeShim.h as a
dependency, so a change to a struct it defines can leave stale test objects.
Cleaning the two native envs before running is the reliable path.

341 cases green across all four envs, 287 clean under sanitizers, Xiao_S3_WIO and
RAK_4631 compile with RAM unchanged at 20.6%.
2026-10-03 13:29:42 -05:00
2026-04-28 21:39:34 +10:00
2026-09-20 15:25:18 -04:00
2025-01-13 14:07:48 +11:00
2025-06-05 20:35:40 +12: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
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++ 56.4%
C 40.9%
Python 1.7%
Shell 0.9%