# Node loops in join accept

**URL:** <https://www.thethingsnetwork.org/forum/t/node-loops-in-join-accept/34822>\
**Category:** LMIC\
**Created:** [February 25, 2020, 2:20pm UTC](https://www.thethingsnetwork.org/forum/t/node-loops-in-join-accept/34822 "2020-02-25T14:20:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Reggoal](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/reggoal/32/25844_2.png) [@Reggoal](https://www.thethingsnetwork.org/forum/u/Reggoal)\
**Post date:** [February 25, 2020, 2:20pm UTC](https://www.thethingsnetwork.org/forum/t/node-loops-in-join-accept/34822/1 "2020-02-25T14:20:20Z")

</div>

Hi there,

I’ve been trying to make my node work for the past week and I still can’t manage to make it work.

I am in Canada using a **BSFrance v1.3 32u4ii** (clone of adafruit feather) and I setup a Rak gateway **(Rak2245 pi hat)** that I’ve configured accordingly.

The sketch I am using is the example LMIC ttn-otaa-feather-us915-dht from MCCI V3.10. This is the results I am getting:

From the device in Serial:

```auto

Starting
Temperature: nan *C
%RH nan
314613: EV_JOINING
315193: EV_TXSTART
719901: Unknown event: 20
721247: EV_TXSTART
1104576: Unknown event: 20
1310937: EV_TXSTART
1715651: Unknown event: 20
...
```

From the device in TTN:  
 ![image](https://www.thethingsnetwork.org/forum/uploads/default/original/3X/f/c/fc60589c8b9676e3cfc0bfbe02453171064c34b4.png)

From the gateway in TTN:  
 ![image](https://www.thethingsnetwork.org/forum/uploads/default/original/3X/f/1/f1594ccea78b46fbd3124fdbf73ffd4a9e95958f.png)

Sample Activation from Device Console:  
 ![image](https://www.thethingsnetwork.org/forum/uploads/default/original/3X/1/f/1fc8d91ce8428c28b1ce16d0196c2957f9e0818d.png)

Sample Join Request from Gateway Console:  
 ![image](https://www.thethingsnetwork.org/forum/uploads/default/original/3X/d/d/ddd817a8b5047429bb430e5187d15d99973b2d5a.png)

Sample Join Accept from Gateway Console:  
 ![image](https://www.thethingsnetwork.org/forum/uploads/default/original/3X/8/e/8e1392d83cae29417d0b730a3eadfe88440cc38d.png)

It seems I am stuck in a Join Request/Accept loop and I don’t know why.

So far I’ve been looking at a bunch of forum posts to try and figure out what is going on so this what I’ve tried :

- Double check Device EUI (lsb), App EUI(lsb), App Key(msb)
- Make sure my Gateway is configured for US915
- Make sure my project\_config contains US915, Lora version 1.0.2
- Make sure my lmic pinout is correct
- Make sure my gateway is far enough from my node (over 10m)
- Added LMIC\_setClockError(MAX\_CLOCK\_ERROR \* 1 / 100);
- Tried different MCCI librairy version

I don’t know what to try next and I’m losing hope. Hopefully I gave enough valuable informations to get some help.

Thank you

---

<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:** [February 25, 2020, 6:14pm UTC](https://www.thethingsnetwork.org/forum/t/node-loops-in-join-accept/34822/2 "2020-02-25T18:14:30Z")

</div>

On the TTN side, the Join Request is accepted, so the keys and all should be okay. But somehow either the gateway is not transmitting the Join Accept though it has been told to do so (see the gateway’s logs; any chance there’s a lot of network latency?), or the device is not receiving or not handling it.

So, look in the gateway’s logs. Also, I’d focus on the following:

> [@Reggoal](#):
>
> ```auto
> Temperature: nan *C
> %RH nan
> ...
> 719901: Unknown event: 20
> 
> ```

The `nan`s seem to indicate the sensor did not return any reading. That doesn’t look good and could very well be related to wiring or pin mapping, or to using a wrong library for your sensor. Both might also affect the working of the LoRa chip.

> [@Reggoal](#):
>
> The sketch I am using is the example LMIC ttn-otaa-feather-us915-dht from MCCI V3.10.

Assuming you meant 3.1.0, then as per the 3.1.0 code:

> <https://github.com/mcci-catena/arduino-lmic/blob/v3.1.0/src/lmic/lmic.h#L261-L267>

…the index 20 is `EV_JOIN_TXCOMPLETE`. So, that should be handled just fine by the example code you’re using:

> <https://github.com/mcci-catena/arduino-lmic/blob/v3.1.0/examples/ttn-otaa-feather-us915-dht22/ttn-otaa-feather-us915-dht22.ino#L201-L203>

I’d guess you’re using a different library than you think you are. (Or are not using the 3.1.0 example. Next time, please link to the code you’re using.)

---

<div class="post-metadata">

**Author:** ![cslorabox](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/cslorabox/32/35697_2.png) [@cslorabox](https://www.thethingsnetwork.org/forum/u/cslorabox)\
**Post date:** [February 25, 2020, 8:11pm UTC](https://www.thethingsnetwork.org/forum/t/node-loops-in-join-accept/34822/3 "2020-02-25T20:11:05Z")

</div>

Given that join accepts are being generated by the network, it’s likely that the node is either not activating the receiver at the precisely correct time, or not activating them at all.

Receive window timing has historically been very hard to get right in LMiC particularly when trying to make it portable, and less common platforms like the ATmega32u4 are going to make it trickier still. The main development platforms for that repo are the Feather M0 and their custom BSP for their STM32L073 board, those are most likely to work right.
