Skip to content

[ALIGNMENT]: Raise the coding rate while a modem preset is in use #161

Description

@NomDeTom

Decision

Clients let the user raise the coding rate while use_preset is true. The preset keeps setting bandwidth and spreading factor, and a coding rate above the preset's own value replaces it. Choosing a coding rate at or below the preset's value means "use the preset's".

Context

LoRaConfig.coding_rate is the denominator of the LoRa coding rate, 5 to 8 for 4/5 to 4/8. Clients currently hide it or grey it out whenever use_preset is on, and the proto comment on modem_preset says the preset replaces it.

Firmware already supports this. Since meshtastic/firmware#9155 (2.7.18), RadioInterface::applyModemConfig() takes the preset's bandwidth and spreading factor and uses coding_rate in place of the preset's value when it is valid and higher. A lower or unset value falls back to the preset. The change is on the client side only.

A higher coding rate does not split the mesh. Meshtastic sends the coding rate in the explicit LoRa header, so nodes on the same preset still receive each other in both directions. The frequency slot and the channel hash are also unaffected, because they come from the preset name and the channel name.

What the user gets is more forward error correction in exchange for airtime. The payload section of a packet sent at 4/8 takes 60% longer on air than at 4/5 with the same bandwidth and spreading factor, and that counts against the duty cycle and channel utilisation limits.

Required Client Behavior

  1. Show the coding rate control while use_preset is true, labelled as an override of the preset, for example "Coding rate (preset: 4/5)".

  2. Offer only the values above the preset's coding rate, up to 4/8, plus "Preset default". A lower value would be ignored by firmware, so the client must not offer it.

  3. Write "Preset default" as coding_rate = 0. Any value at or below the preset's is stored as 0 too, so nothing misleading is left in the config.

  4. Show the coding rate the radio is actually using wherever the client shows the preset's radio parameters, not the preset's nominal value.

  5. Say near the control that a higher coding rate lengthens every transmission and uses more of the duty cycle and channel utilisation budget.

  6. When the user switches presets, keep the override only while it is still above the new preset's coding rate, and reset it to "Preset default" otherwise.

  7. Leave the custom-settings path (use_preset false) unchanged.

Acceptance Criteria

With use_preset on and a preset with a 4/5 coding rate, picking 4/8 writes coding_rate = 8, the radio reports 4/8, and the node still exchanges messages with an unmodified node on the same preset.

With use_preset on, no value below the preset's coding rate is offered, and "Preset default" writes 0.

Switching to a preset whose coding rate is equal to or above the stored override resets the control to "Preset default".

Firmware older than 2.7.18 ignores coding_rate while a preset is on, so clients hide the control on it.

Platform Tracking

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions