Press CTRL + Z to send data, CoAP

Hello,

I send 35 bytes of binary data every 30 seconds using CoAP. (BG95-M3)

With “AT+QCOAPSEND” it sometimes sends data successfully and fast with return code: “2.04”, but sometimes it takes a long time, about 10s-30s and sometimes it gets stuck and no result code appears at all.
Signal strength (CSQ): 20 - 31
LTE
How can I fix it? I tested my CoAP server using other clients, it takes 20-60 ms to send data without any problem.

AT+CEREG?
+CEREG: 0,5
AT+QGPSCFG="priority",1
OK
// delay 500 ms here to wait for priority change
AT+QCOAPCFG="pdpcid",0,1
OK
AT+QCOAPCFG="trans",0,2,4
OK
AT+QCOAPOPEN=0,"11.11.11.11",5683
OK
+QCOAPOPEN: 0,0
AT+QCOAPHEADER=0,0,1
OK
AT+QCOAPOPTION=0,0,0,11,"/ps/mytopic"
OK
AT+QCOAPOPTION=0,0,1,12,42 // Content format: application/octet-stream
OK

AT+QCOAPSEND=0,1,2,1,35
> �e�-�i�gm�X3�@�A���`N �� �Blil1)1l <--binary data (length: 35)
OK

// The following QCOAPRECV sometimes appears very fast, sometimes very slow (30s)
// and sometimes not at all, even if I wait so long (75s)
+QCOAPACK: 0,1,0,0
+QCOAPRECV: 0,0,2.04,0,,0,0

AT+QCOAPCLOSE=0
OK

UPDATE: It only happens when I switch priorities between GPS and Network.

AT+QGPSCFG="priority",0
AT+QGPSCFG="priority"
+QGPSCFG: "priority",0,4

// Get location here

AT+QGPSCFG="priority",1
AT+QGPSCFG="priority"
+QGPSCFG: "priority",1,3 // 3 Means WWAN is in loaded state. Should I check anything else too?

// Send data here

When I don’t switch between priorities, it is all good. Sends the data successfully everytime. Other than AT+QGPSCFG=“priority”, what else should I check to see if it is ready to send data?

If you choose network first, the test is normal, so this event may be related to your configured priority, BG95M3 GPS and network share RF