Issue with Heltec LoRa ESP32 V2 Not Connecting to TTN Server

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:

board-Heltec LoRa ESP32 V2

TTN_esp32 library version: 0.1.7
ESP32 board manager version: 3.0.2
Code Used:

#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(30000);
}

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

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 with same code:

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

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

maybe a problem with Migration from ESP32 Arduino Core 2.x to 3.0

have a look at migration-guides/release-5.x/5.0
under esp_system it states
The Interrupt Watchdog API (functions/types/macros prefixed with esp_int_wdt_) has been made into a private API. Thus, the previous include path #include "esp_int_wdt.h" has been removed. If users still require usage of the Interrupt Watchdog API (though this is not recommended), it can be included via #include "esp_private/esp_int_wdt.h".

many programs/libraries which worked without problems with V2.x need updating to work with V3
as an interim solution you could install a V2 core but then new code implemented for V3 would not compile

EDIT: looking back File>Examples>TTN_esp32>ttn-otaa worked OK on a heltec LoRa 32 V2 in June 2023 and displayed

Starting
Using stored keys to join
Joining TTN ..........................
joined !
---------------Status--------------
Device EUI: xxxxxxxxxxxxxxxxxxxxxxxxxx
Application EUI: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
netid: 13
devaddr: xxxxxxxxxxxxxxxxx
NwkSKey: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
AppSKey: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
data rate: 5
tx power: 14dB
freq: 868100000Hz
-----------------------------------
Temp: 18.300001 TTN_CayenneLPP:  1 67 00B7
Temp: 18.400002 TTN_CayenneLPP:  1 67 00B8
Temp: 18.500002 TTN_CayenneLPP:  1 67 00B9
Temp: 18.600002 TTN_CayenneLPP:  1 67 00BA
Temp: 18.700003 TTN_CayenneLPP:  1 67 00BB

replaced my DevEUI, AppEUI, etc with xxxxx

no longer compiles - same error as you reported in post 1

looking at TheThingsNetwork_esp32 API reference it states
This repository is archived. Please use EzLoRaWAN for now. The new library can use SX127X and SX126X chips.

compiling File>Examples>EzLoRaWAN>ttn-otaa gives error message

ttn-otaa.ino:1:10: fatal error: LoRaWan_CayenneLPP.h: No such file or directory
    1 | #include <LoRaWan_CayenneLPP.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~
compilation terminated.

the library LoRaWan_CayenneLPP does not appear to exist

the MCCI Arduino LoRaWAN Library works OK with the Heltec LoRa 32 V2 with settings

// ESP32 heltec LoRa V2
const lmic_pinmap lmic_pins = {
  .nss = 18,
  .rxtx = LMIC_UNUSED_PIN,
  .rst = 14,
  .dio = { 26, 35, LMIC_UNUSED_PIN },  //DIO0, DIO1 and DIO2 connected
};

I have deleted your other cross-post @vijay_incise.

Cross-posting is against the Arduino forum rules. The reason is that duplicate posts can waste the time of the people trying to help. Someone might spend a lot of time investigating and writing a detailed answer on one topic, without knowing that someone else already did the same in the other topic.

Repeated cross-posting can result in a suspension from the forum.

In the future, please only create one topic for each distinct subject matter. This is basic forum etiquette, as explained in the "How to get the best out of this forum" guide. It contains a lot of other useful information. Please read it.

Thanks in advance for your cooperation.

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