Skip to content

Support downlink scheduling on all gateway antennas - #8017

Closed
vlasebian wants to merge 2 commits into
v3.37from
feature/downlink-support-for-multiple-antennas
Closed

Support downlink scheduling on all gateway antennas#8017
vlasebian wants to merge 2 commits into
v3.37from
feature/downlink-support-for-multiple-antennas

Conversation

@vlasebian

Copy link
Copy Markdown
Contributor

Summary

The Gateway Server only issued uplink tokens for antenna 0 and disabled the downlink path on all other antennas, so multi-board gateways could never receive downlinks on their other antennas. This PR treats all antennas as downlink paths and sends each board its own antenna gain in the LoRa Basics Station router configuration.

References #48

Changes

  • Uplinks received on any antenna now carry an uplink token and inherit the gateway's downlink path constraint, instead of DOWNLINK_PATH_CONSTRAINT_NEVER on antennas other than the first.
  • Each SX1301_conf object in the LBS router_config now carries the gain of its own board's antenna (aligned index-for-index with the gateway's frequency plans, falling back to the first antenna's gain when fewer antennas are registered), instead of the first antenna's gain applied to all boards.
  • Antenna gains are no longer truncated to integers on the LBS path.

Testing

Steps
  1. Register a gateway with two frequency plans (e.g. EU_863_870,EU_863_870) and two antennas with different gains (CLI: --antenna.index N --antenna.gain X).
  2. Connect a dual-board LoRa Basics Station gateway and verify the router_config contains one SX1301_conf per board, each with its own antenna_gain.
  3. Send an uplink via the second board (rctx: 1) and verify the uplink metadata carries an uplink token and the gateway's downlink path constraint.
  4. Schedule a class A downlink for that uplink and verify the dnmsg carries rctx: 1.
Results

Unit tests cover the gain alignment and fallback (TestNewConnectionAntennaGains) and per-board gains in the router configuration (TestGetRouterConfigWithMultipleFP/DistinctAntennaGains).

Regressions
  • Single-antenna gateways: unchanged behavior (gain of antenna 0, same router_config output; integral gains marshal identically).
  • Gateways with fewer registered antennas than frequency plans previously relied on the first antenna's gain for all boards; that fallback is preserved.

Notes for Reviewers

Scheduling downlinks concurrently on different antennas (per-antenna conflict tracking in the scheduler) is a follow-up on this branch; the sub-band duty-cycle accounting intentionally remains per gateway.

Checklist

  • Scope: The referenced issue is addressed, there are no unrelated changes.
  • Compatibility: The changes are backwards compatible with existing API, storage, configuration and CLI, according to the compatibility commitments in README.md for the chosen target branch.
  • Documentation: Relevant documentation is added or updated.
  • Testing: The steps/process to test this feature are clearly explained including testing for regressions.
  • Infrastructure: If infrastructural changes (e.g., new RPC, configuration) are needed, a separate issue is created in the infrastructural repositories.
  • Changelog: Significant features, behavior changes, deprecations and fixes are added to CHANGELOG.md.
  • Commits: Commit messages follow guidelines in CONTRIBUTING.md, there are no fixup commits left.

Uplinks received on antennas other than the first now carry an uplink
token and inherit the gateway's downlink path constraint, so that the
Network Server can use any antenna as a downlink path.

References #48
Each SX1301_conf object in the router configuration now carries the
gain of its own board's antenna instead of the first antenna's gain
applied to all boards. Antenna gains are aligned index-for-index with
the gateway's frequency plans, falling back to the first antenna's
gain when fewer antennas are registered than frequency plans.
Fractional gains are no longer truncated to integers.

References #48
@vlasebian vlasebian self-assigned this Sep 2, 2026
@github-actions github-actions Bot added c/network server This is related to the Network Server c/identity server This is related to the Identity Server c/gateway server This is related to the Gateway Server compat/db This could affect Database compatibility c/gateway conf server This is related to the Gateway Configuration Server dependencies Pull requests that update a dependency file ui/web This is related to a web interface tooling Development tooling compat/config This could affect Configuration compatibility labels Sep 2, 2026
@vlasebian
vlasebian changed the base branch from v3.35 to v3.37 September 2, 2026 14:09
@vlasebian vlasebian closed this Sep 2, 2026
@vlasebian
vlasebian deleted the feature/downlink-support-for-multiple-antennas branch September 2, 2026 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c/gateway conf server This is related to the Gateway Configuration Server c/gateway server This is related to the Gateway Server c/identity server This is related to the Identity Server c/network server This is related to the Network Server compat/config This could affect Configuration compatibility compat/db This could affect Database compatibility dependencies Pull requests that update a dependency file tooling Development tooling ui/web This is related to a web interface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant