# Stack v3 sends unrequested downlink data for new ABP device

**URL:** <https://www.thethingsnetwork.org/forum/t/stack-v3-sends-unrequested-downlink-data-for-new-abp-device/48327>\
**Category:** The Things Stack v3\
**Created:** [June 1, 2021, 9:45am UTC](https://www.thethingsnetwork.org/forum/t/stack-v3-sends-unrequested-downlink-data-for-new-abp-device/48327 "2021-06-01T09:45:16Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![tomtor](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/tomtor/32/47264_2.png) [@tomtor](https://www.thethingsnetwork.org/forum/u/tomtor)\
**Post date:** [June 1, 2021, 9:45am UTC](https://www.thethingsnetwork.org/forum/t/stack-v3-sends-unrequested-downlink-data-for-new-abp-device/48327/1 "2021-06-01T09:45:17Z")

</div>

I migrated my existing devices (OTAA and ABP) from v2 to v3 and these work fine.

Today I created a new ABP device (OTAA works fine for new devices) but for some reason the stack always sends a lot (about 50 bytes) of downlink data:

11:39:23.223 → Data Received: 0503D2AD84060703184F84500704E85684500705B85E84500706886684500707586E84500351FF00030805

This is not visible in the application console, only the uplink data is shown, but the downlink counter is increasing.

Also my gateway shows the unwanted downlink:

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

I made the node configurable for both OTAA and ABP.

So it is running the same (LMIC) code in both modes and only ABP shows this behaviour.

---

<div class="post-metadata">

**Author:** ![descartes](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/descartes/32/47220_2.png) [@descartes](https://www.thethingsnetwork.org/forum/u/descartes)\
**Post date:** [June 1, 2021, 10:14am UTC](https://www.thethingsnetwork.org/forum/t/stack-v3-sends-unrequested-downlink-data-for-new-abp-device/48327/2 "2021-06-01T10:14:16Z")

</div>

Have you setup the frequencies that your node may use in the console - if you don’t, then TTS will try and send them to the device which won’t understand. If you do, it assumes the device knows.

---

<div class="post-metadata">

**Author:** ![tomtor](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/tomtor/32/47264_2.png) [@tomtor](https://www.thethingsnetwork.org/forum/u/tomtor)\
**Post date:** [June 1, 2021, 10:15am UTC](https://www.thethingsnetwork.org/forum/t/stack-v3-sends-unrequested-downlink-data-for-new-abp-device/48327/3 "2021-06-01T10:15:08Z")

</div>

Ahh, thanks, I did not.

I will fix that.

---

<div class="post-metadata">

**Author:** ![descartes](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/descartes/32/47220_2.png) [@descartes](https://www.thethingsnetwork.org/forum/u/descartes)\
**Post date:** [June 1, 2021, 10:22am UTC](https://www.thethingsnetwork.org/forum/t/stack-v3-sends-unrequested-downlink-data-for-new-abp-device/48327/4 "2021-06-01T10:22:08Z")

</div>

Looks something like this:

![Screenshot 2021-06-01 at 11.18.15](https://www.thethingsnetwork.org/forum/uploads/default/original/3X/3/1/31f55ebe87393bef9d409b94624e6cfaa25ad2e7.png)

If you are able to reprogram your device, it would benefit from having Rx1 set to 5s - which you have to change here:

> <https://github.com/mcci-catena/arduino-lmic/blob/c3e32beffdaa0bc37b4b6a3b8474eab84b7f66c3/src/lmic/lorabase.h#L68>

If you can’t, then set the RX1 Delay to 1s and keep your fingers crossed.

---

<div class="post-metadata">

**Author:** ![descartes](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/descartes/32/47220_2.png) [@descartes](https://www.thethingsnetwork.org/forum/u/descartes)\
**Post date:** [June 1, 2021, 10:22am UTC](https://www.thethingsnetwork.org/forum/t/stack-v3-sends-unrequested-downlink-data-for-new-abp-device/48327/5 "2021-06-01T10:22:45Z")

</div>

I’m working on scripts to help with migration with ABP devices but need input from @Jeff-UK to move forward.

---

<div class="post-metadata">

**Author:** ![tomtor](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/tomtor/32/47264_2.png) [@tomtor](https://www.thethingsnetwork.org/forum/u/tomtor)\
**Post date:** [June 1, 2021, 10:32am UTC](https://www.thethingsnetwork.org/forum/t/stack-v3-sends-unrequested-downlink-data-for-new-abp-device/48327/6 "2021-06-01T10:32:16Z")

</div>

Thanks, it works OK now!

---

<div class="post-metadata">

**Author:** ![Jeff-UK](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/jeff-uk/32/35697_2.png) [@Jeff-UK](https://www.thethingsnetwork.org/forum/u/Jeff-UK)\
**Post date:** [June 1, 2021, 7:34pm UTC](https://www.thethingsnetwork.org/forum/t/stack-v3-sends-unrequested-downlink-data-for-new-abp-device/48327/7 "2021-06-01T19:34:26Z")

</div>

Only picked up message this evening will call you in morning 😉

---

<div class="post-metadata">

**Author:** ![jenertsA](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/jenertsa/32/37682_2.png) [@jenertsA](https://www.thethingsnetwork.org/forum/u/jenertsA)\
**Post date:** [June 29, 2021, 8:59am UTC](https://www.thethingsnetwork.org/forum/t/stack-v3-sends-unrequested-downlink-data-for-new-abp-device/48327/8 "2021-06-29T08:59:40Z")

</div>

Encountered the same thing, defined MAC settings but the issue of the unrequested downlink is persistent.  
Any other ideas?

---

<div class="post-metadata">

**Author:** ![descartes](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/descartes/32/47220_2.png) [@descartes](https://www.thethingsnetwork.org/forum/u/descartes)\
**Post date:** [June 29, 2021, 9:13am UTC](https://www.thethingsnetwork.org/forum/t/stack-v3-sends-unrequested-downlink-data-for-new-abp-device/48327/9 "2021-06-29T09:13:30Z")

</div>

Hard to say as we don’t know what the “unrequested downlink” is.

---

<div class="post-metadata">

**Author:** ![kersing](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/kersing/32/44777_2.png) [@kersing](https://www.thethingsnetwork.org/forum/u/kersing)\
**Post date:** [June 29, 2021, 9:30am UTC](https://www.thethingsnetwork.org/forum/t/stack-v3-sends-unrequested-downlink-data-for-new-abp-device/48327/10 "2021-06-29T09:30:19Z")

</div>

Does the node receive and process the MAC command?

---

<div class="post-metadata">

**Author:** ![jenertsA](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/jenertsa/32/37682_2.png) [@jenertsA](https://www.thethingsnetwork.org/forum/u/jenertsA)\
**Post date:** [June 29, 2021, 8:58pm UTC](https://www.thethingsnetwork.org/forum/t/stack-v3-sends-unrequested-downlink-data-for-new-abp-device/48327/11 "2021-06-29T20:58:56Z")

</div>

Sometimes one should just wait a moment.  
Defining factory preset frequencies helped. Changed nothing else and it is working ok now.

---

<div class="post-metadata">

**Author:** ![jenertsA](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/jenertsa/32/37682_2.png) [@jenertsA](https://www.thethingsnetwork.org/forum/u/jenertsA)\
**Post date:** [July 14, 2021, 7:20pm UTC](https://www.thethingsnetwork.org/forum/t/stack-v3-sends-unrequested-downlink-data-for-new-abp-device/48327/12 "2021-07-14T19:20:14Z")

</div>

Back to this problem.  
there are some times when downlinks are not sent and some when it is.  
I am using MCCI\_LoRaWAN\_LMIC library for my ABP node, library docs say it can handle MAC commands, really don’t know where to look how it does it and what command is received.  
I have Atmega328P as MCU, so not a lot of space and setting debugging to 1 pushes sketch over the size limit.  
I have tried setting the Advanced setting on device registration but it doesn’t help.  
Downlinks don’t show up in application consol, they can be seen only from the gateway console but note downlink counter increases.

I know ABP is bad and etc. but I have old hardware from 2018 that uses TPL5111 as a system timer and doing join requests each time isn’t a good idea in my opinion. currently working on the next node design and it will use over the air activation.

---

<div class="post-metadata">

**Author:** ![johan](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/johan/32/45177_2.png) [@johan](https://www.thethingsnetwork.org/forum/u/johan)\
**Post date:** [July 14, 2021, 8:46pm UTC](https://www.thethingsnetwork.org/forum/t/stack-v3-sends-unrequested-downlink-data-for-new-abp-device/48327/13 "2021-07-14T20:46:43Z")

</div>

Enable verbose events in the end device live data view. You’ll see which MAC commands NS is scheduling.

You can disable this by making sure that `desired-parameters` are the same as `current-parameters`. Also you can tune the `DevStatusReq` periodicity and interval. This currently only is configurable per device with the CLI.

---

<div class="post-metadata">

**Author:** ![descartes](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/descartes/32/47220_2.png) [@descartes](https://www.thethingsnetwork.org/forum/u/descartes)\
**Post date:** [July 14, 2021, 9:56pm UTC](https://www.thethingsnetwork.org/forum/t/stack-v3-sends-unrequested-downlink-data-for-new-abp-device/48327/14 "2021-07-14T21:56:01Z")

</div>

> [@jenertsA](#):
>
> I am using MCCI\_LoRaWAN\_LMIC library

Which version?

If you go in to config.h you can un-comment the DISABLE\_JOIN, DISABLE\_PING and DISABLE\_BEACONS which will free up a fair amount of Flash & RAM

For the device registration it’s important you setup the different frequencies for the region so that the network server doesn’t try to set them up needlessly.

Which region are you?

---

<div class="post-metadata">

**Author:** ![jenertsA](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/jenertsa/32/37682_2.png) [@jenertsA](https://www.thethingsnetwork.org/forum/u/jenertsA)\
**Post date:** [July 15, 2021, 5:39am UTC](https://www.thethingsnetwork.org/forum/t/stack-v3-sends-unrequested-downlink-data-for-new-abp-device/48327/15 "2021-07-15T05:39:22Z")

</div>

Will check the version once I am at the table.

Yes, indeed I tried to disable OTAA and B, C class features to get some extra space to run debugging (only mode 1)

All I got was stream of “?” in seral port and node that fails to send uplinks.

I am in EU  
Thanks for the help!

---

<div class="post-metadata">

**Author:** ![bluejedi](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/bluejedi/32/44639_2.png) [@bluejedi](https://www.thethingsnetwork.org/forum/u/bluejedi)\
**Post date:** [July 15, 2021, 7:09am UTC](https://www.thethingsnetwork.org/forum/t/stack-v3-sends-unrequested-downlink-data-for-new-abp-device/48327/16 "2021-07-15T07:09:31Z")

</div>

> [@descartes](#):
>
> > [@jenertsA](#):
> >
> > I am using MCCI\_LoRaWAN\_LMIC library
> 
> Which version?

IIRC you should use at least MCCI LMIC version 3.3.0 (or was it 3.0.99?). In older versions MAC commands were much less supported.

---

<div class="post-metadata">

**Author:** ![bluejedi](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/bluejedi/32/44639_2.png) [@bluejedi](https://www.thethingsnetwork.org/forum/u/bluejedi)\
**Post date:** [July 15, 2021, 7:20am UTC](https://www.thethingsnetwork.org/forum/t/stack-v3-sends-unrequested-downlink-data-for-new-abp-device/48327/17 "2021-07-15T07:20:42Z")

</div>

> [@johan](#):
>
> You can disable this by making sure that `desired-parameters` are the same as `current-parameters`.

Can you be more explicit about ‘this’ and what are/where to find `desired-parameters` and `current-parameters`?

---

<div class="post-metadata">

**Author:** ![descartes](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/descartes/32/47220_2.png) [@descartes](https://www.thethingsnetwork.org/forum/u/descartes)\
**Post date:** [July 15, 2021, 7:45am UTC](https://www.thethingsnetwork.org/forum/t/stack-v3-sends-unrequested-downlink-data-for-new-abp-device/48327/18 "2021-07-15T07:45:22Z")

</div>

> [@bluejedi](#):
>
> you should use at least MCCI LMIC version 3.3.0 (or was it 3.0.99?)

Terry publicly says that it is 3.2.0 that really gets MAC commands working but there isn’t much extra in 3.3.0 so that would be preferable. 4.0.0 seems to be paving the way with the new event / callback system.

---

<div class="post-metadata">

**Author:** ![bluejedi](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/bluejedi/32/44639_2.png) [@bluejedi](https://www.thethingsnetwork.org/forum/u/bluejedi)\
**Post date:** [July 15, 2021, 7:50am UTC](https://www.thethingsnetwork.org/forum/t/stack-v3-sends-unrequested-downlink-data-for-new-abp-device/48327/19 "2021-07-15T07:50:48Z")

</div>

> [@descartes](#):
>
> Terry publicly says that it is 3.2.0 that really gets MAC commands working

That is what I thought but did only find 3.0.99 and 3.3.0 under [Releases](https://github.com/mcci-catena/arduino-lmic/releases).

---

<div class="post-metadata">

**Author:** ![johan](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/johan/32/45177_2.png) [@johan](https://www.thethingsnetwork.org/forum/u/johan)\
**Post date:** [July 15, 2021, 9:04am UTC](https://www.thethingsnetwork.org/forum/t/stack-v3-sends-unrequested-downlink-data-for-new-abp-device/48327/20 "2021-07-15T09:04:23Z")

</div>

> [@bluejedi](#):
>
> Can you be more explicit about ‘this’ and what are/where to find `desired-parameters` and `current-parameters`?

Sorry about that. Few steps:

1. Install and configure CLI: [https://www.thethingsindustries.com/docs/the-things-stack/interact/cli/installing-cli/](https://www.thethingsindustries.com/docs/getting-started/cli/installing-cli/)
2. See how the `ttn-lw-cli end-devices get` command works: [https://www.thethingsindustries.com/docs/reference/cli/end\_devices/#command-ttn-lw-cli-end-devices-get](https://www.thethingsindustries.com/docs/reference/cli/end_devices/#command-ttn-lw-cli-end-devices-get)
3. Compare the `current-parameters` with `desired-parameters` by doing a:

```bash
$ ttn-lw-cli end-devices get <app-id> <device-id> \
    --mac-state.current-parameters \
    --mac-state.desired-parameters \
    --mac-settings.status-count-periodicity \
    --mac-settings.status-time-periodicity

```

Generally speaking, the difference between current and desired parameters trigger the generation of MAC commands. Could be channels, data rates, timing, duty cycle, etc etc. You can change desired parameters to reflect current parameters to avoid MAC command generation. You can also configure `mac-settings` so that there’s no gap between current and desired parameters, i.e. by configuring factory preset frequencies and RX1 delay. In the case of ABP, this then also need to be configured on the end device.

Besides all of this, NS by default requests the device status with `DevStatusReq`. You can tune how often this happens by the count periodicity (requests per number of downlink messages) or time periodicity (requests on an interval). Setting them to 0 stops NS from sending `DevStatusReq`.

In any case, please please please make sure you guys use certified LoRaWAN stacks.

[Next page](https://www.thethingsnetwork.org/forum/t/stack-v3-sends-unrequested-downlink-data-for-new-abp-device/48327.md?page=2)
