# LMIC Library Always Does Unwanted Downlink

**URL:** <https://www.thethingsnetwork.org/forum/t/lmic-library-always-does-unwanted-downlink/21293>\
**Category:** LMIC\
**Created:** [January 8, 2019, 1:59am UTC](https://www.thethingsnetwork.org/forum/t/lmic-library-always-does-unwanted-downlink/21293 "2019-01-08T01:59:17Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![arjanvanb](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/arjanvanb/32/46626_2.png) [@arjanvanb](https://www.thethingsnetwork.org/forum/u/arjanvanb)\
**Post date:** [January 9, 2019, 11:24am UTC](https://www.thethingsnetwork.org/forum/t/lmic-library-always-does-unwanted-downlink/21293/10 "2019-01-09T11:24:47Z")

</div>

> [@ElectronicallyE](#):
>
> this was pulled from the gateway console as the application shows the payload as _not provided_

Correct. There is no application payload; this is only a network MAC command.

> [@ElectronicallyE](#):
>
> ```plaintext
> FCtrl = 8A 
> FOpts = 0360020071035500FF01
> 
> ```

Hexadecimal 0x8A in `FCtrl` [equals](https://www.rapidtables.com/convert/number/hex-to-decimal.html?x=8A) binary 0b10001010, hence indeed [indicates](https://lora-alliance.org/sites/default/files/2018-05/lorawan1.0.1final_05apr2016_1099_1.pdf#page=17) it’s ADR (I wonder if that’s needed), and that `FOptsLen` = 10, so `FOpts` holds 10 bytes for MAC commands:

> ![image](https://www.thethingsnetwork.org/forum/uploads/default/original/3X/8/8/889361ce4453f17a46af5cee57f9796e24b40580.png)

Those 10 bytes ~~indeed start with 0x03~~ are actually two MAC commands, both starting with 0x03, both denoting a LinkADRReq, in which the server is requesting the device to adjust its settings:

> ![image](https://www.thethingsnetwork.org/forum/uploads/default/original/3X/a/d/ad7f2301240f0359a6f81933e5484de5d201b7f1.png)

See [the LoRaWAN 1.0.1 specifications](https://lora-alliance.org/sites/default/files/2018-05/lorawan1.0.1final_05apr2016_1099_1.pdf#page=51) on how to decode the 10 bytes.

**For AU915-928** †, the first 5 bytes, 0x0360020071:

- 0x03 = LinkADRReq
- 0x60 = DataRate\_TXPower: data rate 6 ~~(reserved for future use?)~~; TX power 0 = 30 dBm
- 0x0200 (LSB) = [0b00000000 00000010](https://www.rapidtables.com/convert/number/hex-to-decimal.html?x=0200) (MSB) = ChMask: index 2
- 0x71 = [0b01110001](https://www.rapidtables.com/convert/number/hex-to-decimal.html?x=71), so ChMaskCntl = 0b111: all 125 kHz OFF, and ChMask applies to channels 64 to 71, so index 2 only enables channel 65, being **917.5 - 500 kHz BW at DR4**

…and the second part, 0x035500FF01:

- 0x03 = LinkADRReq
- 0x55 = DataRate\_TXPower: data rate 5 ~~(reserved for future use?)~~; TX power 5 = 20 dBm
- 0x00FF (LSB) = 0b11111111 00000000 (MSB) = ChMask: index 8 to 15
- 0x01 = 0b00000001, so ChMaskCntl = 0b000: ChMask applies to channels 0 to 15, so index 8 to 15 enables channels 8 to 15, being **916.8 - 918.2 MHz, 125 kHz BW at DR0 to DR3**

This indeed matches the 9 channels [that TTN uses for AU915-928](https://www.thethingsnetwork.org/docs/lorawan/frequency-plans.html#au915-928). ( ~~I’m not 100% sure I got the decoding right; I don’t understand the data rates.~~ I should have used 1.0.2 for the decoding; see subsequent posts.)

The ADR request is needed for AU915 (and US915) because [LoRaWAN 1.0.1 does not support](https://lora-alliance.org/sites/default/files/2018-05/lorawan1.0.1final_05apr2016_1099_1.pdf#page=51) these settings to be provided in the Join Accept response. (It does support that for EU868.) For LoRaWAN 1.0.3 and 1.1 this is supported, like the ADR documentation I quoted above already mentioned. I don’t think TTN supports 1.0.3, but it will support LoRaWAN 1.1 [as of V3](https://www.thethingsnetwork.org/article/the-things-network-stack-v3-update).

So, all as expected, and hopefully your version of LMIC will handle the ADR request. If it does, then **the next uplink should include the LinkADRAns MAC command** , to tell the server it handled it. So, the second uplink should show some values for `FCtrl` and `FOpts` as well.

* * *

† For an EU868 example, see [ADR problems - node of the same type have different ADR behaviour - #11 by arjanvanb](https://www.thethingsnetwork.org/forum/t/adr-problems-node-of-the-same-type-have-different-adr-behaviour/22825/11).

---

_[View the full topic](https://www.thethingsnetwork.org/forum/t/lmic-library-always-does-unwanted-downlink/21293)._
