Error: node-session does not exist or invalid fcnt or mic


#1

Dear LoraServer

I finally connect arduino+lorahat device as end node to loraserver using LMIC Libarary,

now i got the problem, when i try restart/reset the arduino, i cant connect again to loraserver
i got error message like this :
Nov 14 05:28:29 server loraserver[1794]: time=“2017-11-14T05:28:29-05:00” level=error msg=“processing rx packet error: get node-session error: node-session does not exist or invalid fcnt or mic” data_base64=QBER3QCALAAB1OtpIs8eqDXYSh7kiDdp

i read some source, that i have to delete the node from appserver and add it again, after that the device connect again, but when i try to restart the device, the problem came back with the same error,
can anyone help me to solve this?

there is a timestamp when i restart device and add it again later,


Downlink error after publishing with mosquitto
Lora app server experience significant delay in publishing lora node messages
ABP,mote power off,need reconfig
#2

Are you using ABP? Then probably the issue is that by restart/resetting the Arduino, you also reset the frame-counters at the device. Because of this, LoRa Server rejects these frames as it could as well be a replay-attack. To work around this, you could check the Disable frame-counter validation box (on ABP activation).


#3

Thanks @brocaar, I solve this problem… :slight_smile:


Missing downlink message
#4

What need to be step to solve this kind of issue if we are using OTAA node?


#5

Same issue here. Using ABP too. Disabled frame counter, created a new node…

I always get device session error :frowning:


#6

Probably then your keys are setup incorrectly. A common mistake is the byte order of the keys. E.g. in some cases you have to configure them in the reverse order.


#7

Yes I have already tried to reverse the order of my keys, still emits device-session error. Not too sure where else to look at.


#8

Can you help in my case?
I’m using a simulation of a gateway to send packages.
I’m using the VirtualBox Machine which send me to my loraserver(my local machine) with my pc IP address in MQTT, but I also see the same error:

jul 18 10:36:28 diogo loraserver[3971]: time=“2018-07-18T10:36:28+01:00” level=info msg=“backend/gateway: rx packet received”
jul 18 10:36:29 diogo loraserver[3971]: time=“2018-07-18T10:36:29+01:00” level=error msg=“processing rx packet error: get device-session error: device-session does not exist or invalid fcnt or mic” data_base64=“QIMrJgcAAAAByP/0r6/DmDEfUWU=”

IN MY VIRTUAL MACHINE THIS IS THE INFO OF THE PACKAGE:

teste@teste:~/loraserver-device-sim/example$ go run uplink_example.go
Connection established.
Publishing:
{“phyPayload”:“QIMrJgcAAAAByP/0r6/DmDEfUWU=”,“rxInfo”:{“channel”:0,“codeRate”:“4/5”,“crcStatus”:1,“dataRate”:{“bandwidth”:500,“modulation”:“LORA”,“spreadFactor”:8,“bitrate”:0},“frequency”:902300000,“loRaSNR”:7,“mac”:“b827ebfffeb13d1f”,“rfChain”:1,“rssi”:-57,“size”:23,“time”:“2018-07-18T10:36:27+01:00”,“timestamp”:1531906587}}


#9

Hi Brocaar, I have already checked the “Disable frame-counter validation” but still getting this error, I am using the latest test release. I am using LoPy as node. Any other workaround ?

Thank you,

Bnjroos


#10

You can split the error in three parts:

  • device-session does not exist: no such activation exists for the used DevAddr
  • invalid fcnt: the frame-counter did not increment (e.g. replay attack)
  • invalid […] mic: the message integrity code was invalid, meaning that your session-keys are setup incorrect

In the latest case, make sure that some devices use different byte orders when entering the keys. For the LoPy, you can find some examples here: https://github.com/brocaar/pycom-examples.


#12

Hi brocaar, thank you for your answer, I found my issue, it was the selected LoRaWAN version for my device that was incorrect, how dumb of me.


#13

Hello everyone !

Unfortunately, I got the same error: e[31mERROe[0m[3402] processing rx packet error: get device-session error: device-session does not exist or invalid fcnt or mic e[31mdata_base64e[0m=gIMaASaAAQAEbtljyaCtnLD5.

I think it is related to the session keys.

Can you help me to understand if I filled them correctly? Thanks a lot !




#14

Hi ,

Does any one get the same error after leave the node(device) for long time(about two month) without power then restart it ? I meet this situation for many times, every time I need to delete this device(Using ABP. Disabled frame counter) and recreate it again.Does any one know how to fix this issue?Thanks a lot!


#15

If you are in ABP, FCnt are not synchronized between node and server. It is normal (security reason : replay attack). So yeah, you have to delete and recreate the node each time. Or use OTAA.