Enqueue downlink after join, before any data has been send

Hi.

I’m still trying downlinks and I came to a strange behaviour.

EDIT: Forgot to add loraserver version:
Loraserver 2.8.1
Lora-app-server 2.6.1

Downlink does not work:
Device Joins
Send mqtt enqueue msg
Server shows error:

time="2019-06-13T10:45:21+02:00" level=info msg="finished client unary call" error="rpc error: code = InvalidArgument desc = device security-context out of sync" grpc.code=InvalidArgument grpc.method=CreateDeviceQueueItem grpc.service=ns.NetworkServerService grpc.time_ms=0.802 span.kind=client system=grpc
time="2019-06-13T10:45:21+02:00" level=error msg="handle data-down payload error: enqueue downlink device-queue item error: create device-queue item error: rpc error: code = InvalidArgument desc = device security-context out of sync" application_id=3 dev_eui=0004a30b0043d112

Msg is not received by device.

Downlink works:
Device joins
Device sends data
Server enqueues downlink
Server does not show error
Device receives data

Is this intentional? Just to adapt our code and be aware of this

I was trying to reproduce this error to check if this is an error we did or a config error or something like that:

Regards

This is intentional. LoRa Server will signal the AppSKey to LoRa App Server on the first uplink message. Until then LoRa App Server is unable to encrypt the message properly (or it might use an AppSKey from a previous activation, which will result in garbage data being received at the device side).

2 Likes

Okay.
Thanks for the answer