After a Confirmed Uplink, the following uplink ignores ADR and uses the default datarate

I periodically send a confirmed uplink to check network connectivity. ADR is enabled, and the data rate is DR5. The server responds with an ack, and no ADRLinkReq as expected.

The next uplink is unconfirmed, but the datarate returns to the default datarate set before ADR (i.e. DR0). Then the server starts a new ADRLinkReq sequence to recover device back to DR5, which involves up a lot of unnecessary traffic.

What might be the reason for the uplink not using the datarate parameters set by ADR after the confirmed uplink?

LNS is Chirpstack v4

Please include the following information, in order for us to help you as effectively as possible.

  • What product do you wish to discuss? RAK4631

  • What firmware are you using? (Arduino )

  • What firmware version? Can it be obtained with AT+VER=?

  • Computer OS? (MacOS, Linux, Windows) MacOS

  • What Computer OS version? Sonoma 14.5

  • How often does the problem happen? Every confirmed uplink

  • How can we replicate the problem?

  • Provide source code if custom firmware is used or link to example if RAKwireless example code is used.

Hi John,

Is this a RUI3 based application or an Arduino application using the SX126x-Arduino library?

I’m using the SX126x-Arduino library, Bernd.

I will have to run a test. The library is old and it could be a bug.
I barely use ADR.

I might have found it.
There was a “workaround” implemented (not sure if it was me or if it was already there when I got the sources).
I am not even sure why the workaround was implemented, but it does reset DR (and other things).

I made a workaround around the workaround (preserving the DR).
But I am not sure about the side effects, I don’t want to release this immediately.

Are you using PIO or ArduinoIDE?

Great! I’m using PIO…

Hi @j9archer

Can you replace in the SX126x-Arduino library the file LoRaMacHelper.cpp with the attached file and check if it works for you and if there are other side effects?

LoRaMacHelper.cpp (29.5 KB)

Path should be like

<project>.pio\lib_deps\<env>\SX126x-Arduino\src\mac

It looks good so far! I’ll keep testing and let you know if I see anything unexpected. Thanks!

Ok, keep me updated. If you find no other problem, I will release it as official change.

Released the fix as SX126x-Arduino V2.0.25

1 Like

And fixed the compilation failure with V2.0.26 :grin: