Join accepted but nothing else

Hi there
I am using a Heltec CubeCell-Board(HTCC-AB01)
I successfully sent a message to the TTN network, I see my message in the console but nothing afterwards (no webhook is called).
According to CHATGPT my node continually tries to join, this request is correctly received bij TTN, but the Join Accept is not sent, received or processed correctly by my node.

Here is my TTN logging (json export)
And I have my code below.

TTN export:

{
    "name": "as.up.join.forward",
    "time": "2025-03-25T21:10:00.263607529Z",
    "identifiers": [
      {
        "device_ids": {
          "device_id": "heltec",
          "application_ids": {
            "application_id": "boat-readings"
          },
          "dev_eui": "0700B30D5xxxx00",
          "join_eui": "AA2EAC40xxxx8701",
          "dev_addr": "260xxxx51"
        }
      }
    ],
    "data": {
      "@type": "type.googleapis.com/ttn.lorawan.v3.ApplicationUp",
      "end_device_ids": {
        "device_id": "heltec",
        "application_ids": {
          "application_id": "boat-readings"
        },
        "dev_eui": "0700B30DxxxxxD00",
        "join_eui": "AA2EAC4xxxxx88701",
        "dev_addr": "260xxxx51"
      },
      "correlation_ids": [
        "gs:uplink:01JQ7J80GS42MxxxxY0TNRH"
      ],
      "received_at": "2025-03-25T21:10:00.240180261Z",
      "join_accept": {
        "session_key_id": "AZXPJxxxxs9wG+XxL0bA==",
        "received_at": "2025-03-25T21:09:58.426314320Z"
      }
    },
    "correlation_ids": [
      "gs:uplink:01JQ7J80GS42M8xxxxxY0TNRH"
    ],
    "origin": "ip-10-100-12-124.eu-west-1.compute.internal",
    "context": {
      "tenant-id": "CgN0dG4="
    },
    "visibility": {
      "rights": [
        "RIGHT_APPLICATION_TRAFFIC_READ"
      ]
    },
    "unique_id": "01JQ7J82Axxxxx9PBP46TBFE"
  },
  {
    "name": "ns.up.join.process",
    "time": "2025-03-25T21:09:58.633216679Z",
    "identifiers": [
      {
        "device_ids": {
          "device_id": "heltec",
          "application_ids": {
            "application_id": "boat-readings"
          },
          "dev_eui": "0700B30xxxxxD00",
          "join_eui": "AA2EAC4054xxxxxxx01",
          "dev_addr": "260Bxxxx"
        }
      }
    ],
    "data": {
      "@type": "type.googleapis.com/ttn.lorawan.v3.UplinkMessage",
      "raw_payload": "AAGHuFRArC6xxxxxAAfIm0x5rtE=",
      "payload": {
        "m_hdr": {},
        "mic": "THmu0Q==",
        "join_request_payload": {
          "join_eui": "AA2EAC40xxxxx1",
          "dev_eui": "0700B30DxxxxD00",
          "dev_nonce": "9BC8"
        }
      },
      "settings": {
        "data_rate": {
          "lora": {
            "bandwidth": 125000,
            "spreading_factor": 7,
            "coding_rate": "4/5"
          }
        },
        "frequency": "868100000",
        "timestamp": 4023655843,
        "time": "2025-03-25T21:09:48.406743049Z"
      },
      "rx_metadata": [
        {
          "gateway_ids": {
            "gateway_id": "ttn-gw-nieuwvennep",
            "eui": "B827EBxxxxx16473"
          },
          "time": "2025-03-25T21:09:48.406743049Z",
          "timestamp": 4023655843,
          "rssi": -117,
          "channel_rssi": -117,
          "snr": -0.25,
          "location": {
            "latitude": 52.2673550827753,
            "longitude": 4.62064858520747,
            "source": "SOURCE_REGISTRY"
          },
          "uplink_token": "CiAKHgoSdHRuLWd3LW5pZXVxxxxxx/mFkcxCju9D+DhoMCKa3jL8GExxxx6SN5Fk=",
          "received_at": "2025-03-25T21:09:58.409923299Z"
        }
      ],
      "recei

Mycode:

#include <LoRaWan_APP.h>
#include <Arduino.h>
#include <Seeed_BME280.h>
#include <Wire.h>
#include "ttnparams.h"


uint32_t appTxDutyCycle = 300000; // the frequency of readings, in milliseconds(set 300s)

uint16_t userChannelsMask[6]={ 0x00FF,0x0000,0x0000,0x0000,0x0000,0x0000 };
LoRaMacRegion_t loraWanRegion = ACTIVE_REGION;
DeviceClass_t  loraWanClass = LORAWAN_CLASS;
bool overTheAirActivation = LORAWAN_NETMODE;
bool loraWanAdr = LORAWAN_ADR;
bool keepNet = LORAWAN_NET_RESERVE;
//bool isTxConfirmed = LORAWAN_UPLINKMODE;
bool isTxConfirmed = true;

uint8_t appPort = 2;
uint8_t confirmedNbTrials = 4;

int temperature, humidity, batteryVoltage, batteryLevel;
long pressure;

BME280 bme280;

static void prepareTxFrame( uint8_t port )
{
  // This enables the output to power the sensor
  pinMode(Vext, OUTPUT);
  digitalWrite(Vext, LOW);
  delay(500);

  if(!bme280.init()){
    
      Serial.println("Device error!");
    
  }

  // This delay is required to allow the sensor time to init
  delay(1000);
  
  temperature = bme280.getTemperature() * 100;
  humidity = bme280.getHumidity();
  pressure = bme280.getPressure();
  
  Wire.end();
  
  // Turn the power to the sensor off again
  digitalWrite(Vext, HIGH);
  
  batteryVoltage = getBatteryVoltage();
  batteryLevel = (BoardGetBatteryLevel() * 100) / 254;
 

  appDataSize = 12;
  appData[0] = highByte(temperature);
  appData[1] = lowByte(temperature);

  appData[2] = highByte(humidity);
  appData[3] = lowByte(humidity);

  appData[4] = (byte) ((pressure & 0xFF000000) >> 24 );
  appData[5] = (byte) ((pressure & 0x00FF0000) >> 16 );
  appData[6] = (byte) ((pressure & 0x0000FF00) >> 8  );
  appData[7] = (byte) ((pressure & 0X000000FF)       );

  appData[8] = highByte(batteryVoltage);
  appData[9] = lowByte(batteryVoltage);

  appData[10] = highByte(batteryLevel);
  appData[11] = lowByte(batteryLevel);

  
    Serial.print("Temperature: ");
    Serial.print(temperature / 100);
    Serial.print("C, Humidity: ");
    Serial.print(humidity);
    Serial.print("%, Pressure: ");
    Serial.print(pressure / 100);
    Serial.print(" mbar, Battery Voltage: ");
    Serial.print(batteryVoltage);
    Serial.print(" mV, Battery Level: ");
    Serial.print(batteryLevel);
    Serial.println(" %");
  
}



void McpsIndication(McpsIndication_t *mcpsIndication) {
    Serial.println("Incoming LoRa packet detected!");
    if (mcpsIndication->Status != LORAMAC_EVENT_INFO_STATUS_OK) {
        Serial.println("Uplink failed!");
        return;
    }
    Serial.println("Uplink successfully received by TTN!");
}


void setup() 
{
    boardInitMcu();  // Initialiseer de Heltec board MCU

    Serial.begin(115200);
    delay(2000);  // Wacht even zodat de serial monitor goed opstart

    LoRaWAN.ifskipjoin();  // Controleert of join moet worden overgeslagen
   
    deviceState = DEVICE_STATE_INIT;
}


void loop()
{
  switch( deviceState )
  {
    case DEVICE_STATE_INIT:
    {
      printDevParam();
      LoRaWAN.init(loraWanClass,loraWanRegion);
      deviceState = DEVICE_STATE_JOIN;
      break;
    }
    case DEVICE_STATE_JOIN:
    {
      LoRaWAN.join();
      Serial.println("Trying to join TTN...");
      LoRaWAN.setDataRateForNoADR(3); // Stel RX2 in op SF9BW125 (betere ontvangst)
      break;
    }
    case DEVICE_STATE_SEND:
    {
      prepareTxFrame( appPort );
      Serial.println("Sending data...");
      LoRaWAN.send();
      deviceState = DEVICE_STATE_CYCLE;
      break;
    }
    case DEVICE_STATE_CYCLE:
    {
      // Schedule next packet transmission
      txDutyCycleTime = appTxDutyCycle + randr( 0, APP_TX_DUTYCYCLE_RND );
      LoRaWAN.cycle(txDutyCycleTime);
      deviceState = DEVICE_STATE_SLEEP;
      break;
    }
    case DEVICE_STATE_SLEEP:
    {
      LoRaWAN.sleep();
      break;
    }
    default:
    {
      deviceState = DEVICE_STATE_INIT;
      break;
    }
  }
}

Hi there. Join Request received but Join Accept not heard by device is a common issue with many search results to be had that ChatGPT is too stupid to read or understand because LoRaWAN, like onions & Shrek, has many layers - perhaps best you do it yourself with the magnifying icon at the top of the page.

TL;DR: What is the RSSI/SNR of the JR in the gateway console? Is there a JA in the device console? Does this show as being transmitted by the gateway console? How far apart is your device & gateway?

Please format code & logs using the </> tool - helps enormously with reading it.

Thanks, you’re totally right about formatting. I forgot that, after hours of trying to get it to work :slight_smile:

Your questions:

RSSI = -117
SNR = -0.25
Device Console says:

Forward join-accept message

{
  "name": "as.up.join.forward",
  "time": "2025-03-25T21:52:59.309057385Z",
  "identifiers": [
    {
      "device_ids": {
        "device_id": "heltec",
        "application_ids": {
          "application_id": "boat-readings"
        }
      }
    }
  ],
  "context": {
    "tenant-id": "CgN0dG4="
  },
  "visibility": {
    "rights": [
      "RIGHT_APPLICATION_TRAFFIC_READ"
    ]
  },
  "unique_id": "01JQ7MPRXDxxxxxxKGZGW7Y0JW"
}

successfully processed join-request

{
  "name": "ns.up.join.process",
  "time": "2025-03-25T21:52:57.703066198Z",
  "identifiers": [
    {
      "device_ids": {
        "device_id": "heltec",
        "application_ids": {
          "application_id": "boat-readings"
        }
      }
    }
  ],
  "context": {
    "tenant-id": "CgN0dG4="
  },
  "visibility": {
    "rights": [
      "RIGHT_APPLICATION_TRAFFIC_READ"
    ]
  },
  "unique_id": "01JQ7MxxxxxPV0BS04D45FF"
}

join accept

{
  "name": "js.join.accept",
  "time": "2025-03-25T21:52:57.510479320Z",
  "identifiers": [
    {
      "device_ids": {
        "device_id": "heltec",
        "application_ids": {
          "application_id": "boat-readings"
        }
      }
    }
  ],
  "context": {
    "tenant-id": "CgN0dG4="
  },
  "visibility": {
    "rights": [
      "RIGHT_APPLICATION_TRAFFIC_READ"
    ]
  },
  "unique_id": "01JQ7xxxxxxxX7RX16GCQ22P"
}

I will try to find out searching through the forum some more … I tried before posting this but I got lost.

Here some additional logging:

3:48:33.735 -> Copyright @2019-2020 Heltec Automation.All rights reserved.
13:48:34.063 -> 
13:48:34.063 -> AT Rev 1.3
13:48:34.063 -> +AutoLPM=1
13:48:34.063 -> 
13:48:34.063 -> +LORAWAN=1
13:48:34.063 -> 
13:48:34.063 -> +KeepNet=0
13:48:34.063 -> +OTAA=1
13:48:34.063 -> +Class=A
13:48:34.063 -> +ADR=0
13:48:34.063 -> +IsTxConfirmed=0
13:48:34.063 -> +AppPort=2
13:48:34.063 -> +DutyCycle=300000
13:48:34.063 -> +ConfirmedNbTrials=4
13:48:34.063 -> +ChMask=0000000000000000000000FF
13:48:34.095 -> +DevEui=0700B30D5xxxxxx0(For OTAA Mode)
13:48:34.095 -> +AppEui=AA2EAC4054Bxxxxx1(For OTAA Mode)
13:48:34.095 -> +AppKey=0FA0A00350AB0ExxxxxxC02B0A(For OTAA Mode)
13:48:34.095 -> +NwkSKey=893CE5CBF47B5EFDxxxxxD70DC8C(For ABP Mode)
13:48:34.095 -> +AppSKey=A7F0843D911C8C09xxxxxC4F685E6E(For ABP Mode)
13:48:34.095 -> +DevAddr=260Bxxxxx(For ABP Mode)
13:48:34.095 -> 
13:48:34.095 -> 
13:48:34.095 -> LoRaWAN EU868 Class A start!
13:48:34.095 -> 
13:48:34.226 -> joining...TX on freq 868100000 Hz at DR 5
13:48:34.259 -> TX on freq 868100000 Hz at DR 5
13:48:34.325 -> Event : Tx Done
13:48:39.310 -> RX on freq 868100000 Hz at DR 5
13:48:39.375 -> Event : Rx Timeout
13:48:40.364 -> RX on freq 869525000 Hz at DR 0
13:48:40.561 -> Event : Rx Timeout
13:48:41.284 -> TX on freq 868100000 Hz at DR 5
13:48:41.284 -> TX on freq 868100000 Hz at DR 5
13:48:41.350 -> Event : Tx Done
13:48:46.338 -> RX on freq 868100000 Hz at DR 5
13:48:46.404 -> Event : Rx Timeout
13:48:47.396 -> RX on freq 869525000 Hz at DR 0
13:48:49.208 -> Event : Rx Done
13:48:49.208 -> TX on freq 868100000 Hz at DR 5

Quite marginal, is there an antenna fitted?

:white_check_mark: Check - don’t need the JSON at this point

:thinking:

I’d reasonably assume it is transmitted but it should be easy to check on the web console and ideally on the gateway log, but no where near as important as …

:thinking:

Without this information no further analysis can be performed.

Thank you.

I am one step further now: my webhook is called! This probably means that the join was successful My console says “Forward uplink data message” and then “webhook failed”.

The two things I changed were: newer version of board-manager, as I found on the Heltec pages.
But probably the best solution was that I put the antenna higher up (from 1st floor to the roof of my house). Maybe I could send the message, but not receive anything from the gateway.

My next step is to solve why my webhook fails…

{
  "name": "as.webhook.fail",
  "time": "2025-03-26T14:35:57.530676448Z",
  "identifiers": [
    {
      "device_ids": {
        "device_id": "heltec",
        "application_ids": {
          "application_id": "boat-readings"
        },
        "dev_eui": "0700B30D507Exxxx",
        "join_eui": "AA2EAC4054B8xxxx",
        "dev_addr": "260B2xxx"
      }
    }
  ],
  "data": {
    "@type": "type.googleapis.com/ttn.lorawan.v3.ErrorDetails",
    "namespace": "pkg/applicationserver/io/web/sink",
    "name": "request",
    "message_format": "request",
    "attributes": {
      "status_code": 405,
      "url": "https://eu-central-1-1.aws.cloud2.influxdata.com",
      "webhook_id": "influxdeebee"
    },
    "correlation_id": "7814bc29ee2147dcad93718e5xxxxxa",
    "code": 14,
    "details": [
      {
        "@type": "type.googleapis.com/google.protobuf.Struct",
        "value": {
          "body": "<html>\r\n<head><title>405 Not Allowed</title></head>\r\n<body>\r\n<center><h1>405 Not Allowed</h1></center>\r\n<hr><center>nginx/1.26.3</center>\r\n</body>\r\n</html>\r\n"
        }
      }
    ]
  },
  "correlation_ids": [
    "gs:uplink:01JQ9E38DRD9G7xxxxxHWCJN1VC"
  ],
  "origin": "ip-10-100-14-99.eu-west-1.compute.internal",
  "context": {
    "tenant-id": "CgN0dG4="
  },
  "visibility": {
    "rights": [
      "RIGHT_APPLICATION_TRAFFIC_READ"
    ]
  },
  "unique_id": "01JQ9E38PTP6Bxxxx9G575T"
}

If you don’t want to answer, just say so, but sometimes there’s a bit more detail behind the question and if you have reception issues at a later date, we’ll be back to asking all over again.

Which is the standard problem - as per forum search - comes up at least once per fortnight so all the discussions are there to be read.

As to why your web hook isn’t working, it’s very likely to be a 450 Not Allowed issue on the server.

… I did read a lot of forum posts, from which I learned that sometimes sending is possible, but receiving is more difficult. Which is why I put the device one floor higher up.
The funny thing is that I was at this point (webhook problem) a few weeks ago until suddenly this Join-loop problem came up. I guess there are no guarantees in Lora-life…

And still no distance.

I want to answer all questions to get this solved, and for others to learn from.

Anyway, thanks for helping!

2,1 Km, no high obstakles between me and the gateway.

And still no distance …

There aren’t any other than death & taxes.

But you can minimise issues by answering questions when you ask for help!

1 Like

Woo Hoo!

So being aware of free space losses and link budget would help you in this instance.

This is part of LW 101 from the CTO of TTI so this is as good as it gets. It’s a whole firehose of info so watching in small chunks is highly recommended.

We assume people have absorbed most of the Learn section when answering: https://www.thethingsnetwork.org/docs/lorawan/

CHATGPT :see_no_evil:

is this what we have to expect in the future?!

anyways. i use 2 of these boards without a hassle.

1st thing what comes into my mind: correct channel setup?! (channelsmask, region, class, OTAA, etc)
2nd: a high quality pigtail and antenna? (this is the hard part…there is so much china shit out there)
3rd: are you really sure app/devEUI and KEY are correct and in the right byte order?!

1 Like

Thanks for the relpy!!

No everything was correctly configured, the problem was the antenna that had enough ‘reach’ to send, but not receive messages from the gateway. That was solved by putting the sensor higher up in my house.
This thread can be closed.

PS chatgpt?
Yes. Or similar AI solutions.

Really got things working for the first time!

1 Like