lorawan-stack icon indicating copy to clipboard operation
lorawan-stack copied to clipboard

Setting antenna gain doesnt take immediate affect

Open virtualguy opened this issue 1 year ago • 5 comments
trafficstars

Summary

When changing the antenna gain on a gateway it has no affect until a gateway disconnects. It takes a full disconnection timeout until messages start being scheduled with the new TX power

Steps to Reproduce

  1. Gateway connected with antenna.gain set to 0
  2. Using ttn-lw-cli set antenna gain to 10
  3. Observe downlinks still being scheduled at the same tx power (i.e. 30dBm for AU915)

Current Result

Transmit power doesnt change until gateway disconnects

Expected Result

Gain takes affect immediately and transmit power changes

Relevant Logs

No response

URL

No response

Deployment

The Things Stack Open Source (self-hosted)

The Things Stack Version

3.28.0

Client Name and Version

No response

Other Information

No response

Proposed Fix

Compare changes to the antenna properties and require a gateway disconnect here

Contributing

  • [X] I can help by doing more research.
  • [X] I can help by implementing a fix after the proposal above is approved.
  • [X] I can help by testing the fix before it's released.

Code of Conduct

virtualguy avatar Mar 07 '24 21:03 virtualguy

This is actually by design. Gateway settings are stored in the Identity Server and gateways connect to the Gateway Server. These may be in different clusters and we use the gateway reconnection to sync settings.

If you are using LBS, we need to report the antenna gain to the gateway during the connection. This means that the changes cannot reflect in the same connection.

For UDP, I don't see a technical reason for waiting for a new connection other than the TTS architecture.

What we can do is to trigger a server-side disconnect of the gateway if the antenna gain is adjusted? Then the gateway can reconnect and fetch new data. Would that be something that works for your requirement?

KrishnaIyer avatar Mar 11 '24 14:03 KrishnaIyer

Yes that sounds good, a server side forced reconnection should do the trick

virtualguy avatar Mar 11 '24 18:03 virtualguy

Ok thanks. Do @adriansmares or @johanstokking see a reason against triggering a gateway reconnection on antenna gain change? We have this mechanism already for changes in the location type.

KrishnaIyer avatar Mar 12 '24 09:03 KrishnaIyer

I don't see a reason against it - we probably should just update this check to also look at the antenna gain. https://github.com/TheThingsNetwork/lorawan-stack/blob/ed1a5f885d9d9a3b23d033a28cb85bc358669a3b/pkg/gatewayserver/gatewayserver.go#L601-L630

adriansmares avatar Mar 12 '24 09:03 adriansmares

Yes, sounds like a good reason to reconnect.

johanstokking avatar Mar 12 '24 10:03 johanstokking

This is completed and will be released as part of v3.30.2

KrishnaIyer avatar May 29 '24 14:05 KrishnaIyer