Hi @Linkin-Q,
Thank you very much for the previous response. As can be seen in the attached log file, the system is functioning correctly!
[2024-09-26 15:09:40:277_S:] AT+QCOAPCFG="pdpcid",1,1
[2024-09-26 15:09:40:339_R:] AT+QCOAPCFG="pdpcid",1,1
[2024-09-26 15:09:40:339_R:] OK
[2024-09-26 15:09:41:357_S:] AT+QCOAPCFG="dtls",1,0
[2024-09-26 15:09:41:419_R:] AT+QCOAPCFG="dtls",1,0
[2024-09-26 15:09:41:419_R:] OK
[2024-09-26 15:09:42:861_S:] AT+QCOAPOPEN=1,"coap.thingsboard.cloud",5683
[2024-09-26 15:09:42:921_R:] AT+QCOAPOPEN=1,"coap.thingsboard.cloud",5683
[2024-09-26 15:09:42:921_R:] OK
[2024-09-26 15:09:42:921_R:] +QCOAPOPEN: 1,0
[2024-09-26 15:09:44:589_S:] AT+QCOAPHEADER=1,0,1
[2024-09-26 15:09:44:658_R:] AT+QCOAPHEADER=1,0,1
[2024-09-26 15:09:44:658_R:] OK
[2024-09-26 15:09:46:421_S:] AT+QCOAPOPTION=1,0,0,3,"coap.thingsboard.cloud"
[2024-09-26 15:09:46:478_R:] AT+QCOAPOPTION=1,0,0,3,"coap.thingsboard.cloud"
[2024-09-26 15:09:46:478_R:] OK
[2024-09-26 15:09:48:006_S:] AT+QCOAPOPTION=1,0,1,7,5683
[2024-09-26 15:09:48:063_R:] AT+QCOAPOPTION=1,0,1,7,5683
[2024-09-26 15:09:48:063_R:] OK
[2024-09-26 15:09:49:461_S:] AT+QCOAPOPTION=1,0,2,11,"api/v1/<token>/attributes"
[2024-09-26 15:09:49:523_R:] AT+QCOAPOPTION=1,0,2,11,"api/v1/<token>/attributes"
[2024-09-26 15:09:49:523_R:] OK
[2024-09-26 15:09:50:845_S:] AT+QCOAPOPTION=1,0,3,6,0
[2024-09-26 15:09:50:911_R:] AT+QCOAPOPTION=1,0,3,6,0
[2024-09-26 15:09:50:911_R:] OK
[2024-09-26 15:09:53:593_S:] AT+QCOAPSEND=1,0,1,15
[2024-09-26 15:09:53:654_R:] AT+QCOAPSEND=1,0,1,15
[2024-09-26 15:09:53:654_R:] > What do I need to send here?
[2024-09-26 15:09:55:405_R:] What do I need to send here?
[2024-09-26 15:09:57:193_R:] OK
[2024-09-26 15:09:57:695_R:] +QCOAPACK: 1,2,0,0
[2024-09-26 15:09:57:695_R:] +QCOAPRECV: 1,0,2.05,0,,2,6,0,12,50,29
[2024-09-26 15:09:57:695_R:] {"sensor1":12,"sensor2":true}
[2024-09-26 15:10:42:942_R:] +QCOAPRECV: 1,5279,2.05,0,,2,6,1,12,50,18
[2024-09-26 15:10:42:942_R:] {"sensor3":"data"}
[2024-09-26 15:10:50:604_R:] +QCOAPRECV: 1,5346,2.05,0,,2,6,2,12,50,26
[2024-09-26 15:10:50:604_R:] {"sensor3":"current_data"}
[2024-09-26 15:11:37:984_S:] AT+QCOAPSEND=1,0,1,15
[2024-09-26 15:11:38:049_R:] AT+QCOAPSEND=1,0,1,15
[2024-09-26 15:11:38:049_R:] >
[2024-09-26 15:11:40:379_R:] OK
[2024-09-26 15:11:40:822_R:] DSR:0 CTS:0 (RI:1) DCD:0
[2024-09-26 15:11:40:878_R:] +QCOAPACK: 1,2,1,0
[2024-09-26 15:11:40:878_R:] +QCOAPRECV: 1,1,2.05,0,,2,6,0,12,50,29
[2024-09-26 15:11:40:878_R:] {"sensor1":12,"sensor2":true}
[2024-09-26 15:11:40:943_R:] DSR:0 CTS:0 (RI:0) DCD:0
[2024-09-26 15:12:22:782_R:] +QCOAPRECV: 1,8196,2.05,0,,2,6,1,12,50,23
[2024-09-26 15:12:22:782_R:] {"deleted":["sensor1"]}
[2024-09-26 15:12:33:043_R:] +QCOAPRECV: 1,8196,2.05,0,,2,6,1,12,50,23
[2024-09-26 15:12:33:043_R:] {"deleted":["sensor1"]}
However, I have some specific questions that I would like to clarify:
- Firstly, I would like to understand the handshake process with the server in observer mode. The “CoAP Data Interaction Diagram” figure shows the complete process, but it does not detail how it is performed in observer mode.
- Secondly, I would like to know the details of the observer mode as described in the “Option Definitions” table. I have noticed that option 6 is not mentioned.
-
Additionally, it is unclear to me whether the message sent with the observe action needs to include a payload. I have tried sending it with a phrase and also just with the Ctrl+Z command, obtaining the same result in both cases. It works, but I would like to know exactly why.
-
Lastly, it seems that the connection is lost shortly after being established with the server. For now, I have resolved this by repeatedly sending the message to “force” the reconnection. I would like to know if it is possible to control this disconnection time or if I am missing a preliminary step.
As context, I am basing my work on the CoAP Application Note V1.0
which came out in 2021-03-04
Thank you in advance for your assistance, and I look forward to your comments.