Data visible in the gateway console, but not the device's one

I am trying to link The Things Gateway and The Things Node together.

They are both successfully registered. I am using the Arduino program Basic from TheThingsNode library. The arduino monitor shows that data is being sent from the node, and the gateway console updates with new downlink data if I press a button or move the node.

On the device console I can see that the status is active and the frame count goes up, but nothing is showing up in the application data page. Any idea why ?

Screen Shot 2020-11-27 at 5.22.54 PM
Screen Shot 2020-11-27 at 5.24.12 PM
Screen Shot 2020-11-27 at 5.24.46 PM
Screen Shot 2020-11-27 at 5.30.42 PM

Please click-expand one of the messages from the device as shown by the gateway view.

It may be that it contains only network-level housekeeping traffic and no application data.

Do you have the application page open during transmissions? The console only shows ‘life’ traffic, that is traffic that arrives while the page is open.
Is the application registered in the same region the gateway is registered?

Could you elaborate on that ? I see that the device adress from received event matches the node. Here’s the data

Uplink

Dev Address

26022C93

Network: The Things Network

Net ID: 0x13

Region: World

Physical Payload

40932C02260009000338E7E1CCD2065539237A

Event Data

“lora”: {

“spreading_factor”: 7,

“bandwidth”: 125,

“air_time”: 51456000

},

“coding_rate”: “4/5”,

“timestamp”: “2020-11-28T00:03:38.906Z”,

“rssi”: -71,

“snr”: 9.75,

“dev_addr”: “26022C93”,

“frequency”: 904500000

}

{
“gw_id”: “thethingsnetwork_gateway”,
“payload”: “QJMsAiYACQADOOfhzNIGVTkjeg==”,
“f_cnt”: 9,
“lora”: {
“spreading_factor”: 7,
“bandwidth”: 125,
“air_time”: 51456000
},
“coding_rate”: “4/5”,
“timestamp”: “2020-11-28T00:03:38.906Z”,
“rssi”: -71,
“snr”: 9.75,
“dev_addr”: “26022C93”,
“frequency”: 904500000
}

yes to both

That’s traffic on port 3, which should be application data.

Unless something got messed up the with keys or the session post-join…

I redid the activation procedure and that solved it.

Hi. May I know how did you redo the activation procedure? Because I am facing the same problem

Try deleting your specific application in the console : console -> application -> setting -> delete application. Then follow the activation video below. Hope that helps !

You probably shouldn’t delete the application, but just force the device to re-join.

Thank you for your reply

I am using a LoRa gateway not the things network gateway. Is this still applicable to a non TTN node? If it is, how do I force the device to re-join? Thank you

No one can help you unless you identify the specific node you are using.

First do a search for that node, and also for guidance from the manufacturer of that node or the software running on it. Often entirely removing power or re-flashing would force a re-join (it really shouldn’t but developers tend to be lazy and not actually implement the rather challenging requirements of the LoRaWAN spec).

If you don’t find any information on forcing your particular node to re-join, and you are in fact trying to use it with TTN, then please create a new topic titled “How do I force node ____ to do an new OTAA join?” where the ____ is the specific identify of your node hardware and software.

(If you aren’t using the node with TTN, then I’m afraid the question isn’t really on topic and you need to use support resources from the manufacturer or network provider)

Thank you for your reply.

I made the node using Arduino and LoRa shield. Currently, I’m using ABP not OTAA.

That’s not a meaningful response.

Specific LoRa hardware.

Specific code used, as a link to the exact version.

And have you tried simply re-flashing the sketch???

Cytron LoRa-RFM Shield, this is the LoRa shield
915MHz LoRa Gateway Raspberry Pi Hat for the gateway.

This is the Arduino Code
#include <lmic.h>
#include <hal/hal.h>
#include <SPI.h>
#define Offset 0.00 // calibration for pH at standard value

static const PROGMEM u1_t NWKSKEY[16] = { FILLMEIN }; //Network session key with ttn
static const u1_t PROGMEM APPSKEY[16] = { FILLMEIN }; //Application key with ttn
static const u4_t DEVADDR = { 0x26041D70} ; //device address in ttn
void os_getArtEui (u1_t* buf) { }
void os_getDevEui (u1_t* buf) { }
void os_getDevKey (u1_t* buf) { }
static osjob_t sendjob;

const unsigned TX_INTERVAL =10;//transmission interval at time=1min
const lmic_pinmap lmic_pins = {
.nss = 10,
.rxtx = LMIC_UNUSED_PIN,
.rst = 7,
.dio = {2, 5, 6},
}; //LoRa pin mapping

void onEvent (ev_t ev) // controls the events occuring during the transmission
{
Serial.print(os_getTime());
Serial.print(": ");
switch (ev) {
case EV_SCAN_TIMEOUT:
Serial.println(F(“EV_SCAN_TIMEOUT”));
break;
case EV_BEACON_FOUND:
break;
case EV_BEACON_MISSED:
break;
case EV_BEACON_TRACKED:
break;
case EV_JOINING:
break;
case EV_JOINED:
break;
case EV_RFU1:
break;
case EV_JOIN_FAILED:
break;
case EV_REJOIN_FAILED:
break;
case EV_TXCOMPLETE:
if (LMIC.txrxFlags & TXRX_ACK)
Serial.println(F(“Received ack”));
if (LMIC.dataLen) {
Serial.println(F(“Received “));
Serial.println(LMIC.dataLen);
Serial.println(F(” bytes of payload”));
}
os_setTimedCallback(&sendjob, os_getTime() + sec2osticks(TX_INTERVAL), do_send);
break;
case EV_LOST_TSYNC:
break;
case EV_RESET:
break;
case EV_RXCOMPLETE:
break;
case EV_LINK_DEAD:
break;
case EV_LINK_ALIVE:
break;
default:
break;
} }

float t, turbidity, volt;
float p; // testing
int tempPin = 3; // testing
uint16_t temp;

float read_pH(int ph) //converts pH sensor reading to a pH value from 0-14
{
float voltage2= ph * (5.0 / 1023.0);
float pHValue = 3.5*voltage2+Offset;
return pHValue;
}

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
{
p = analogRead(A1); // reads the analog data from A1
for(int i=0; i<800; i++) //The voltage from the sensor is quite noisy
{
int sensorvalue = analogRead(A0);
volt += sensorvalue * (5.0 / 1023.0);
//so I take 800 samples of data from turbidity sensor and then average
//Convert the analog reading (0~1023) to a voltage (0 ~ 5V)
}

float pHlevel= read_pH(p);
float ntu;                         
  ntu = -1120.4*square(volt)+5742.3*volt-4352.9;  // Calculate the current NTU

// converting voltage from turbidity sensor to NTU
uint16_t n = ntu ;

uint16_t pHV = (pHlevel* 100) ;

temp=analogRead(tempPin);
float mv = ( temp/1023.0)*5000; 
float tempc = mv/10  ;  
uint16_t tempy=tempc;

/* temp=DHT.read11(dht_apin); // getting temperature value from pin
uint16_t tempy=temp; //showing and storing the value
// val = analogRead(tempPin); // testing
//temp=analogRead(tempPin); */

byte payload[6]; // testing

payload[0] = highByte(n);
payload[1] = lowByte(n);

payload[2] = highByte(tempy);
payload[3] = lowByte(tempy); 
   
payload[4] = highByte(pHV);
payload[5] = lowByte(pHV);
LMIC_setTxData2(1, payload, sizeof(payload), 0);
Serial.println(F("Packet queued"));

}
}
void setup() {
Serial.begin(115200);
Serial.println(F(“Starting”));
os_init();
LMIC_reset();
#ifdef PROGMEM
uint8_t appskey[sizeof(APPSKEY)];
uint8_t nwkskey[sizeof(NWKSKEY)];
memcpy_P(appskey, APPSKEY, sizeof(APPSKEY));
memcpy_P(nwkskey, NWKSKEY, sizeof(NWKSKEY));
LMIC_setSession (0x1, DEVADDR, nwkskey, appskey);
#else
LMIC_setSession (0x1, DEVADDR, NWKSKEY, APPSKEY);
#endif
#if defined(CFG_us915)
LMIC_selectSubBand(1);
#elif defined(CFG_au915)
LMIC_selectSubBand(3);
#endif
LMIC_setLinkCheckMode(0);
LMIC_setAdrMode(false);
LMIC.dn2Dr = DR_SF9;
LMIC_setDrTxpow(DR_SF7, 14);
do_send(&sendjob);
}
void loop()
{
os_runloop_once();
} // where the loop runs once

Yes I did. But nothing seemed to work