Skip to content

docs(lora): clarify TX power accepts signed/negative values#3459

Merged
Yeraze merged 1 commit into
mainfrom
docs/tx-power-negative-note
Jun 14, 2026
Merged

docs(lora): clarify TX power accepts signed/negative values#3459
Yeraze merged 1 commit into
mainfrom
docs/tx-power-negative-note

Conversation

@Yeraze

@Yeraze Yeraze commented Jun 14, 2026

Copy link
Copy Markdown
Owner

Context

Users reported that Meshtastic firmware permits negative TX power values. This PR verifies the claim and documents the behavior. No input constraints were added — negatives are intentionally left accepted.

Findings

Firmware (verified):

  • Config.LoRaConfig.tx_power is a signed int32 (on-device narrowed to int8_t). Negative values are representable on the wire.
  • 0 is a documented sentinel = "use the default maximum safe power for your hardware."
  • Firmware applies upper-bound clamping only (region/hardware caps). There is no lower clamp — a negative passes straight to RadioLib's setOutputPower(), where behavior is chip-defined. Meaningful on radios like SX126x (down to ~-9 dBm); undefined elsewhere.

MeshMonitor (verified):

  • Already accepts negative TX power end-to-end. The three LoRa TX power inputs (LoRaConfigSection.tsx:405, RadioConfigurationSection.tsx:233, AdminCommandsTab.tsx:2716) are bare type="number" with no min/max.
  • No UI filter clamps negatives to 0. Confirmed there is no Math.max(0, …)/clamp on txPower anywhere, and the only min="0" attributes in the LoRa forms belong to channelNum and other unrelated fields — not txPower.
  • Backend passes txPower through unmodified.

Change

Updates the lora_config.tx_power_description help text (en) to state that 0 = default max and that negative values are permitted but radio-dependent. No code/validation changes.

🤖 Generated with Claude Code

Users noted Meshtastic firmware permits negative TX power. Verified:
config.lora.tx_power is a signed int32 and firmware applies upper-bound
clamping only (no lower clamp), so negatives pass through to RadioLib
and are radio-dependent (meaningful on e.g. SX126x). MeshMonitor already
accepts negatives end-to-end — no UI input clamps them to 0 (the only
min="0" attributes in the LoRa forms belong to channelNum/other fields,
not txPower).

Update the help text to document that 0 = default max and negatives are
permitted but radio-dependent. No input constraints added (intentional).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jun 14, 2026

Copy link
Copy Markdown

Claude finished @Yeraze's task —— View job


PR Review Complete ✅

I've thoroughly reviewed this pull request and analyzed the documentation change for TX power values.

Review Checklist:

  • Read the changed file and understand the modification
  • Evaluate the accuracy and clarity of the documentation update
  • Check for any potential issues with the change
  • Provide comprehensive feedback on code quality, bugs, performance, security, and test coverage

Review Feedback

Excellent Documentation Update

This is a well-researched and helpful documentation improvement. The change accurately documents existing behavior rather than introducing new functionality.

What Changed

  • File: public/locales/en.json (line 3179)
  • Before: "LoRa transmit power in dBm. Value of 0 uses the default maximum safe power for your hardware. Units are in dBm."
  • After: "LoRa transmit power in dBm. A value of 0 uses the default maximum safe power for your hardware. Negative values are permitted (the field is signed) but only meaningful on radios that support reduced/negative output power, e.g. SX126x; firmware does not clamp the lower bound, so behavior for negatives is radio-dependent."

Code Quality Assessment

✅ Accurate Documentation:

  • Verified that MeshMonitor UI accepts negative TX power values in all three input locations:
    • LoRaConfigSection.tsx:407 - No min attribute on the input
    • RadioConfigurationSection.tsx:233 - No constraints
    • AdminCommandsTab.tsx:2716 - No validation

✅ Consistency Check:

  • Confirmed no Math.max(0, ...) clamping in the codebase for txPower
  • The channelNum field correctly has min="0" constraint, but txPower intentionally does not
  • Backend passes txPower through unmodified (as stated in PR description)

✅ Technical Accuracy:

  • The documentation correctly explains that:
    • 0 = use hardware default maximum
    • Negative values are field-supported (signed integer)
    • Behavior is radio-dependent (SX126x example is appropriate)
    • Firmware doesn't clamp lower bounds

Security, Performance, and Bugs

✅ No Security Concerns: Pure documentation change with no code logic modifications.

✅ No Performance Impact: Localization string update only.

✅ No Bugs Introduced: The change documents existing behavior accurately.

Test Coverage

✅ No Tests Needed: This is a help text update that doesn't require test coverage. The underlying TX power functionality is already working as documented.

Recommendations

  1. Minor Grammar Improvement: Consider adding "the" before "field":

    "Negative values are permitted (the field is signed)"
    
  2. Consider Adding Range Info: While not critical, you could mention typical ranges if helpful to users, but the current approach of explaining radio-dependence is better for accuracy.

Summary

This is an exemplary documentation PR that:

  • ✅ Documents actual behavior rather than changing it
  • ✅ Provides technical context (signed field, radio dependence)
  • ✅ Includes practical examples (SX126x)
  • ✅ Maintains consistency with existing UI behavior
  • ✅ Addresses user confusion about negative values

Recommendation: ✅ APPROVE - This change enhances user understanding without introducing any risks.


Job Run:
Branch: docs/tx-power-negative-note

@Yeraze Yeraze merged commit fa978fd into main Jun 14, 2026
19 checks passed
@Yeraze Yeraze deleted the docs/tx-power-negative-note branch June 14, 2026 18:18
@Yeraze Yeraze mentioned this pull request Jun 14, 2026
Yeraze added a commit that referenced this pull request Jun 14, 2026
Bump version to 4.10.3 across package.json, package-lock.json,
helm/meshmonitor/Chart.yaml, desktop/package.json, and
desktop/src-tauri/tauri.conf.json.

Finalize the CHANGELOG: promote [Unreleased] to [4.10.3] and add the
entries merged after the section was last written — MQTT NodeInfo
clobber fix (#3456), Traffic Management/StatusMessage firmware-version
gate (#3457), local-node module config storage (#3460), phantom channel
swap fix (#3453), and the TX power help-text clarification (#3459).

Add a release blog post highlighting the Traffic Management detection
fix and the bug-fix round.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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