brocaar / chirpstack-network-server

ChirpStack Network Server is an open-source LoRaWAN network-server.
https://www.chirpstack.io
MIT License
1.48k stars 545 forks source link

Device specific installation margin #591

Open wanssemd opened 1 year ago

wanssemd commented 1 year ago

Summary

The used default ADR algorithm is based on the ADR algorithm suggested by Semtech. It makes use of the _margindb or _installationmargin, as it is called in the chirpstack, to compute a number of steps, which then should be performed to optimize the network quality. This margin is a device specific parameter and may differ from device to device. The current ChipStack Network Server implementation only allows to configure this _installationmargin using the config.toml file. This configured margin is then used in the adr.HandleRequest (see here). If a user however wants to optimize the network by adjusting the margin for one specific device, he only has the possibility to manually add an adapted ADR algorithm since the global configuration would change the bahvior of all registered devices. A better solution would be to allow a device specific configuration of this value.

What is the use-case?

As mentioned the main use-case for this feature is the possibility of the user to optimize the network in dependence of the used devices.

Implementation description

The easiest solution imho would be to add a margin field to the device profile which then should be used here instead of the configured value. The configured margin can be used as the default value if the margin is not further defined by the user in the device profile.