Problems with ADR plugin

Hi,
so I migrated my ADR plugin from v3 to v4 as decribed here but it does not work as intended.
When a new device joins it does that always with DR0. With the default builtin ADR that is changed right after the first uplink to DR5 an TX0 if I am close to the gateway.
With my migrated plugin it does not, it stays at DR0 and seems to never change.
I checked it over an over and debugged the script it with the test data, changed the values of the test data to real values from a device and it works and return DR5 and TX0 but not when used in Chirpstack.
I have no idea why is it not working…

And I got a question too, I stumbled over that line here.
If steps are negative and the history does not contain exactly 20 items with the same TX then it just returns? Why is it ‘!=’? Is 20 a magic number? Is 20 the maximum size so if all history items have the same TX then do nothing?

I really need my ADR to get going again because the RN2384 devices have issues if you set TX to 0. I also activated decreasing the DR, I know that is not recommended…

Any help appriciated…

Still no progress, I have no idea why this is not working.
Is there a way to debug the addin inside of Chirpstack? Maybe activiating a log?
I tried to get a development env for Chirpstack up but it seems the docker-compose is not ready for running on arm and I have no amd64 dev PC ready…

ChirpStack will keep a history of the metadata of the last 20 uplink (history table). This table is exposed to the ADR implementation so that it has a bit more context than just the current uplink meta-data. E.g. for calculating the packet-loss, you need more metadata than just the last uplink.

For testing your ADR implementation, there is no need to use ChirpStack. The custom ADR implementation is just a JS function with input and output. E.g. you could implement a unit-test function which tests the output given a table of input to test the different scenarios.

2 Likes

I implemented my JS functions but what I am missing is exactly the parameters the function gets called with form Chirpstack in a live environment to really make up some test cases to compare my algorithm with the built-in one.
I had to roll back to v3 because of all my RN2483 devices having problems with ADR because I don’t get my JS function to work properly though using the data supplied with the bare example it works just as intended.
But obviously not when used in Chirpstack, so I assume there must be something in the data maybe something with the history that crashes my hacked JS functions because I just tailored it with my little understanding of JS…

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.