Repository navigation
Expose companion repeat mode and stop radio-parameter updates clearing it - #363
Open
garrett-livefront wants to merge 2 commits into
Open
garrett-livefront wants to merge 2 commits into
garrett-livefront wants to merge 2 commits into
Conversation
…ring it Firmware CMD_SET_RADIO_PARAMS persists repeat=0 when the trailing repeat byte is absent, so every freq/bw/sf/cr change silently turned repeat mode off. Cache the repeat flag from DEVICE_INFO (fw ver >= 9), resend it on every set_radio, and expose it as repeat_enabled / repeat_supported on /api/radio/config. A repeat-only PATCH reuses the current radio params. Also query the firmware's compiled-in allowed repeat frequencies at connect (best-effort) and expose them as allowed_repeat_freqs. set_radio results are now checked; a firmware ERR returns 422, quoting the node's allowed frequencies when known. Refs: jkingsman#362 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Show a "Repeater Mode" checkbox in the Radio Parameters section when the firmware reports repeat_supported, send repeat_enabled only when it changes, and carry it through config export/import. When the node reports its allowed repeat frequencies, list them in a compatibility warning and disable the checkbox while the entered frequency is outside them. Refs: jkingsman#362 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.
Fixes #362.
The problem
MeshCore companions carry a "repeat" flag (the repeater-mode checkbox in the official app). The firmware sets it from the trailing byte of
CMD_SET_RADIO_PARAMSand treats a missing byte asrepeat = 0, then persists it.apply_radio_config_updatecalledset_radio(freq, bw, sf, cr)without that byte, so every frequency / bandwidth / SF / CR change made through RemoteTerm silently turned repeat mode off on a node that had it enabled. There was also no way to see or set the flag from RemoteTerm.The change
Two commits: backend + tests, then frontend + tests.
Backend
RadioManagercachesrepeat_enabled,repeat_supportedandallowed_repeat_freqsalongside the other device-query fields. They're read from theDEVICE_INFOreply (payload["repeat"], fw ver ≥ 9; raw-frame fallback at byte 80), and the allowed list fromget_allowed_repeat_freq()in the same connect-time pass. A failed allowed-frequency query logs at debug and leaves the list empty; it never blocks connect.GET /api/radio/configreturnsrepeat_enabled,repeat_supportedandallowed_repeat_freqs(min/max MHz ranges).PATCHacceptsrepeat_enabled.apply_radio_config_updatenow always passesrepeat=toset_radiowhen the firmware supports it: the requested value if given, otherwise the node's current value. This is the bug fix, and it applies to existing users who never touch the new checkbox. A repeat-only PATCH reuses the current freq/bw/sf/cr fromself_info.set_radioresult is now checked. A firmwareERR(e.g. repeat requested on a frequency outside the compiled-in allowed list) becomes a 422 that quotes the node's own allowed list:Firmware rejected the radio settings (ERR_CODE_ILLEGAL_ARG). Repeat mode is only allowed on: 918.000 MHz. Sendingrepeat_enabledto firmware that doesn't report repeat returns 400, mirroringpath_hash_mode.meshcore2.3.7 already hasset_radio(..., repeat=), therepeatparse, andget_allowed_repeat_freq().Frontend
repeat_supported, with one line of help text. Diffed into the PATCH only when changed; included in config export/import like the other flags.Docs: the
/radio/configrows inAGENTS.md,app/AGENTS.mdandfrontend/AGENTS.mdare updated.New radio setting UI

Error upon attempting to save radio settings with repeater mode enabled for an unsupported frequency

Testing
./scripts/quality/all_quality.shgreen (pyright 0 errors, pytest + vitest passing, frontend build).self_infoparams; ERR → 422 quoting the cached allowed list; unsupported-firmware → 400; allowed list cached from payload and empty on ERR; checkbox shown/hidden, gated by entered frequency, always un-tickable.DEVICE_QUERYbyte 80); allowed list renders; off-list frequency with repeat on returns the 422 and leaves the radio unchanged; unticking at an off-list frequency saves the frequency change with repeat off.Notes for the maintainer
Written with AI assistance per
CONTRIBUTING.md; every change was reviewed and hardware-tested by me.AGENTS.mdsays agents never commit — the two commits here were produced by an agent on my fork and reviewed by me before opening this. Happy to squash or re-author if you'd prefer.