Commit Graph
3352 Commits
Author SHA1 Message Date
Jason Huebert 3aa4d48ee5 simple_repeater: sample advert cache key from pubkey middle bytes
Vanity pubkeys are ground to match at the leading bytes (c0ffee,
deadbeef), and sometimes at trailing bytes, so contiguous prefix keys
collide far above random chance within a vanity club — worst case,
every repeater sharing a 4-byte vanity shares one cache entry, and the
least-frequent advertiser gets suppressed indefinitely.

Sample the 4-byte key at fixed offsets {8,14,20,26}, clear of the
vanity zones at both ends: grinded keys stay uniformly random there,
restoring ~2^-32 pairwise collision odds. No RAM change (same 8-byte
entry); the cache is RAM-only so there is no config-format impact.
2026-10-05 10:46:04 +00:00
Jason Huebert 3976cc5087 simple_repeater: shrink filter RAM (advert prefix, channel hash)
Two no-loss-of-function storage reductions, -1520 B measured on all
targets (fork total 6734 -> 5214 B):

- AdvertSeenEntry pubkey prefix 6 -> 4 bytes: entry drops from 12 to
  8 B (padding gone). Prefix collisions are a ~0.001% chance per 256
  distinct nodes; worst case is one falsely suppressed advert per
  window. The cache is RAM-only, so no config-format impact.
- FilterChannel.hash 32 -> 1 byte: core's GroupChannel.hash is
  PATH_HASH_SIZE (1) and only hash[0] is ever compared or copied
  (same pattern as stock BaseChatMesh); Utils::sha256 truncates to
  hash_len. Saves 31 B per channel entry.

Config format comment updated to cover both v3 layout changes.
2026-10-05 10:46:04 +00:00
Jason Huebert f123701d7e simple_repeater: double keyed channel store to 16 entries
chan_mask was one bit per channel and one byte wide, capping the store at
8. Widen it to 16 bits (guard, delChannel remap arithmetic, ~128 B per
rule slot) and double FILTER_MAX_CHANNELS to 16 (+712 B RAM, verified
across nRF52/RP2040/ESP32 targets). Config format v3: older configs are
discarded on upgrade.
2026-10-05 10:46:04 +00:00
Jason Huebert e6cb14f9b2 simple_repeater: fix TinyRegex matching of bytes >= 0x80
matchone() compared the pattern char (unsigned char) against the subject
char (signed char), so any byte >= 0x80 promoted to different values and
never matched. All multi-byte UTF-8 (emoji, accented characters) in
sender/text regex patterns silently failed to match; ASCII was unaffected.

Compare as unsigned char so literal UTF-8 sequences match byte-for-byte.
Document the byte-wise matching semantics in FILTER.md and note the
divergence in TinyRegex.h.
2026-10-05 10:46:04 +00:00
Jason Huebert 8ec7457bd1 simple_repeater: keep stats out of the filter config file
/filter_cfg previously stored raw FilterRule structs, which included the
per-rule hits counter: a config change saved whatever the counters were
at that moment, and a reboot restored stale counts. Persisting stats was
never intended - only configuration belongs in the file.

Rule records on disk now end at the hits field (offsetof(FilterRule,
hits)); counters and the advert cache are RAM-only and reset on reboot.
Format version bumped to 2; version-1 files are discarded on load.
FILTER.md updated to match.
2026-10-05 10:46:04 +00:00
Jason Huebert a017721981 Add FILTER.md: documentation for the repeater packet filter
Describes the rule model and evaluation phases (packet-level vs
decrypted-content), the keyed channel store, the per-origin advert rate
limiter, persistence, the full 'filter ...' CLI with predicate syntax,
use-case walkthroughs, remote administration, and behaviour notes.
2026-10-05 10:46:04 +00:00
Jason Huebert 600e92563a simple_repeater: remap filter rule channel masks on channel delete
delChannel() shifts the channel store down one slot, but rule chan_mask
bits were left untouched, so rules silently retargeted the wrong channels
after deleting any channel below them (and kept a dangling bit for the
deleted slot itself). Now the deleted channel's bit is dropped and masks
above the deleted slot shift down to match the store.

Found during on-device testing: a rule 'chan=#zC' became 'chan=#zB'
after deleting '#zA'.
2026-10-05 10:46:04 +00:00
Jason Huebert 7122eafc66 simple_repeater: reject interval endpoints above int16 range
Interval endpoints are stored as uint16 but compared via int16_t casts
(negative quarter-dB SNR shares the representation); cap non-SNR values
at 32767 so out-of-range values are rejected at 'filter add' time
instead of wrapping.
2026-10-05 10:46:04 +00:00
Jason Huebert 2e296c11c0 simple_repeater: add remote-configurable packet filter (fork feature)
Adds a personal-fork packet filter to the simple_repeater firmware:
configurable drop/logonly rules over the repeater CLI, evaluated at
MyMesh::allowPacketForward() and onGroupDataRecv().

- PacketFilter.h/.cpp: rule model (type/route/hops/len/snr/chanhash/
  path/hashsize packet-level predicates; keyed-channel, sender-regex and
  text-regex content predicates evaluated on MAC-verified decrypted group
  payloads), keyed channel store (Public pre-provisioned; '#' channels
  auto-provisioned from sha256(name)[0..15]), per-node advert rate limiter
  (RAM-only 6-byte pubkey-prefix cache), /filter_cfg persistence, and the
  'filter ...' CLI (list/get/add/del/enable/disable/clear/chan/ratelimit/
  stats, all replies within the 160-byte CLI buffer).
- PacketFilterConfig.h: build-time tunables (rule/channel/cache counts,
  pattern lengths) with #ifndef defaults.
- TinyRegex.h/.cpp: vendored kokke/tiny-regex-c (public domain) with a
  backtracking step budget; fail-open on exhaustion, aborts counted in
  'filter stats'.
- MyMesh.h/.cpp: minimal hook lines only (one checkPacket call, two
  virtual overrides, one CLI dispatch line, begin/loop save wiring).

All fork-owned logic lives in new files; no changes to src/.
2026-10-05 10:46:04 +00:00
Liam Cottle a366955cb2 Merge pull request #3528 from liamcottle/docs/radio-presets
Add documentation for radio presets
2026-09-30 14:56:20 +13:00
liamcottle a11009f2df add radio preset docs 2026-09-30 14:52:58 +13:00
Liam Cottle e94125987e Merge pull request #3445 from mojoaxel/patch-1
docs: fix frame format tables
2026-09-20 10:26:16 +12:00
Alexander Wunschik 448d1b2239 docs: fix frame format tables 2026-09-18 16:59:26 +02:00
Liam Cottle 0679dbeffc Merge pull request #3282 from recrof/patch-3
FAQ: Fixed instructions on wiping and resetting nrf52 devices
2026-08-24 19:49:40 +12:00
Rastislav Vysoky acac4af3ec FAQ: Fixed instructions on wiping and resetting nrf52 devices 2026-08-23 20:13:12 +02:00
Scott Powell d929643524 * version 1.17.1 companion-v1.17.1 room-server-v1.17.1 repeater-v1.17.1 2026-08-14 22:19:19 +10:00
Huw Duddy 24bdc24b39 Merge pull request #3206 from meshcore-dev/nrf-combine-rng-entropy
combine radio's entropy with CC310 RNG
2026-08-14 22:09:26 +10:00
Scott Powell fcb9bdf209 * combine radio's entropy with CC310 RNG 2026-08-14 17:46:43 +10:00
Huw Duddy 50a51a6479 Merge pull request #3203 from meshcore-dev/companion-fem-pref-fix
commenting out the load/save of the fem_ properties
2026-08-14 16:44:59 +10:00
Scott Powell e78bff0041 * unit test no longer valid 2026-08-14 16:42:54 +10:00
Scott Powell 890a2e2cff * commenting out the load/save of the fem_ properties, until they can be set 2026-08-14 16:30:12 +10:00
ripplebiz b09cb27a1f Merge pull request #3106 from ViezeVingertjes/fix/scoped-reply-routing
Fix replies dropped when flood.max.unscoped is low
2026-08-13 15:00:37 +10:00
ripplebiz abd3546d75 Merge pull request #3189 from oltaco/nrf52-unused-pin-sweep
Fix unused pin definitions on some NRF52 boards
2026-08-13 13:48:59 +10:00
taco 7cd1d207af Fix LilyGo T-Echo Lite SPI pins 2026-08-13 00:53:58 +10:00
taco c2a4ef082f Fix Heltec MeshPocket SPI pins 2026-08-13 00:15:34 +10:00
taco 3ea541f1f2 Fix Heltec T1 pin definitions
SPI pins that are set to -1 cause OOB reads on NRF52. The unused Serial2 pin definitions were removed to avoid potential issues with the Uart framework.
2026-08-13 00:12:37 +10:00
ripplebiz e9edfc8e1a Merge pull request #3188 from oltaco/heltec-t096-pin-fix
Fix Heltec T096 Tx issue
2026-08-12 23:00:31 +10:00
taco 49d9f9a839 Heltec T096: fix PIN_SPI1_MISO
Setting SPI pins to values that are OOB of the g_ADigitalPinMap[] array causes OOB reads. This variant.h has pin 0 as 0xFF which passes through as NRFX_SPIM_PIN_NOT_USED.
2026-08-12 22:31:57 +10:00
taco f43e1cde89 Revert "t096 compiler layout workaround"
This reverts commit 9c60f9696e.
2026-08-12 22:28:36 +10:00
taco 264d778168 Revert "T096 PA_CTX pin direction workaround"
This reverts commit 82de18fb0e.
2026-08-12 22:28:05 +10:00
ripplebiz 956094b271 Merge pull request #3185 from oltaco/fix-techo-card-txco-voltage
Set T-Echo Card TCXO voltage to 3.0
2026-08-12 18:13:44 +10:00
ripplebiz a4ab7f0e59 Merge pull request #3137 from agessaman/feat/station-g3-fem-prefs
Station G3: Expose, persist, and apply FEM gain preferences
2026-08-12 16:11:23 +10:00
taco 9d6dcc673e set T-Echo Card TCXO voltage to 3.0
as per https://github.com/meshcore-dev/MeshCore/pull/3140 and https://github.com/Xinyuan-LilyGO/T-Echo-Lite/issues/14
2026-08-12 16:08:05 +10:00
ripplebiz 1cb308b694 Merge pull request #3182 from oltaco/t096-tx-workaround
Workaround for Heltec T096 transmit issue
2026-08-12 14:49:32 +10:00
taco 82de18fb0e T096 PA_CTX pin direction workaround 2026-08-12 14:07:31 +10:00
taco 9c60f9696e t096 compiler layout workaround
see https://github.com/meshcore-dev/MeshCore/issues/3151
2026-08-12 14:04:50 +10:00
ripplebiz e027263d1e Merge pull request #3154 from fdlamotte/nrf52_hwcrypto_init
nrf52: call nRFCrypto.begin()/end() only once
2026-08-12 12:14:21 +10:00
Huw Duddy 34ad059afb Merge pull request #3170 from recrof/promicro-pin-tidy-up
[promicro] make pinmap more tidy, move the LoRa pins to variant.h
2026-08-11 18:43:20 +10:00
Rastislav Vysoky 5cce5cfe97 removed misleading 'GPIO' from pin numbers 2026-08-11 10:37:20 +02:00
ripplebiz fbef2ff0dc Merge pull request #3164 from weebl2000/fix-tbeam-s3-display
Fix display issues on T-beam Supreme S3
2026-08-11 14:39:39 +10:00
agessaman e2aa7b98f9 feat(companion_radio): add external FEM gain preferences for RX and TX for companions
Introduced consistent preferences for external LoRa FEM RX and TX gain settings in NodePrefs. Updated companion MyMesh to apply these settings during initialization and transmission. Added unit tests to verify the round-trip serialization of these new preferences.
2026-08-10 11:59:26 -07:00
Rastislav Vysoky a82dc1b9da make promicro pinmap more tidy, move the LoRa pins to variant.h 2026-08-10 20:13:59 +02:00
Liam Cottle 9d8894e166 Merge pull request #3166 from recrof/debug-noise-floor-flag
move RadioLibWrapper noise_floor level message under special debug flag
2026-08-11 03:07:31 +12:00
Rastislav Vysoky 3138ad99ba move RadioLibWrapper noise_floor level message under special debug flag 2026-08-10 16:56:56 +02:00
Wessel Nieboer 32bd6d48d6 Fix T-beam Supreme S3 display 2026-08-10 13:39:16 +02:00
Huw Duddy f6c25e6a25 Merge pull request #3158 from mepholic/bug/fix-rxgain-setting-post-agc-reset
Fix RX Boosted Gain setting after AGC reset is triggered
2026-08-10 17:31:38 +10:00
ripplebiz 9941669fd5 Merge pull request #3142 from oltaco/buildfix-userbtn
Build fix for R1 Neo and Minewsemi repeater
2026-08-10 13:30:24 +10:00
ripplebiz 0d60de6fa6 Merge pull request #3146 from oltaco/lr2021-preamble-and-irq-timeout
LR2021: add PREAMBLE_DETECTED bit and IRQ timeout logic
2026-08-10 13:29:12 +10:00
Dan Theisen 6f491f3033 RX Boosted Gain was set back to the compiled in value rather than the current/flash value set by the user when the ACG reset is triggered. This commit fixes this. 2026-08-09 18:11:35 -07:00
Florent ecb8c94560 nrf52: call nRFCrypto.begin()/end() only once 2026-08-09 14:46:23 -04:00