# Issue with Heltec LoRa ESP32 V2 Not Connecting to TTN Server

**URL:** <https://www.thethingsnetwork.org/forum/t/issue-with-heltec-lora-esp32-v2-not-connecting-to-ttn-server/68640>\
**Category:** Uncategorized\
**Tags:** end-devices\
**Created:** [July 17, 2024, 9:47am UTC](https://www.thethingsnetwork.org/forum/t/issue-with-heltec-lora-esp32-v2-not-connecting-to-ttn-server/68640 "2024-07-17T09:47:41Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![adiincise](https://www.thethingsnetwork.org/forum/letter_avatar_proxy/v4/letter/a/ee59a6/32.png) [@adiincise](https://www.thethingsnetwork.org/forum/u/adiincise)\
**Post date:** [July 17, 2024, 9:47am UTC](https://www.thethingsnetwork.org/forum/t/issue-with-heltec-lora-esp32-v2-not-connecting-to-ttn-server/68640/1 "2024-07-17T09:47:42Z")

</div>

Hello,

I am experiencing difficulties connecting my Heltec LoRa ESP32 V2 module to The Things Network (TTN) server using the OTAA example code provided by the `TTN_esp32` library. I have encountered errors with both the latest and previous versions of the library and ESP32 board manager.

Setup Details:

- Heltec LoRa ESP32 V2
- `TTN_esp32` library version: 0.1.7
- ESP32 board manager version: 3.0.2

Code Used:

```auto
#include <TTN_esp32.h>
#include "TTN_CayenneLPP.h"

const char* devEui = "70B3D57ED005EC18";
const char* appEui = "0000000000000100";
const char* appKey = "C7A02794D8631B7A2E307F766C8BC3F6";

TTN_esp32 ttn;
TTN_CayenneLPP lpp;

void message(const uint8_t* payload, size_t size, uint8_t port, int rssi)
{
    Serial.println("-- MESSAGE");
    Serial.printf("Received %d bytes on port %d (RSSI=%ddB) :", size, port, rssi);
    for (int i = 0; i < size; i++)
    {
        Serial.printf(" %02X", payload[i]);
    }
    Serial.println();
}

void setup()
{
    Serial.begin(115200);
    Serial.println("Starting");
    ttn.begin();
    ttn.onMessage(message);
    ttn.join(devEui, appEui, appKey);
    Serial.print("Joining TTN ");
    while (!ttn.isJoined())
    {
        Serial.print(".");
        delay(500);
    }
    Serial.println("\njoined !");
    ttn.showStatus();
}

void loop()
{
    static float nb = 18.2;
    nb += 0.1;
    lpp.reset();
    lpp.addTemperature(1, nb);
    if (ttn.sendBytes(lpp.getBuffer(), lpp.getSize()))
    {
        Serial.printf("Temp: %f TTN_CayenneLPP: %d %x %02X%02X\n", nb, lpp.getBuffer()[0], lpp.getBuffer()[1],
            lpp.getBuffer()[2], lpp.getBuffer()[3]);
    }
    delay(10000);
}

```

Errors Encountered With `TTN_esp32` library version 0.1.7 and ESP32 board manager version 3.0.2:

```auto

c:\Users\Vijay\Documents\Arduino\libraries\TTN_esp32\src\TTN_BLE_esp32.cpp:4:10: fatal error: esp_int_wdt.h: No such file or directory
    4 | #include <esp_int_wdt.h>
      | ^ ~~~~~~~~~~~~~~
compilation terminated.
exit status 1
Compilation error: exit status 1

```

tried another version:

Errors Encountered With `TTN_esp32` library version 0.1.6 and ESP32 board manager version 2.0.17:

```auto
ELF file SHA256: 32253762a57caf58

Rebooting...
Starting
Using stored keys to join
FAILURE 
c:\Users\Vijay\Documents\Arduino\libraries\TTN_esp32\src\lmic\lmic\radio.c:1164
Guru Meditation Error: Core 1 panic'ed (Interrupt wdt timeout on CPU1). 

Core 1 register dump:

Backtrace: 0x400f82c7:0x3ffbc830 0x400e084a:0x3ffbc850 0x40089538:0x3ffbc870

```

c:\Users\Vijay\Documents\Arduino\libraries\TTN\_esp32\src\lmic\lmic\radio.c:1164-\> ASSERT( i != 0 ); // this is line i’ve been facing issue.

Steps Taken:

1. Verified the correct installation of the latest ESP32 board support package.
2. Tried different versions of the `TTN_esp32` library and ESP32 board manager.
3. Ensured the device is powered properly and connected with antenna .

Despite these efforts, the issue persists. I would appreciate any guidance or suggestions on resolving this problem.

Thank you for your assistance.

Best regards  
Vijay

---

<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:** [July 17, 2024, 10:05am UTC](https://www.thethingsnetwork.org/forum/t/issue-with-heltec-lora-esp32-v2-not-connecting-to-ttn-server/68640/2 "2024-07-17T10:05:37Z")

</div>

> [@adiincise](#):
>
> delay(10000);

If this means what I think it means (IANASE!) then please read up on TTN FUP, and amend accordingly and come back to confirm, will unlist thread until then.

---

<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:** [July 17, 2024, 10:05am UTC](https://www.thethingsnetwork.org/forum/t/issue-with-heltec-lora-esp32-v2-not-connecting-to-ttn-server/68640/3 "2024-07-17T10:05:47Z")

</div>



---

<div class="post-metadata">

**Author:** ![adiincise](https://www.thethingsnetwork.org/forum/letter_avatar_proxy/v4/letter/a/ee59a6/32.png) [@adiincise](https://www.thethingsnetwork.org/forum/u/adiincise)\
**Post date:** [July 17, 2024, 10:26am UTC](https://www.thethingsnetwork.org/forum/t/issue-with-heltec-lora-esp32-v2-not-connecting-to-ttn-server/68640/4 "2024-07-17T10:26:13Z")

</div>

I have adjusted the code to send data every 5 minutes, which should be within the FUP guidelines. However, I am still encountering issues.

---

<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:** [July 17, 2024, 12:24pm UTC](https://www.thethingsnetwork.org/forum/t/issue-with-heltec-lora-esp32-v2-not-connecting-to-ttn-server/68640/5 "2024-07-17T12:24:12Z")

</div>



---

<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 17, 2024, 1:51pm UTC](https://www.thethingsnetwork.org/forum/t/issue-with-heltec-lora-esp32-v2-not-connecting-to-ttn-server/68640/6 "2024-07-17T13:51:30Z")

</div>

Please edit your post with the pencil tool at the bottom of it so you can format the code with the \</\> tool - it will make it about 1,000,000% easier to read ±56,551.87%

And tell us what actually happens in the serial debug and gateway and device console - serial debug should NOT be a screen shot.

---

<div class="post-metadata">

**Author:** ![Johan\_Scheepers](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/johan_scheepers/32/48536_2.png) [@Johan\_Scheepers](https://www.thethingsnetwork.org/forum/u/Johan_Scheepers)\
**Post date:** [July 17, 2024, 2:00pm UTC](https://www.thethingsnetwork.org/forum/t/issue-with-heltec-lora-esp32-v2-not-connecting-to-ttn-server/68640/7 "2024-07-17T14:00:44Z")

</div>

> [@adiincise](#):
>
> c:\Users\Vijay\Documents\Arduino\libraries\TTN\_esp32\src\TTN\_BLE\_esp32.cpp:4:10: fatal error: esp\_int\_wdt.h: No such file or directory

You are missing something - ‘TTN\_BLE\_esp32.cpp’

---

<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 17, 2024, 2:05pm UTC](https://www.thethingsnetwork.org/forum/t/issue-with-heltec-lora-esp32-v2-not-connecting-to-ttn-server/68640/8 "2024-07-17T14:05:07Z")

</div>

Erm, no, it means that `esp_int_wdt.h` can’t be found.

---

<div class="post-metadata">

**Author:** ![adiincise](https://www.thethingsnetwork.org/forum/letter_avatar_proxy/v4/letter/a/ee59a6/32.png) [@adiincise](https://www.thethingsnetwork.org/forum/u/adiincise)\
**Post date:** [July 18, 2024, 6:59am UTC](https://www.thethingsnetwork.org/forum/t/issue-with-heltec-lora-esp32-v2-not-connecting-to-ttn-server/68640/9 "2024-07-18T06:59:01Z")

</div>

Hi Nick,  
please find edited post in mentioned above  
Here are the infos:

Have a look at the Device Log it seems the board is not sending the Join message but it does not receive the Accept message.

Gateway log in console:

 ![gateway_console](https://www.thethingsnetwork.org/forum/uploads/default/original/3X/e/7/e783ec139d4a51710c4917b2dd6d7567b9a5c4f0.png)

gateway console :

````auto
time="2024-07-18 12:01:08" level=INFO msg="iotgw process will restart"
time="2024-07-18 12:01:03" level=INFO msg="rcv from gateway: addr = 192.168.1.4:49988, type = PullData"
time="2024-07-18 12:00:53" level=INFO msg="rcv from gateway: addr = 192.168.1.4:49988, type = PullData"
time="2024-07-18 12:00:50" level=INFO msg="rcv from gateway: addr = 192.168.1.4:35936, type = PushData"
time="2024-07-18 12:00:43" level=INFO msg="rcv from gateway: addr = 192.168.1.4:49988, type = PullData"
time="2024-07-18 12:00:33" level=INFO msg="rcv from gateway: addr = 192.168.1.4:49988, type = PullData"
time="2024-07-18 12:00:22" level=INFO msg="rcv from gateway: addr = 192.168.1.4:49988, type = PullData"
time="2024-07-18 12:00:20" level=INFO msg="rcv from gateway: addr = 192.168.1.4:35936, type = PushData"
time="2024-07-18 12:00:12" level=INFO msg="rcv from gateway: addr = 192.168.1.4:49988, type = PullData"
time="2024-07-18 12:00:02" level=INFO msg="rcv from gateway: addr = 192.168.1.4:49988, type = PullData"
time="2024-07-18 11:59:52" level=INFO msg="rcv from gateway: addr = 192.168.1.4:49988, type = PullData"
time="2024-07-18 11:59:50" level=INFO msg="rcv from gateway: addr = 192.168.1.4:35936, type = PushData"
time="2024-07-18 11:59:42" level=INFO msg="rcv from gateway: addr = 192.168.1.4:49988, type = PullData"
time="2024-07-18 11:59:32" level=INFO msg="rcv from gateway: addr = 192.168.1.4:49988, type = PullData"
time="2024-07-18 11:59:21" level=INFO msg="rcv from gateway: addr = 192.168.1.4:49988, type = PullData"
time="2024-07-18 11:59:20" level=INFO msg="rcv from gateway: addr = 192.168.1.4:35936, type = PushData"
time="2024-07-18 11:59:11" level=INFO msg="rcv from gateway: addr = 192.168.1.4:49988, type = PullData"
time="2024-07-18 11:59:01" level=INFO msg="rcv from gateway: addr = 192.168.1.4:49988, type = PullData"
time="2024-07-18 11:58:51" level=INFO msg="rcv from gateway: addr = 192.168.1.4:49988, type = PullData"
time="2024-07-18 11:58:50" level=INFO msg="rcv from gateway: addr = 192.168.1.4:35936, type = PushData"
time="2024-07-18 11:58:41" level=INFO msg="rcv from gateway: addr = 192.168.1.4:49988, type = PullData"
time="2024-07-18 11:58:31" level=INFO msg="rcv from gateway: addr = 192.168.1.4:49988, type = PullData"
time="2024-07-18 11:58:20" level=INFO msg="gateway 54d0b4fffe35f5b0 connected"
time="2024-07-18 11:58:20" level=INFO msg="rcv from gateway: addr = 192.168.1.4:49988, type = PullData"
time="2024-07-18 11:57:55" level=INFO msg="database size is 104 KB"
time="2024-07-18 11:57:55" level=INFO msg="iotgw process will restart"
time="2024-07-18 11:57:52" level=INFO msg="rcv from gateway: addr = 192.168.1.4:57184, type = PullData"
time="2024-07-18 11:57:41" level=INFO msg="rcv from gateway: addr = 192.168.1.4:57184, type = PullData"
time="2024-07-18 11:57:38" level=INFO msg="rcv from gateway: addr = 192.168.1.4:41396, type = PushData"
time="2024-07-18 11:57:31" level=INFO msg="rcv from gateway: addr = 192.168.1.4:57184, type = PullData"
time="2024-07-18 11:57:21" level=INFO msg="rcv from gateway: addr = 192.168.1.4:57184, type = PullData"
time="2024-07-18 11:57:11" level=INFO msg="rcv from gateway: addr = 192.168.1.4:57184, type = PullData"
time="2024-07-18 11:57:08" level=INFO msg="rcv from gateway: addr = 192.168.1.4:41396, type = PushData"
time="2024-07-18 11:57:01" level=INFO msg="rcv from gateway: addr = 192.168.1.4:57184, type = PullData"
time="2024-07-18 11:56:50" level=INFO msg="rcv from gateway: addr = 192.168.1.4:57184, type = PullData"
time="2024-07-18 11:56:40" level=INFO msg="rcv from gateway: addr = 192.168.1.4:57184, type = PullData"
time="2024-07-18 11:56:38" level=INFO msg="rcv from gateway: addr = 192.168.1.4:41396, type = PushData"
time="2024-07-18 11:56:30" level=INFO msg="rcv from gateway: addr = 192.168.1.4:57184, type = PullData"
time="2024-07-18 11:56:20" level=INFO msg="rcv from gateway: addr = 192.168.1.4:57184, type = PullData"
time="2024-07-18 11:56:10" level=INFO msg="rcv from gateway: addr = 192.168.1.4:57184, type = PullData"
time="2024-07-18 11:56:08" level=INFO msg="rcv from gateway: addr = 192.168.1.4:41396, type = PushData"
time="2024-07-18 11:55:59" level=INFO msg="rcv from gateway: addr = 192.168.1.4:57184, type = PullData"
time="2024-07-18 11:55:49" level=INFO msg="rcv from gateway: addr = 192.168.1.4:57184, type = PullData"
time="2024-07-18 11:55:39" level=INFO msg="rcv from gateway: addr = 192.168.1.4:57184, type = PullData"
time="2024-07-18 11:55:38" level=INFO msg="rcv from gateway: addr = 192.168.1.4:41396, type = PushData"
time="2024-07-18 11:55:29" level=INFO msg="rcv from gateway: addr = 192.168.1.4:57184, type = PullData"```
````

---

<div class="post-metadata">

**Author:** ![Johan\_Scheepers](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/johan_scheepers/32/48536_2.png) [@Johan\_Scheepers](https://www.thethingsnetwork.org/forum/u/Johan_Scheepers)\
**Post date:** [July 18, 2024, 7:33am UTC](https://www.thethingsnetwork.org/forum/t/issue-with-heltec-lora-esp32-v2-not-connecting-to-ttn-server/68640/10 "2024-07-18T07:33:22Z")

</div>

Those messages are not from your node, it is network server to gateway.

If you can’t compile you code on the node, the node ill never try to communicate with the gateway.

Console log will not help you.

---

<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 18, 2024, 7:55am UTC](https://www.thethingsnetwork.org/forum/t/issue-with-heltec-lora-esp32-v2-not-connecting-to-ttn-server/68640/11 "2024-07-18T07:55:57Z")

</div>

The OP was asked for that information because I couldn’t see the details in the original post.

Now that I can, I see that the code is compiling and running but there is an issue on line 1164 of radio.c

No doubt someone will look to see what that section is about that is causing an assert.
