Repository navigation
feat(companion): DMC companion receive filter - #18
Merged
Merged
Conversation
Move the repeater filter's malformed-text scan (validMessageContent, isValidUTF8) into the header-only MessageContent.h, and its sender/text rule add/remove, path-prefix add/remove and `filter age` argument parsing into SenderRules.h, PathBlock.h and MessageAge.h. Filter.cpp now delegates to them with unchanged signatures, replies and behaviour. This makes the logic usable by the companion receive filter and testable on the native env.
A `filter` CLI on the companion firmware that keeps junk and unwanted channel traffic out of the app: malformed group text, group text older than N minutes, floods relayed by a blocked repeater prefix, and sender or text rules (block, throttle, dose) reusing the repeater rule engine. Junk (malformed, age, path) is dropped before the mesh handles it, so a companion with repeat enabled does not repeat it either. Sender and text rules only hide: the message is still repeated, so one user's mute list never censors the mesh. Direct and addressed traffic is never filtered. Settings persist as JSON in /cfilter.json; off by default. The shared MyMesh files only gain one-line calls into CompanionFilterHook.cpp.
meshcomod keeps identity, contacts, channels and blobs in the same files
and formats, and its binary /new_prefs is already migrated by upstream's
loadPrefs(). Three things were still lost or garbled on the first boot:
- the hardware-CAD toggle, a trailing byte (141-byte file);
- on files from meshcomod v1.16 and older (136 bytes, no gps_interval),
auto-add, RX boost and the default flood scope, which upstream's layout
reads 4 bytes off;
- the Wi-Fi credentials, which meshcomod keeps in NVS ("meshcomod").
importMeshcomodSettings() runs once, only while /prefs.json does not yet
exist, lets upstream migrate, then applies those fields. NVS is read-only
and Wi-Fi is only imported into an empty SSID.
This was referenced Oct 16, 2026
Elektr0Vodka
added a commit
that referenced
this pull request
Oct 16, 2026
…ion-snmp-ota feat(companion): SNMP, pull OTA and MAC commands (stacked on #18)
Elektr0Vodka
added a commit
that referenced
this pull request
Oct 19, 2026
…filter limiters, true TX duty, SenseCAP GPS) into dmc-dev-packetlog
Elektr0Vodka
added a commit
that referenced
this pull request
Oct 19, 2026
…filter limiters, true TX duty, SenseCAP GPS) into dmc-observer-dev Conflict resolutions: - Dispatcher.h, build.sh: kept observer (radio watchdog; observer build.sh already emits partsig for every ESP32 env). - CommonCLI.cpp: kept observer's /mqtt.json-gated legacy migration, then the GPS_DEFAULT_ON apply; dropped the obsolete "old default 70" comment now that the prefs key is dc_gate_duty. - variants/sensecap_solar: took dmc-dev (ENV_INCLUDE_GPS + GPS_DEFAULT_ON). The observer's -UENV_INCLUDE_GPS came from the old bulk revert 22eb9b8, not a deliberate choice. - platformio.ini native env, docs/cli_commands.md: took dmc-dev additions.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a DMC receive filter to the companion firmware, so a companion can hide junk and unwanted channel messages before they reach the app. Off by default (
filter onto enable).MessageContent.h,MessageAge.h,PathBlock.h,SenderRules.h), so repeater and companion parse rules and format replies identically.CompanionFilter.cpp/.h,CompanionFilterHook.cpp): hooked viafilterRecvFloodPacketandonChannelMessageRecv. Malformed / age / path = drop (not shown, not repeated); sender / text = hide (not shown, still repeated in client-repeat mode). Flood traffic only; DMs are never touched. Settings in/cfilter.json. Commands work over USB serial, the app's CLI frame and remote CLI.MeshcomodImport.cpp): keeps radio/CAD prefs (both 141-byte and older 136-byte layouts) and Wi-Fi credentials from meshcomod's NVS when upgrading with the app.bin.docs/companion_filter_reference.md, CLI pages, dmc-docs (nl/en/de) custom CLI + migration.Needed for the
companionoption on the DMC Firmware Release button (#19), which builds every*_companion_radio_bleand*_companion_radio_wifienv fromdmc-dev.Verification
pio test -e native: all 13 suites pass, incl. newtest_companion_filterandtest_meshcomod_import.🤖 Generated with Claude Code