Skip to content

[Bug] [V3 fix] slotTimeMsec is constant but should be recalculated on startup based on spreading factor and bandwidth #3892

Description

@ianmcorvidae

Category

Other

Hardware

Not Applicable

Firmware Version

2.x

Description

This is a fix for V3 after some discussion in discord.

In RadioInterface.h we set some initial values for slotTimeMsec, preambleTimeMsec, and maxPacketTimeMsec, but the second and third of those are recalculated on startup in order to match the actual modem settings in use. However, slotTimeMsec is not, so it uses the fixed values for spreading factor and bandwidth that appear in RadioInterface.h (sf 9, bw 125) regardless of radio settings. We should update this since the actual LongFast values would create a longer slot time (~77ms rather than ~42), so this could in theory lead to some failures in channel activity detection (since we're not leaving enough time for the process to happen).

The formula may also need or want adjustment, or formulas that use this value. Possibly the maximum contention window size will be too large with the longer slot time, or other issues. This should be tested/simulated, probably.

Relevant log output

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.0Planned for next major releasetech debtCode or lib references that are not up to date or propper standards

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions