LMIC & Heltec LoRa no join accept

"C:\Users\Administrator\Documents\Arduino\libraries\MCCI_LoRaWAN_LMIC_library\project_config\lmic_project_config.h"

// project-specific definitions
//#define CFG_eu868 1
//#define CFG_us915 1
//#define CFG_au915 1
//#define CFG_as923 1
// #define LMIC_COUNTRY_CODE LMIC_COUNTRY_CODE_JP      /* for as923-JP; also define CFG_as923 */
//#define CFG_kr920 1
#define CFG_in866 1
//#define CFG_sx1276_radio 1
//#define CFG_sx1261_radio 1
#define CFG_sx1262_radio 1
//#define ARDUINO_heltec_wifi_lora_32_V3
//#define LMIC_USE_INTERRUPTS

// my ttn_otaa code

/*******************************************************************************
 * LoRaWAN OTAA Example for Heltec WiFi LoRa 32 (V2) - India IN865 MHz
 * 
 * Uses your device credentials from ChirpStack:
 * AppEUI (LSB), DevEUI (LSB), AppKey (MSB).
 *******************************************************************************/

#include <lmic.h>
#include <hal/hal.h>
#include <SPI.h>

// -----------------------------------------------------------------------------
// Device credentials (from ChirpStack / TTN)
// -----------------------------------------------------------------------------

// AppEUI in LSB (reverse order shown in ChirpStack)
static const u1_t PROGMEM APPEUI[8] = { 0x53, 0x25, 0x86, 0x16, 0x35, 0x94, 0x78, 0x15 };
void os_getArtEui (u1_t* buf) { memcpy_P(buf, APPEUI, 8); }

// DevEUI in LSB (reverse order shown in ChirpStack)
static const u1_t PROGMEM DEVEUI[8] = { 0xCA, 0x32, 0x07, 0xD0, 0x7E, 0xD5, 0xB3, 0x70};
void os_getDevEui (u1_t* buf) { memcpy_P(buf, DEVEUI, 8); }

// AppKey in MSB (as shown in ChirpStack)
static const u1_t PROGMEM APPKEY[16] = { 0xD7, 0x10, 0xA9, 0xAA, 0x08, 0x9E, 0xFA, 0xF7, 0x75, 0xC6, 0x90, 0x7D, 0xCC, 0x5A, 0x51, 0xB7};
void os_getDevKey (u1_t* buf) { memcpy_P(buf, APPKEY, 16); }

// -----------------------------------------------------------------------------
// LoRaWAN settings
// -----------------------------------------------------------------------------
static uint8_t mydata[] = "Hello, world!";
static osjob_t sendjob;

// Send interval (in seconds)
const unsigned TX_INTERVAL = 60;

// Heltec WiFi LoRa 32 V2 Pin mapping
const lmic_pinmap lmic_pins = {
    .nss = 18,
    .rxtx = LMIC_UNUSED_PIN,
    .rst = 14,
    .dio = {26, 35, 33},
};

// -----------------------------------------------------------------------------
// Utility
// -----------------------------------------------------------------------------
void printHex2(unsigned v) {
    v &= 0xff;
    if (v < 16)
        Serial.print('0');
    Serial.print(v, HEX);
}

// -----------------------------------------------------------------------------
// LMIC Event Handler
// -----------------------------------------------------------------------------
void onEvent (ev_t ev) {
    Serial.print(os_getTime());
    Serial.print(": ");
    switch(ev) {
        case EV_JOINING:
            Serial.println(F("EV_JOINING: Joining..."));
            break;
        case EV_JOINED:
            Serial.println(F("EV_JOINED: Successfully joined network!"));
            LMIC_setLinkCheckMode(0); // Disable link check (optional)
            break;
        case EV_JOIN_FAILED:
            Serial.println(F("EV_JOIN_FAILED"));
            break;
        case EV_TXCOMPLETE:
            Serial.println(F("EV_TXCOMPLETE (includes waiting for RX windows)"));
            if (LMIC.txrxFlags & TXRX_ACK)
              Serial.println(F("Received ack"));
            if (LMIC.dataLen) {
              Serial.print(F("Received "));
              Serial.print(LMIC.dataLen);
              Serial.println(F(" bytes of payload"));
            }
            os_setTimedCallback(&sendjob, os_getTime()+sec2osticks(TX_INTERVAL), do_send);
            break;
        case EV_TXSTART:
            Serial.println(F("EV_TXSTART"));
            break;
        case EV_JOIN_TXCOMPLETE:
            Serial.println(F("EV_JOIN_TXCOMPLETE: No JoinAccept received"));
            break;
        default:
            Serial.print(F("Unknown event: "));
            Serial.println((unsigned) ev);
            break;
    }
}

// -----------------------------------------------------------------------------
// Send Function
// -----------------------------------------------------------------------------
void do_send(osjob_t* j){
    if (LMIC.opmode & OP_TXRXPEND) {
        Serial.println(F("OP_TXRXPEND, not sending"));
    } else {
        LMIC_setTxData2(1, mydata, sizeof(mydata)-1, 0);
        Serial.println(F("Packet queued"));
    }
}

// -----------------------------------------------------------------------------
// Setup / Loop
// -----------------------------------------------------------------------------
void setup() {
    Serial.begin(9600);
    Serial.println(F("Starting"));

    // LMIC init
    os_init();
    LMIC_reset();

    // Set data rate and TX power for IN865
    LMIC_setDrTxpow(DR_SF7,14);

    // Start OTAA join
    do_send(&sendjob);
}

void loop() {
    os_runloop_once();
}

//My output

Starting
Packet queued
3240: EV_JOINING: Joining...
391039: EV_TXSTART
773476: EV_JOIN_TXCOMPLETE: No JoinAccept received
1069649: EV_TXSTART
1452084: EV_JOIN_TXCOMPLETE: No JoinAccept received
1961618: EV_TXSTART
2344054: EV_JOIN_TXCOMPLETE: No JoinAccept received
3062820: EV_TXSTART
3448471: EV_JOIN_TXCOMPLETE: No JoinAccept received
3803824: EV_TXSTART
4189474: EV_JOIN_TXCOMPLETE: No JoinAccept received

Hello everyone im using SX1302 LoRaWAN Gateway HAT connected TTN perfectly then im tring to add end device using WiFi LoRa 32(V2), ESP32 + SX1262 LoRa Node im getting this outputs

Please stop hijacking threads. Find a suitable one or start a new one.

Please search the forum, the No Join Accept received issue used to be weekly but most people find the answers using search before having to post.

OT
Why i don’t can create my own thread?
I don’t find a button.
John

If you have spent enough time reading the forum, visited a few threads then you should be golden if you look on main forum thread listing as below

The fact you could post this message says you are well on the way. Please read up on forum rules and guidance and explore the other forum posts to get a sense of how we roll - possibly doing good searches - before diving in with questions that may have been covered before or which are dealt with in the documentation for TTN & TTI (dont forget the youtube vid’s!) then you will be well on your way to being a good, valued Forumite :slight_smile:

https://www.thethingsnetwork.org/forum/t/dragino-lt-22222-lt-downlink-decoder-error/66356/13

Can you open this threed?

How is it relevant to your issue with LMIC & no join accept?

Nothing, i don’t can create a own thread, and have the same LT-22222-L problem.

So the issue with joining has been resolved now?

Hello @prabha2205

did you have the HELTEC WiFi LoRa 32(v3)?

The unofficial library

Or did you hav the release Heltec WiFi LoRa 32 (V2) or Heltec WiFi LoRa 32 (V4) ?

Please answer this question - if you can’t join, there is no point sending downlinks to the Dragino.

Additionally, finding an unsolved thread was not what I had in mind when I said this:

to @prabha2205. This is a common issue solved many times and is not usually related to which library is in use.

You might try RadioLib instead Heltec LoRa Lib. This is a basic example.

But NOT the basic example provided on the repro - yours is somewhat tied to your unknown SX1262 wiring for your own band AND is an image in breach of forum guidelines about text as images.H

IF the OP hasn’t fixed this issue in the last 22 days, just linking to the RadioLib repro would be more appropriate as it links to different radio configurations across a range of modules.

looks as though you have the APPEUI and DEVEUI values swopped

e.g. my APPEUI looks like

// This EUI must be in little-endian format, so least-significant-byte
// first. When copying an EUI from ttnctl output, this means to reverse
// the bytes. For TTN issued EUIs the last bytes should be 0xD5, 0xB3,
// 0x70.
static const u1_t PROGMEM APPEUI[8]={0xx, 0xx, 0xx, 0xD0, 0x7E, 0xD5, 0xB3, 0x70 };

My basic example is for Heltec WiFi LoRa 32(V.3) as johncom asked for it.