Why my gateway receive only twice data

I am in the orchard. I turned off the node 4. I reboot the TTOG gateway. The station 1 has 16 Tx. It means, it send 16 time the measure (each hour). I restart station 1 but no new measure are shown in the chart. It means, the gateway did not see the node and forward the message to TTN, sadly. My place is cloudy :partly_sunny: and the feather is bad since the 25th evening.

Well, it means any of:

  • the node did not actually transmit
  • the gateway did not receive a valid raw packet
  • the gateway did not communicate it to TTN servers
  • the TTN servers are not working
  • the packet is invalid because it is a repeat of a used sequence number
  • the packet is invalid because it has the wrong keys

The more of these you can rule out, the better position you are in to understand what is actually wrong.

Hello
Thank for your reply.
In my point of view

the node did not actually transmit

If the problem occured to one of them, may be. But all nodes, in the same time were not seen by the gateway with no transmission. I do not thinks, it’s the problem (i think, but may be I am wrong)

the gateway did not receive a valid raw packet

I do not think, as well, as the package were successfully sent for one moth, and at the same time there were no trasnmission for all of the nodes. Or may be I do not understand your suggestion

the gateway did not communicate it to TTN servers

May be but why there is traffic on my gateway (other than my nodes). I can not see traffic for my nodes

the TTN servers are not working

How can I check it? and why this issue append for now more tna 2 days. It’s a long delay for an interruption of service, isn’t? TTN should not inform this?

the packet is invalid because it is a repeat of a used sequence number

I do not understand what you means. May be a lack of knowledge from me :frowning:

the packet is invalid because it has the wrong keys

What do you means by keys? Network Session Key and App Session Key
Do you means the variable where are store the key could be corrupt or somethings else?
But as the 4 nodes are independent of each other, how can you explain that the key are wrong for all nodes at a point of time

Or do you means the gateway key? The gateway key is not store in the nodes and the gateway is seen at TTN console

What is interesting to observe, the gateway is usually seen each 15 second (‘last seen’ field of the gateway overview tab). Actually, the ‘last seen’ field show 3 minutes. In fact, it display 3 minute, 2 minute, 3 minute, 2minute. It never go the 1 second. Previously, I observed this value in seond: 12s, 9s 12s etc.
It’s look like now, the gateway is seen each 2/3 minutes. Is not long 2-3 minutes?

Personally, I would spin up a test node that was printing out both raw and encrypted hex dumps and frequency / spreading factor of everything it transmitted.

I’d check the gateway logs for the corresponding raw packets, modifying the packet forwarder to log them if it was not doing so already.

And I’d check the TTN console for that raw traffic.

If I was seeing raw traffic, but not application messages, I’d get the relevant keys (from the node if not the server) and decode the traffic myself and see if I though it was valid.

1 Like

Oups no correction!!!
I look at the traffic and I observed one of my node because of the DEV ADDR. Good to see it!!!
But nothing is transmitt to my web server/MySQL database.

But something look strange and correct me if I am wrong

Physical payload is

40F1160126801B0001AFE4EAEA41616284AA72FD8ACF72DF6B731D8496D47C5EC419927FBBA41FB2D5497CC3B0

If I convert it to text, the output is totally wrong. The conversion should show somethings like (a letter followed by a number and then a coma)
a12,b34,c87,d123,e345

{
      "gw_id": "eui-000080029c10dc25",
      "payload": "QPEWASaAGwABr+Tq6kFhYoSqcv2Kz3Lfa3MdhJbUfF7EGZJ/u6QfstVJfMOw",
      "f_cnt": 27,
      "lora": {
        "spreading_factor": 7,
        "bandwidth": 125,
        "air_time": 92416000
      },
      "coding_rate": "4/5",
      "timestamp": "2019-07-27T20:26:21.268Z",
      "rssi": -106,
      "snr": 8.5,
      "dev_addr": "260116F1",
      "frequency": 867100000
    }


But it’s interesting and lucky to get that. Of course is the payload is wrong, corrupt and not in the good format, the Payloads format will not transcribe it (I pasted my payload above)

May I ask you how to make it

“payload”: “QLISASaACgABFYglOTN96p4goMGznZac5KGdt8FFntaXuAi3keHI6ruJqbMlE9opoQ==”,

Human readable to check if it’s coherent :smile:

But now it look clear

  • the nodes transmitt
  • The gateway receive
  • the payload look like corrupt (I do not know how to say that in english)

I am still very confuse with the fact that on the 25th of July, between 11:55 and 12:39 (same Tx schecule), the problem occured with all nodes. And as all nodes are independent of each other, the node 1 can not say to node 2 “hi, my payload is going to be corruct, be corrupt as well”, and node 2 can not say the same to node 3 and 4. (It’s a bit funny to write that).

So I am wondering if the “curruption” of the payload cna happen at TTN level? Does it make sens?

Payloads at gateway level are still encrypted. You first need to decrypt them…

If you have data at the gateway and not the application you probably have issues with the counters. Try resetting the counter for the node in the console.

Payloads are AES-encrypted. You would need your app key to decode it and your network key to validate the crypto checksum.

For example you could use something like https://lorawan-packet-decoder-0ta6puiniaut.runkit.sh/ though that would mean sharing your keys with them. Or there are ways to do it locally.

One thing of note is that the frame count is very low; if this is not a new OTAA session then that indicates your node may have restarted its frame counter which could lead the network to reject packets unless you have disabled rollback protection.

1 Like

Dear Kersing

Try resetting the counter for the node in the console.

I did it this morning.

  • I switch off node 4 (Ileave it off)
  • I switch off/on the gateway
  • I reseted the frame counter (Is what you means?) for all nodes
  • I switch off/on nodes 1,2 and 3

Actually the ‘Frame up’ field are 0

For example, for node 1, I uncheck that


29

Dear cslorabox
I am using ABP, for now

though that would mean sharing your keys with them

What the real risk? I would prefer to do it on local (I am investigating)

Thank for helping!!!

PS: I just observed a second node in the gateway traffic

I would like to add a new comment.
Yesterday, I wrote, I can see traffic on my TTOG gateway, and I oberved two of my node because I the DEV ADDR number.

Then my nodes look like sent message to my gateway and my gateway show it in the traffic tab.

BUT, if I go to my devises, and then to the overbiew tab, the ‘status’ filed ‘3 days ago’ (See pictue in my prebious post)
The status is not updated while the gateway traffic show my nodes!! Funny no?
How can we explain that? The gateway see it, but the devise is not updated and the message is not “transfered” to my server

Either the sequence number is out of range, or the cryptographic checksum of the message indicates it is invalid, or the servers that would check this are not working.

There have been reports of server issues in the past few days.

If you could start up another node with temporary keys, you could share those with online decryption tool since you would delete and replace them anyway. It’s also quite possible that just starting with a fresh node will work, because the sequence really will start at the beginning and you’ll get to make sure the keys really match. That could be a hint as to what is wrong with the existing nodes. Or it could indicate that the system is not currently working.

Hello
Thanks a lot for following me. I have a spare node at home and I will create a new devise and try this.
The small private problem, my daughter is now on holiday with me :slight_smile: and I will not be able to be proactive :slight_smile: I will try to it this week, but for the following weeks she will prefer to go to the beach :smile: :sunny:
But I keep you up to date as soon I have a few moment.
Thank a lot and enjoy the summer!!!

Hello,
I am bit hopless.

If you could start up another node with temporary keys, you could share those with online decryption tool since you would delete and replace them anyway. It’s also quite possible that just starting with a fresh node will work, because the sequence really will start at the beginning and you’ll get to make sure the keys really match

I got a moment and I prepared a 4th node at home. I created a 4th devise from TTN console.
My home gateway could forward and record the message of my node with ABP and OTAA.
Then I went to the field and I first tried with ABP and then OTAA. In both case the message has not been save into my DB.
What was intersting to see: With ABP the devise was not seen (Status field from the 4th devise overview tab. However, with OTTA, it has been seen, but the measure was not record. Sadely, I have not saved the print of my terminal, but The message “EV_JOINING”, “EV_JOINED” and “EV_COMPLETED” was printed.

I also restarted the gateway, and I tried again without success.

Either the sequence number is out of range, or the cryptographic checksum of the message indicates it is invalid, or the servers that would check this are not working

May be I missunderstand the steps to do but I have no idea how to solve that issue, and I do not understand why the intteruption is so long and no idea how to solved that issue.

Should I create a new application with new devise?
Should reset the gateway?

I supposed both idea are not suitable. When a such issue happen, we should not create new application and devise for the same application. And of course I can not buy a new TTGO gateway.

There have been reports of server issues in the past few days.

Which keyword can use to find it?

Many many thank for your help

Restarting the gateway accomplishes absolutely nothing, because gateways have no stateful role, they just transparently proxy traffic between radio and Internet.

Stopping your node and restarting it could however be a problem, as you may now be re-using a previously used frame count value in the ABP case or join nonce in the OTAA case.

Lots of Join Requests going on there. Are any of those your nodes? That two second transmission on SF12 is an air hog! haha.

I am not convianced it the cause of the problem. I beleive a node could be stopped for maintenance or code update. In my today case, the frame is 0

Frames up 0 (reset frame counter)

Not unless you have persistent storage of its state, otherwise you will run into issues, which get worse the more a node has been previously used.

In my today case, the frame is 0

Rolling back to 0 will cause a spec-compliant LoRaWAN network to silently drop traffic, because it looks like a “replay attack”. There are ways to disable that check, but it is part of the specification of how LoRaWAN works.

Using OTAA does solve the frame count problem, because each new join sessions starts that from 0. But actually it only moves the problem, as you aren’t allowed to re-use join nonce numbers.

LoRaWAN fundamentally requires preservation of persistent state in the node.

Dear cslorabox
Thank for all of your replies (and sorry if I missunderstand you),
but what should I do now.
I am planning to use OTAA but I have to fix some developpment first and I will have no time before leaving for holiday. I already lost a lot of measure and it would be great if I can have measure from asap until I am back from holiday (2-3 weeks of measure).

How can I reset then the counter? Should I reset my TTOG?
Should I create a new gateway in TTN console and change the gateway key to my TTOG?
Should I create a new Application (in TTN console) with the 4 devises and modifying the keys to my nodes?
Should I power my TTOG with 220V? I actually power it with a 12V/90Ah battery through a PoE injector/adaptator 12V->48V.

Note, I have got the same problem with. a iC880A-SPI gateway. With that gateway, the problem desappear when I placed it at home, but the problem occured when I placed it on field.

Again, gateways do not have state.

State is only held on the nodes and servers

Figure out if packets are being sent and received

Figure out if those packets validly decrypt

Figure out if the frame count or join nonce are fresh and not re-used

Hello

Figure out if packets are being sent and received

Yes they are. I just see one of my node in my traffic tab.

Figure out if those packets validly decrypt

Yes, I juts decript it and the message is valid

Hex: 613136623935396336366431653835663130346731333568306932306B3431346C33353331
=>
String: a16b959c66d1e85f104g135h0i20k414l3531

The string is correct (the letter is a type a of mesure, the numbers are the value. With that paylod format, I store the value and save it into a DB (but it does not do it)

function Decoder(bytes, port) {
  var str=String.fromCharCode.apply(null,bytes);
  var astr = str.split(",");
  
  var regex = /([a-z]+)(\d+)/g;
  
  //var resultats = [];
	var paire;
 
  var decoded = {}
  var te,pr,hu,lu,w1,w2,w3,da,ts,ga,ba,ar,an,it,wr;
  while (null !== (paire = regex.exec(astr[0]))) {
		//console.log(paire[1]);
		switch(paire[1]){
		  case 'a':
		    //console.log("te",paire[2]);
		    te=paire[2];
		    break;
		  case 'b':
		    //console.log("pr",paire[2]);
		    pr=paire[2];
		    break;
		  case 'c':
		    //console.log("hu",paire[2]);
		    hu=paire[2];
		    break;
		  case 'd':
		    //console.log("lu",paire[2]);
		    lu=paire[2];
		    break;
		  case 'e':
		    //console.log("w1",paire[2]);
		    w1=paire[2];
		    break;
		  case 'f':
		    //console.log("w2",paire[2]);
		    w2=paire[2];
		    break;
		  case 'g':
		    //console.log("w3",paire[2]);
		    w3=paire[2];
		    break;
		  case 'h':
		    //console.log("da",paire[2]);
		    da=paire[2];
		    break;
		  case 'i':
		    //console.log("ts",paire[2]);
		    ts=paire[2];
		    break;
		  case 'j':
		    //console.log("ga",paire[2]);
		    ga=paire[2];
		    break;
		  case 'k':
		    //console.log("ba",paire[2]);
		    ba=paire[2];
		    break;
		  case 'l':
		   // console.log("ar",paire[2]);
		    ar=paire[2];
		    break;
		  case 'm':
		   // console.log("an",paire[2]);
		    an=paire[2];
		    break;
		  case 'n':
		    //console.log("it",paire[2]);
		    it=paire[2];
		    break;
		  case 'o':
		    //console.log("wr",paire[2]);
		    wr=paire[2];
		    break;
		  
		}
		//resultats.push(paire);
	}
	
  return {
    te:te,
    pr:pr,
    hu:hu,
    lu:lu,
    w1:w1,
    w2:w2,
    w3:w3,
    da:da,
    ts:ts,
    ga:ga,
    ba:ba,
    ar:ar,
    an:an,
    it:it,
    wr:wr,
  }
  
}

Figure out if the frame count or join nonce are fresh and not re-used

This I do not understand how to do. How can I check if it’s re-used?

Thank for your patience :smile: