Device session error

By using OTAA method, the device session error still happens. And the node did join the network, because we can obviously see that the state of node had changed. The things I do not understand is if the network sever accept the node, why it shows this kind error, and I also disable the frame counter validation.

And in Web UI, I see that the node was not activated, even the sever send the join accept command

I am also facing this issue.

the device session error still happens

I’m not sure what error we are talking about…

Web UI, I see that the device was not activated, even the server send the join accept command

That is not an error. You’ll see the activation as soon as the device sends the first uplink. The network-server signals the application-session key on the first uplink to the application-server.

This is intended as in LoRaWAN 1.1 there is also a rejoin-request after which the network-server keeps using the old security context until the device sends the first uplink using the new keys.

Loraserver Log

time="2018-10-11T18:38:26+05:30" level=info msg="backend/gateway: uplink frame received"
time="2018-10-11T18:38:26+05:30" level=info msg="packet(s) collected" dev_eui=75ebe275eb1a81aa gw_count=1 gw_ids=70b3d57ed00000dc mtype=JoinRequest
time="2018-10-11T18:38:26+05:30" level=info msg="device-queue flushed" dev_eui=75ebe275eb1a81aa
time="2018-10-11T18:38:26+05:30" level=info msg="device-session saved" dev_addr=015807f7 dev_eui=75ebe275eb1a81aa
time="2018-10-11T18:38:26+05:30" level=info msg="device-activation created" dev_eui=75ebe275eb1a81aa id=24
time="2018-10-11T18:38:26+05:30" level=info msg="backend/gateway: publishing downlink frame" qos=0 topic=gateway/70b3d57ed00000dc/tx

Lora App Server Log

time="2018-10-11T18:38:26+05:30" level=info msg="js: request received" message_type=JoinReq receiver_id=0000000000000000 sender_id=000000 transaction_id=1169938817
time="2018-10-11T18:38:26+05:30" level=info msg="device-keys updated" dev_eui=75ebe275eb1a81aa
time="2018-10-11T18:38:26+05:30" level=info msg="js: sending response" message_type=JoinAns receiver_id=000000 result_code=Success sender_id=0000000000000000 transaction_id=1169938817

That looks all fine. As I said, after the device sends it first uplink (after the OTAA), you’ll see the device activated in LoRa App Server.

Thanks @brocaar

Can you please give me device activation steps using simulation message (with example)?
Because we are testing LoraServer so it’s important to us using simulating message

because i have already set device, application and all that also send join request for device but after join accept i don’t know how to do

LoraServer v1.x successfully activate device using simulation message.

Please help me.

Thanks

Send a (simulated) uplink message :slight_smile:

@brocaar

BAND: EU863-870

gateway/48b4866ad7b06b20/rx

{ "phyPayload":"QMD3NAGAAAAB5+c18FjXcUzb","rxInfo":{"channel":0,"codeRate":"4/5","crcStatus":1,"dataRate":{"bandwidth":500,"modulation":"LORA","spreadFactor":8,"bitrate":0},"frequency":869525000,"loRaSNR":7,"mac":"70b3d57ed00000dc","rfChain":1,"rssi":-57,"size":23,"time":"2018-10-15T10:31:27+01:00","timestamp":1538462077}}

Above is our Simulated Uplink Message

DevEUI: 0debe271efce9de0
NetworkKey: 4b2b2d7a62debde952a25bad8a89ec3e

LoraServer Logs

time="2018-10-15T10:05:33+05:30" level=info msg="gateway/mqtt: uplink frame received"
time="2018-10-15T10:05:34+05:30" level=error msg="processing uplink frame error" data_base64="gPOl0QEgAQBQv81EvByWEs8=" error="get device-session error: device-session does not exist or invalid fcnt or mic"


Thanks

Sorry, but I don’t give support on simulations as the issue might as well be with your simulation e.g. wrong MIC calculation.

Thanks @brocaar

I know the issue with wrong MIC.

but

  1. I send join request to loraserver and it’s give join ans with success but my device not activated on application server (web interface)
  2. So, i send first uplink message to loraserver. AppKey is used for Join Request/Accept, otherwise NwkSkey is used so how can i get NwkSKey?

Thanks

Please refer to the LoRaWAN Backend Interface specification:

As you can see, the AppSKey deliver happens on the first uplink (data) packet. When this frame has the wrong MIC as in your case, it will be rejected by the NS and the key signaling does not take place. The result is that in LoRa App Server the activation is not visible.