arduino-lmic icon indicating copy to clipboard operation
arduino-lmic copied to clipboard

rx1DrOffset > 3 in EU868 not working

Open tibbis opened this issue 2 years ago • 2 comments

Describe the bug

I noticed that the MAC command MCMD_RXParamSetupReq does not seem to be adapted for EU868 specs, but only for US like specs.

The following lines in the case makes the LoRaWAN LCTT test case TP_A_EU868_ED_MAC_BV_015_A (RX1 Receive window test Part 1) fail when the requested data rate offset for Rx1 is 4 or 5. I suggest changing the number 3 to a query function for each region for the maximum supported RX1 data rate range. For the EU868 test, if I change it from 3 to 5 in the if statement, the test passes, but that would not be good for the other regions neither.

I suggest to change this:

if (rx1DrOffset <= 3)
    LMIC.dn2Ans |= MCMD_RXParamSetupAns_RX1DrOffsetAck;

to e.g.:

if (rx1DrOffset <= LMIC_queryMaxRx1DrOffset())
    LMIC.dn2Ans |= MCMD_RXParamSetupAns_RX1DrOffsetAck;

Not sure if there are more things to change or not.

The data rate range for RX1 in each region are specified here: https://lora-alliance.org/wp-content/uploads/2020/11/rp_2-1.0.1.pdf#page=27.

Maybe there are more places where numbers like this are only suitable for a certain region?

Environment

LMIC 4.1.1 LCTT 3.4.0 EU868 region

To Reproduce

Do a MAC command for rx1DrOffset value of 4 or 5.

tibbis avatar Dec 29 '21 15:12 tibbis