Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support fine-grained NbTrans controls while using Dynamic ADR mode #6966

Closed
2 of 4 tasks
KrishnaIyer opened this issue Mar 4, 2024 · 11 comments · Fixed by #7012
Closed
2 of 4 tasks

Support fine-grained NbTrans controls while using Dynamic ADR mode #6966

KrishnaIyer opened this issue Mar 4, 2024 · 11 comments · Fixed by #7012
Assignees
Labels
c/console This is related to the Console c/network server This is related to the Network Server
Milestone

Comments

@KrishnaIyer
Copy link
Member

KrishnaIyer commented Mar 4, 2024

Summary

Support fine-grained NbTrans controls while using Dynamic ADR mode. Ref: https://thethingsindustries.atlassian.net/servicedesk/customer/portal/1/TTS-6383

Current Situation

In the Dynamic ADR mode, we currently cannot set a min/max NbTrans for specific data rates.

Why do we need this? Who uses it, and when?

For customers who need this control without switching to the Static mode.

Proposed Implementation

Already done in #6962. This issue is filed retroactively.

Contributing

  • I can help by doing more research.
  • I can help by implementing the feature after the proposal above is approved.
  • I can help by testing the feature before it's released.

Code of Conduct

@KrishnaIyer KrishnaIyer added c/network server This is related to the Network Server c/console This is related to the Console labels Mar 4, 2024
@KrishnaIyer KrishnaIyer added this to the v3.30.0 milestone Mar 4, 2024
@github-actions github-actions bot added the needs/triage We still need to triage this label Mar 4, 2024
@KrishnaIyer KrishnaIyer removed the needs/triage We still need to triage this label Mar 4, 2024
@KrishnaIyer
Copy link
Member Author

KrishnaIyer commented Mar 4, 2024

This has two parts

Console Support

In the Device General Settings window, under Advanced MAC settings.

  • If the Adaptive Data Rate (ADR) is set to Dynamic Mode
  • We can set upto 16 Data Rate "options". Data Rate 0 to Data Rate 15.
  • Each data rate can have one set of Min NbTrans and Max NbTrans
  • Validation; 1 <= Min NbTrans <= 3, 1 <= Max NbTrans <= 3 and Min NbTrans < Max NbTrans
Screenshot 2024-03-04 at 11 54 14

cc: @kschiffer for UX.

@KrishnaIyer KrishnaIyer assigned ryaplots and unassigned adriansmares Mar 6, 2024
@KrishnaIyer
Copy link
Member Author

The API/backend part is done. @kschiffer please check the UX for this and @ryaplots can pick this up for v3.30.0.

@kschiffer
Copy link
Contributor

image

Here's the wireframe for the functionality. This one assumes that there's also a default value that can be set, which I believe should be possible as well. cc @KrishnaIyer

@KrishnaIyer
Copy link
Member Author

The API defines both to be between 1 and 3.
So I can say the default Min. NbTrans is 1 and the Max. NbTrans is 3.

@ryaplots
Copy link
Contributor

I have a question about this:

  1. @kschiffer @KrishnaIyer The "Default for all data rates" fields are not possible to change, right? The only real user action here is adding overrides, correct? Or is there API to add default data rates?
  2. @kschiffer I am using the key value map component that I edited to add a selector at the beginning because this component has all the perfect logic to deduce the field values of overrides. However, it does not have the field titles per key/value field and adding them seems like extending the component too much and changing its purpose. Can we use placeholders instead of field titles like below?
Screenshot 2024-03-12 at 17 03 58

@kschiffer
Copy link
Contributor

kschiffer commented Mar 13, 2024

  1. So apparently the default can not be changed but is fixed to 1 and 3. I believe it's good to show that as well. Let's replace the two fields with a text. The network server applies a min NbTrans of 1 and a max NbTrans of 3 for all data rates. You can use the button below to define overrides.
  2. It should be relatively easy to achieve the same thing without <KeyValueMap /> by using form hooks and rendering normal <Form.Field />'s based on some internal state or even the form values directly. Ideally, we would be able to solve these things also with the key-value-map but it would need a refactor to make better use of the form hooks and allow for objects as values.
image

@adriansmares
Copy link
Contributor

To clarify the API a bit:

  1. It is possible to not have per data rate overrides, and to have a default (i.e. used without an override):
    // Minimum number of retransmissions.
    // If unset, the default value from Network Server configuration will be used.
    google.protobuf.UInt32Value min_nb_trans = 6 [(validate.rules).uint32 = {
    gte: 1,
    lte: 3
    }];
    // Maximum number of retransmissions.
    // If unset, the default value from Network Server configuration will be used.
    google.protobuf.UInt32Value max_nb_trans = 7 [(validate.rules).uint32 = {
    gte: 1,
    lte: 3
    }];
  2. The range is indeed always 1 to 3 at most.

@kschiffer
Copy link
Contributor

Ah so in that case, my initial wireframe is actually more suitable.

So it would be possible to have a (modified) default and a couple of overrides, right?

@adriansmares
Copy link
Contributor

adriansmares commented Mar 13, 2024

So it would be possible to have a (modified) default and a couple of overrides, right?

Yes. In general I wouldn't show / set these unless someone explicitly requested these overrides and defaults, but it is possible.

@kschiffer
Copy link
Contributor

After some discussion on Slack, the new layout is as follows:
image

Text for the Use default settings for number of retransmissions checkbox tooltip:

The number of retransmissions (NbTrans) controls how many times a frame will be transmitted over the air. The redundancy introduced by retransmissions improves the chances that a packet will be received, at the expense of more power usage. By default, depending on the number of missed frames, the same frame may be transmitted 3 times.

Text for the Data rate specific overrides tooltip:

Data rate specific overrides allow the number of transmissions to be limited on a per data rate basis. This may be used to limit power usage for low data rates.

Also note the following:
The data rates in the dropdown should be resolved to the actual symbol like SF7BW125. These can be fetched via:

rpc ListBands(ListBandsRequest) returns (ListBandsResponse) {

@adriansmares how to correlate the bands with the data rate index? Couldn't find that out on a quick glance.

@adriansmares
Copy link
Contributor

For an individual end device, you know the frequency plan ID and regional parameters version. You already have all of the frequency plans in memory (for rendering purposes), so based on that you can lookup the band ID in the frequency plan (similar to how you look at the names currently, but .band_id instead of .name).

The extra step is to download all of the band definitions (via that RPC). Let's call the result of that descriptions. descriptions[bandID].band[regionalParametersVersion] is the band definition, and the data rate descriptions are in .data_rates. .data_rates[i] is the definition of data rate index i. You can then translate this definition to text similar to how we render SF7BW125 in the events view, and you are done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c/console This is related to the Console c/network server This is related to the Network Server
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants