Adr + lmic

Hi together.

Did anyone use ADR successfully with the LMIC library?After OTAA Join I call

LMIC_setLinkCheckMode(adr);
LMIC_setAdrMode(adr);

(adr equals 1)

I joined with SF8. The gateway is maybe 10 meters away from me. After a few uplinks I can see the ADR-adjustement downlinks on the Gateway console. I would expect that my node switches to SF7 but nothing happens.

Currently Im using a single channel gateway (A real concentrator board is already on the way :slight_smile: ) . Maybe there are some problems with disabling the other channels and ADR?

Maybe someone has example code or something similar?

I’ve got it working fine but as soon as you talk about single channel gateways its adds other variables to the equation.

I setup adr/sf this way, I removed all LMIC_setLinkCheckMode() calls in my full code :-

case EV_JOINING:
    LMIC_setDrTxpow(DR_SF10,14);
    LMIC_setAdrMode(1); 
    Serial.println(F("EV_JOINING"));
    break;

MCCI lmic has issues I think, preferred lmic library is https://github.com/matthijskooijman/arduino-lmic

Hi,

I can confirm that ADR work with this LMIC version : https://github.com/mcci-catena/arduino-lmic

You should see the ADR ACK response from TTN in the web gateway console after 64 packets.
Then you can look at the content of Fopt (you can paste payload in https://lorawan-packet-decoder-0ta6puiniaut.runkit.sh the Fopt is not encrypted)
An example of ADR response from TTN is FOpts = 0351FF0001
(5=SF7, 1 => power, FF000 first 8 channel, 1 number of transmission).

But I have a full gateway, maybe single gateway prevent TTN to change the datarate if there is lost of packet.

@jezd I have recently made some modification in MCCI LMIC about ADR (commit with author nicolas graziano).

Can you describe your issue, I will try to fix it, if I can.

2 Likes

Maybe this is the problem :smiley: I didn’t analyze the library, but maybe the ADR-Request is dropped when something doesn’t match to the local settings like disabled channels.

Do you have any examples? The original LMIC lib is not maintained for a long time

Thank you! I will try this. Is it possible to switch ADR on or off dynamically after joining? I found anything which makes this impossible

I am using the latest release. It seems like the latest release was one day before your commit? Is that right?

Yes, it may be the problem in LMICeulike_mapChannelsfunction, LMIC refuse all modification if network ask to activate a disabled channel (maybe something I have to look at).

If you want to use ADR maybe you can use directly the branch master until next release. It correct timing (64 packet before ask ADR ACK and power management)

I will do so!

Is this defined in the LoRaWAN standard? If not it would be really cool to set this dynamically or time based. If you send only one packet per hour the time between the ACKs is quite long…

Cant be 100% sure its ADR related, basically I’ve been switching between the MCCI lmic build and matthijskooijman/arduino-lmic. I’m using standard code, nothing unique and switching between the two libraries - the MCCI library is somehow causing random crashes on the node - sometimes with error codes other times is just hangs. If I switch to matthijskooijman/arduino-lmic all is smooth and this tick along just fine.

I will raise an issue in github rather than hijack this thread.

Try:

LMIC_setLinkCheckMode(1);
LMIC_setAdrMode(1);

LMIC_startJoining();

It is define in lorawan standard like this: (LoRaWAN 1.0.3 Regional Parameters)

2.2.9 EU863-870 Default Settings
The following parameters are recommended values for the EU863-870MHz band.
RECEIVE_DELAY1 1 s
RECEIVE_DELAY2 2 s (MUST be RECEIVE_DELAY1 + 1s)
JOIN_ACCEPT_DELAY1 5 s
JOIN_ACCEPT_DELAY2 6 s
MAX_FCNT_GAP 16384
ADR_ACK_LIMIT 64
ADR_ACK_DELAY 32

(same values for all region in the document)

My concentrator board arrived today. I expected it later this week but then I have to do something this evening :smiley: Now ADR seems to work. So if someone is reading this: LMIC + ADR + Single Channel does not work (With my code)

1 Like

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