/Arduino/libraries/MCCI_LoRaWAN_LMIC_library/src/lmic/radio.c:923

Hi Folks,

need help: I’m building a TTN node with Arduino Mega 2560 Rev3 and RFM SX1276.
I tried 2 szenarios (OTAA & ABP), but they all boil down to this same error…

14:16:46.923 -> /home/user/Arduino/libraries/MCCI_LoRaWAN_LMIC_library/src/lmic/radio.c:923

Wiring is mapped to code as follows (although the layout shows an Arduino Uno, I believe this should work same for the Arduino Mega I’m using):

// Pin mapping
const lmic_pinmap lmic_pins = {
    .nss = 10,
    .rxtx = LMIC_UNUSED_PIN,
    .rst = 5,
    .dio = {2, 3, LMIC_UNUSED_PIN},
};

image

What could be wrong?

Dear @freddx RFM95 is a 3.3v device but Arduino Mega is a 5V device. It could be a problem with the voltage level of the communication lines (SPI).

Thanks for your reply @jfmateos
Does this means they are totally incompatible or is there a way to tweak the Arduino down to 3.3v?

Dear @freddx I don’t know a simple way to interface this 2 systems… I would recommend you using a 3.3V Arduino, like the Arduino pro mini 8MHz, or any other board in the supported hardware in the LMIC library documentation:

I’ve tried with the Arduino Pro mini, it worked perfectly, but my code is somehow too big (occupes ~85% of memory) and it won’t work anymore. Do you have a solution for that?

If the program is so big I would use a SAMD21 board like the Feather M0

As examination of that file would show, this assert is triggered when the radio gives an unexpected respose.

Typically that’s due to a wiring error with the SPI pins, which apart from NSS and RST are fixed, it does not have anything to do with the DIO map.

Power issues could also be at play.

And driving the radio with over-voltage 5v signals could have permanently damaged it.

Thanks for your help.

I think the power mismatch is effectively the problem. I’ll look further to two alternatives: I’ve ordered a

I’ll give them a try…
Cheers

You will find that LMIC-node will help you hit the ground running.

The Feather M0 will need a minor fully documented board mod - an extra wire - but has first class support from the underlying LMIC library. It will also need a suitable length wire (8.4cm) as an antenna - best to use solid core so it can stand to attention.

The ATmega2560 has bags of flash & SRAM so will be fine.

With these things, reading the docs and going step-by-step will pretty much guarantee success.

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

DO NOT DOUBLE POST! - It splits the efforts of volunteers and contributors to the forum and makes indexing and finding information harder. Also per your earlier post that I had to silence due to egrarious breach of TTN FUP I note you have finally updated Tx rep rate to better comply (will still be SF dependent!) and as requested came back to original thread to confirm action. Original thread has been relisted.

Far better to add a button such that you can Tx on demand vs banging away at the server/infrastructure repeatidly where clearly your solution isnt working…sending over and over wont suddenly make it work!

As original post relisted am closing this one…