mcci-catena / arduino-lmic

LoraWAN-MAC-in-C library, adapted to run under the Arduino environment
https://forum.mcci.io/c/device-software/arduino-lmic/
MIT License
648 stars 212 forks source link

ADR after join - starting at lower data rates instead of highest to be able to work better with Chirpstack ADR Algo #624

Open Cloolalang opened 4 years ago

Cloolalang commented 4 years ago

Is your feature request related to a problem? Please describe. I have tested my LMIC device with Chirpstack, after power up and join at the highest data rate, chirpstack ADR engine can only adjust TX-power, (not data rate) This means that if a LMIC device starts up and joins far away from the gateway, it can struggle to adapt properly via ADR should the SNR be close to the noise floor limit. Chirpstack uses derivation of the SEMtech recommended ADR Algorithm for ADR processing. It works great for high SNR control as it can command an end-device up and down in TX power and up in data-rate,

BUT; Because the ADR cannot step the end-device downwards in data rate, and LMIC starts up at the highest data rate, the ADR is only effective at the high SNR end of the scale (nearby devices).

IF, we could have the option to start up our LMIC device in a lower data rate, then we would get the benefit of the chirpstack ADR control.

Lmic: 3.2.0 EU868, lorawan 1,0.3 A Chirpstack -3.10.0

P

terrillmoore commented 4 years ago

Hi @Cloolalang -- I am not a fan of the Chirpstack approach. They also initially set up multiple repeats, etc, which is very wasteful. Other network servers I've used (TTN, Actility, etc) seem to take a more reasonable approach for real-world applications.

You can experimentally work around this by manually setting the data rate after the join. In the MCCI BSPs, we have support for selecting the target network, and we could potentially set an LMIC_CONFIG_... variable that controls the post-join behavior. But we can't change the default behavior of the LMIC at this time.

Cloolalang commented 4 years ago

Hi Terry, Arr, that's very interesting. Its indeed fascinating to discover these "gray areas" of the Lorwan project!

When you mention multiple repeats, do you mean the NbRep ? . I ask because in my testing I have also seen duplicated LinkADRReq commands from chirpstack identical TX_power and DR settings,,quite strange...

I see cases/arguments for both ADR starting points:

https://www.thethingsnetwork.org/forum/t/start-otaa-join-on-sf7bw125-or-sf12bw125-eu-868mhz/15189/19

I will check with Chirpstack on the ADR implentation, or perhaps look to try another Algorithm.

Thanks for your quick response! p

Cloolalang commented 4 years ago

I had a poke around:

It looks like TTN like to get end-devices joined at SF8 in (EU868) for their ADR for be working:

https://github.com/TheThingsNetwork/ttn/blob/develop/core/networkserver/adr_test.go

Cloolalang commented 4 years ago

https://github.com/brocaar/chirpstack-application-server/issues/558

tealbrains commented 3 years ago

Hi @Cloolalang

Background [AU915, ESP32, SX1276, Chirpstack 3.0]

I am on the same boat here. I use Chirpstack and I have been facing the following:

tealbrains commented 3 years ago

I had to set the Maximum and Minimum DR on Chirpstack.

I will now be able to confirm @Cloolalang 's observations. I will also try to start the join procedure with the node placed further hoping it will use a higher SF after joining succesfully.

Cloolalang commented 3 years ago

I gave up with Chirpstack ADR and ended up turning it off on both network and device ends. For the time being I am setting up everything "manually". I did not see any way to change or set NBRep in LMIC either.