Skip to content

fix(cli): accept on/off for set dc.gate; clarify dc.gate threshold docs - #9

Merged
Elektr0Vodka merged 1 commit into
dmc-devfrom
fix/dmc-dev-dc-gate-on-off
Sep 25, 2026
Merged

Elektr0Vodka merged 1 commit into
dmc-devfrom
fix/dmc-dev-dc-gate-on-off

Conversation

@Elektr0Vodka

Copy link
Copy Markdown

Problem

set dc.gate parsed its value with atoi(), so set dc.gate on evaluated to 0: the repeater replied OK but disabled duty-cycle region gating. Only set dc.gate 1 actually turned it on.

Fix

  • set dc.gate accepts on/1 and off/0; anything else returns ERROR: dc.gate must be on/off (or 1/0) instead of silently turning gating off.
  • The Toolbox sends set dc.gate 1/0, so it is unaffected.

Docs

Raised on Discord: it was unclear whether dc.gate.thresh is a percentage of wall-clock time or of the duty-cycle budget.

  • docs/cli_commands.md: usage shows set dc.gate <on|off>; new "What the percentage measures" section: threshold, hysteresis and the duty in get dc.gate.status are a % of the duty-cycle budget (set dutycycle), not of wall-clock time. Worked example for dutycycle 10 (360 s/hour, gating at 252 s used, recovery below 216 s), and a note that the threshold does not need to be below the duty-cycle limit.
  • dmc-docs/custom-cli (nl/en/de): same correction in short form.

Testing

  • pio run -e Heltec_v3_repeater builds.
  • Not tested on a device; there is no native test harness for CommonCLI.

The duplicated region-gating chapter on dmc-observer-dev is handled when this is carried into that branch.

🤖 Generated with Claude Code

`set dc.gate` parsed its value with atoi(), so `set dc.gate on` evaluated
to 0 and silently disabled region gating while replying OK. It now accepts
on/off as well as 1/0 and rejects anything else with an error.

Docs (cli_commands.md + dmc-docs nl/en/de): dc.gate.thresh, dc.gate.hyst
and the duty in `get dc.gate.status` are a percentage of the duty-cycle
budget, not of wall-clock time. Worked example for dutycycle 10.
@Elektr0Vodka
Elektr0Vodka merged commit 27aca27 into dmc-dev Sep 25, 2026
1 check passed
Elektr0Vodka added a commit that referenced this pull request Sep 26, 2026
…ver-dev-dc-gate-on-off

docs/cli_commands.md: keep this branch's single deduped dc.gate section
(dmc-dev's PR #9 wording arrived via the observer merge and re-added the
duplicate); carry over the upstream doc updates from the sync (radio/freq
defaults, direct.txdelay, agc.reset.interval 0-1020, flood.advert.interval,
advert.interval zero-hop note).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant