Downlink Queue strange behaivor

Hi there!
ns v.3.13.0
We noticed some strange behavior during downlink operations with ABP Class-C device. It happens quite rarely. I don’t know how to reproduce it yet. The problem is downlinks the network server keeps sending with keeping the message in a queue.

It sends the first uplink. The platform responds with UnconfirmedDataDown like this:


The device goes offline and doesn’t respond to the downlink.
Then probably the queued message appears (fPending = true, the message stays in the queue for the device with fCnt constantly updated (the payload keeps re-encrypting every iteration))

The reason why the queue msg is not removed from the queue after ask - is the fPort = 0. And there is no any other ack in it for a downlink with a customer’s payload (from an application).

What behavior is expected if there are only mac-commands in frmPayload and there is no space for app’s data from the queue, that triggered transmission? I see that it’s supposed to be corresponding both messages to a gateway in set (ctx.DownlinkFrame.Items). But thereis no ack for app-payload.

logs are like this for every 2 seconds:

Blockquote
Jul 15 17:22:15 network-server[352511]: time=“2021-07-15T17:22:15.721636654+03:00” level=info msg=“finished client unary call” ctx_id=3c60bc3d-2fc7-44a2-9e5e-11c423368e97 grpc.code=OK grpc.ctx_id=16aca79d-f2a5-444e-b2b8-b065ec1174d5 grpc.duration=2.774117ms grpc.method=ReEncryptDeviceQueueItems grpc.service=as.ApplicationServerService span.kind=client system=grpc
Jul 15 17:22:15 network-server[352511]: time=“2021-07-15T17:22:15.722065455+03:00” level=info msg=“device-queue flushed” ctx_id=3c60bc3d-2fc7-44a2-9e5e-11c423368e97 dev_eui=6ee974b87e2bab3c
Jul 15 17:22:15 network-server[352511]: time=“2021-07-15T17:22:15.722987987+03:00” level=info msg=“device-queue item created” ctx_id=3c60bc3d-2fc7-44a2-9e5e-11c423368e97 dev_eui=6ee974b87e2bab3c f_cnt=2425
Jul 15 17:22:15 network-server[352511]: time=“2021-07-15T17:22:15.723754486+03:00” level=info msg=“pending mac-command block set” cid=NewChannelReq commands=3 ctx_id=3c60bc3d-2fc7-44a2-9e5e-11c423368e97 dev_eui=6ee974b87e2bab3c
Jul 15 17:22:15 network-server[352511]: time=“2021-07-15T17:22:15.723912633+03:00” level=info msg=“pending mac-command block set” cid=RXParamSetupReq commands=1 ctx_id=3c60bc3d-2fc7-44a2-9e5e-11c423368e97 dev_eui=6ee974b87e2bab3c
Jul 15 17:22:15 network-server[352511]: time=“2021-07-15T17:22:15.724046221+03:00” level=info msg=“gateway/mqtt: publishing gateway command” command=down downlink_id=3c60bc3d-2fc7-44a2-9e5e-11c423368e97 gateway_id=4658425300003978 qos=0 topic=gateway/4658425300003978/command/down
Jul 15 17:22:15 network-server[352511]: time=“2021-07-15T17:22:15.724436903+03:00” level=info msg=“device-session saved” ctx_id=3c60bc3d-2fc7-44a2-9e5e-11c423368e97 dev_addr=01e22830 dev_eui=6ee974b87e2bab3c
Jul 15 17:22:15 network-server[352511]: time=“2021-07-15T17:22:15.724596899+03:00” level=info msg=“storage: downlink-frame saved” ctx_id=3c60bc3d-2fc7-44a2-9e5e-11c423368e97 token=15456
Jul 15 17:22:15 network-server[352511]: time=“2021-07-15T17:22:15.725142709+03:00” level=info msg=“device-queue item updated” ctx_id=3c60bc3d-2fc7-44a2-9e5e-11c423368e97 dev_eui=6ee974b87e2bab3c emit_at_time_since_gps_epoch=“” f_cnt=2425 is_pending=false timeout_after=“”
Jul 15 17:22:15 network-server[352511]: time=“2021-07-15T17:22:15.819231366+03:00” level=info msg=“backend/gateway: downlink tx acknowledgement received” downlink_id=3c60bc3d-2fc7-44a2-9e5e-11c423368e97 gateway_id=4658425300003978
Jul 15 17:22:15 network-server[352511]: time=“2021-07-15T17:22:15.820334818+03:00” level=info msg=“device-session saved” ctx_id=3c60bc3d-2fc7-44a2-9e5e-11c423368e97 dev_addr=01e22830 dev_eui=6ee974b87e2bab3c
Jul 15 17:22:15 network-server[352511]: time=“2021-07-15T17:22:15.820442482+03:00” level=info msg=“sent downlink meta-data to network-controller” ctx_id=3c60bc3d-2fc7-44a2-9e5e-11c423368e97

These downlink messages keep going infinitely every 2 seconds (device_downlink_lock_duration)

Strangely it marks the device as ClassB somehow, I can’t figure out. It’s a class-c device according to setup: the Mode field for the device in ns database is ‘C’.

Hello @fancar,

Can you also share the picture of the device profile settings??

BR,
Chay