Chirpstack not detecting device

I’m sending my data to the Chirpstack server using the Lora device connected to Aurdino. I have provided my devEUI, App key, and appEUI in my Arduino code. When I used Chirpstack V3, it worked properly, but my device was not detected when I tried to use the Chirpstack V4 version. It’s never activated. I’m from India, so I’m using IN865 as the region, and in my Arduino library properties, I have activated IN866, which works for Indian frequency(865-867).
Why is this happening??

Hard to do anything only knowing your region, explain your architecture a little.

What gateway are you using? Are you using Gateway bridge / MQTT forwarder on gateway or on server? Are you just using a fresh docker install? Are there any errors in the logs? Are you receiving any join requests in the device events? etc…

If I had to take a pure shot in the dark Id say its probably a band mismatch, have you configured your MQTT topic prefixes?

1 Like

I’m using Gateway bridge on server. Yes I installed docker recently for this work. And also when i’m adding a gateway there is no option to select our region but after creating gateway it’s automatically detecting europe frequency eu868.

And also i’m getting errors in logs. i’m pasting them here

and also i’m pasting my arduino code here:
#include <arduino_lmic_hal_boards.h>
#include <arduino_lmic_lorawan_compliance.h>
#include <arduino_lmic_user_configuration.h>
#include <lmic.h>
#include <arduino_lmic_hal_configuration.h>
#include <arduino_lmic.h>
const int MAX_VALUE = 10;
const int MAX_DATA_LENGTH = 3;
uint8_t mydata[MAX_DATA_LENGTH];
#include <lmic.h>
#include <hal/hal.h>
#include <SPI.h>

static const u1_t PROGMEM APPEUI[8]={0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
void os_getArtEui (u1_t* buf) { memcpy_P(buf, APPEUI, 8);}

static const u1_t PROGMEM DEVEUI[8]={ 0x33,0xBD,0xEF,0x92,0x0E,0xD5,0x68,0x24 };
//2468d50e92efbd33
void os_getDevEui (u1_t* buf) { memcpy_P(buf, DEVEUI, 8);}

static const u1_t PROGMEM APPKEY[16] = { 0x17, 0xC3, 0x2B, 0xF5, 0xE2, 0x54, 0x0A, 0xBD, 0xA0, 0x57, 0x14, 0xA9, 0x2A, 0x49, 0x99, 0x03 };
//17c32bf5e2540abda05714a92a499903
void os_getDevKey (u1_t* buf) { memcpy_P(buf, APPKEY, 16);}
static osjob_t sendjob;
const unsigned TX_INTERVAL = 30;

// Pin mapping
const lmic_pinmap lmic_pins = {
.nss = 10,
.rxtx = LMIC_UNUSED_PIN,
.rst = 9,
.dio = {2, 6, 7},
};

void printHex2(unsigned v) {
v &= 0xff;
if (v < 16)
Serial.print(‘0’);
Serial.print(v, HEX);
}

void onEvent (ev_t ev) {
Serial.print(os_getTime());
Serial.print(": ");
switch(ev) {
case EV_SCAN_TIMEOUT:
Serial.println(F(“EV_SCAN_TIMEOUT”));
break;
case EV_BEACON_FOUND:
Serial.println(F(“EV_BEACON_FOUND”));
break;
case EV_BEACON_MISSED:
Serial.println(F(“EV_BEACON_MISSED”));
break;
case EV_BEACON_TRACKED:
Serial.println(F(“EV_BEACON_TRACKED”));
break;
case EV_JOINING:
Serial.println(F(“EV_JOINING”));
break;
case EV_JOINED:
Serial.println(F(“EV_JOINED”));
{
u4_t netid = 0;
devaddr_t devaddr = 0;
u1_t nwkKey[16];
u1_t artKey[16];
LMIC_getSessionKeys(&netid, &devaddr, nwkKey, artKey);
Serial.print("netid: “);
Serial.println(netid, DEC);
Serial.print(“devaddr: “);
Serial.println(devaddr, HEX);
Serial.print(“AppSKey: “);
for (size_t i=0; i<sizeof(artKey); ++i) {
if (i != 0)
Serial.print(”-”);
printHex2(artKey[i]);
}
Serial.println(””);
Serial.print(“NwkSKey: “);
for (size_t i=0; i<sizeof(nwkKey); ++i) {
if (i != 0)
Serial.print(”-”);
printHex2(nwkKey[i]);
}
Serial.println();
} LMIC_setLinkCheckMode(0);
break;
case EV_JOIN_FAILED:
Serial.println(F(“EV_JOIN_FAILED”));
break;
case EV_REJOIN_FAILED:
Serial.println(F(“EV_REJOIN_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”));
for (int i = LMIC.dataBeg; i < LMIC.dataBeg + LMIC.dataLen; i++) {
Serial.print(LMIC.frame[i], HEX);
Serial.print(” "); }
}
os_setTimedCallback(&sendjob, os_getTime()+sec2osticks(TX_INTERVAL), do_send);
break;
case EV_LOST_TSYNC:
Serial.println(F(“EV_LOST_TSYNC”));
break;
case EV_RESET:
Serial.println(F(“EV_RESET”));
break;
case EV_RXCOMPLETE:
Serial.println(F(“EV_RXCOMPLETE”));
break;
case EV_LINK_DEAD:
Serial.println(F(“EV_LINK_DEAD”));
break;
case EV_LINK_ALIVE:
Serial.println(F(“EV_LINK_ALIVE”));
break;
case EV_TXSTART:
Serial.println(F(“EV_TXSTART”));
break;
case EV_TXCANCELED:
Serial.println(F(“EV_TXCANCELED”));
break;
case EV_RXSTART:
/* do not print anything – it wrecks timing */
break;
case EV_JOIN_TXCOMPLETE:
Serial.println(F(“EV_JOIN_TXCOMPLETE: no JoinAccept”));
break;

    default:
        Serial.print(F("Unknown event: "));
        Serial.println((unsigned) ev);
        break;
}

}

void do_send(osjob_t* j){
// Check if there is not a current TX/RX job running
if (LMIC.opmode & OP_TXRXPEND) {
Serial.println(F(“OP_TXRXPEND, not sending”));
} else {
static int counter = 1;
// Convert counter to string and update mydata
sprintf((char*)mydata, “%d”, counter);
// Prepare upstream data transmission at the next possible time.
LMIC_setTxData2(1, mydata, sizeof(mydata)-1, 0);
Serial.print(F("Packet queued: "));
Serial.println((char*)mydata);
// Increment counter
counter++;
if (counter > MAX_VALUE) {
counter = 1; // Reset counter if it exceeds maximum value
}
}
// Next TX is scheduled after TX_COMPLETE event.
}

void setup() {
Serial.begin(9600);
Serial.println(F(“Starting”));

// LMIC init
os_init();
// Reset the MAC state. Session and pending data transfers will be discarded.
LMIC_reset();

// Start job (sending automatically starts OTAA too)
do_send(&sendjob);

}

void loop() {
os_runloop_once();
}
and this is the output in serial monitor


I kept all information. If you need anything else please let me know and please help with this.

I’m a new user. I can’t send multiple files once. SO to be clear I sent each screenshot. So you may get an idea what is the problem exactly

Give us the screenshot of LoRaWAN Frames of the gateway.

And give us the screenshot of Event and LoRaWAN Frames of the device.

It seems that the Join Requests of your device do not reach the server or are not accepted by the server yet.
Join Request > Join Accept > Uplink.

chirpstack-1 | 2024-05-18T09:33:01.475941Z ERROR chirpstack::uplink: Deduplication error error=No channel found for frequency: 865402500, dr: 0
I’m getting this error so I added the 865402500 frequency in region files(region_eu868.toml)
then I got this.


As you can see that, here the frequency is same as the frequency that i added to toml file.
But after doing this i got same deduplication error with other frequency, this is the error
chirpstack-1 | 2024-05-18T11:25:22.543828Z ERROR chirpstack::uplink: Deduplication error error=No channel found for frequency: 865062500, dr: 2.
what does it mean should i add all the frequencies from 865-867 one by one to work properly??
And also why is gateway automatically taking eu868 as region??

EU868 and IN8xx may have some same frequencies.
So the server may send Join Accept but your device may not receive it.

Check the region and topic_prefix of your ChirpStack gateway bridge. The default value is eu868.

Your gateway should show IN8xx in ChirpStack first.


There is no option to add region in Add gateway and it is automatically taking EUxxx frequency.
So can we change the frequency, if so how?? or is this default??

Check the toml file of your ChirpStack gateway BRIDGE.


This is the toml file, what should i change here

Read the configuration here and search for “region”.
https://www.chirpstack.io/docs/chirpstack-gateway-bridge/configuration.html

Yeah thanks it’s working now

1 Like