How to enumerate and Identify options in a CoAP client in BG77 module

Greetings,

I am currently working with a BG77 module and the CoAP protocol alongside a microprocessor.

Is there a way to determine how many and what options are linked to a CoAP client? While it’s straightforward to manually register the options, my question focuses on automating this process using a microcontroller.

My plan is to have the microcontroller maintain an internal register of every client and each option. However, I need to first determine if there’s an easier way to achieve this using the modem. I have already searched the CoAP application note but couldn’t find any relevant information.

Thanks in advance.

So you want an URC report the option state automatically, right?

Hello Mikey

There might have been a misunderstanding. What I need is to query the options added to a specific client, including their type (Uri-port, Uri-Path, etc.), their respective values, and their indices.

For instance, there have been cases where the microcontroller attempts to add a new option (depending on its logic), but it is already added, resulting in an error.

As I mentioned in the last post, I can save all these details in the microcontroller’s logic as classes, but I would like to rule out if there is a simpler method implemented in the modem.

In parallel, according to the CoAP manual, there is a command that allows us to preset options, which is AT+QCOAPOPTIOIN, but it does not work on my BG77 where the FW version is BG77LAR02A04_01.204.01.204


Here is an example log:

[2025-02-24 10:28:42:175_S:] // ########## Configure Sesion ##########
[2025-02-24 10:28:44:791_S:] AT+QCOAPCFG="pdpcid",1,1
[2025-02-24 10:28:44:857_R:] AT+QCOAPCFG="pdpcid",1,1
[2025-02-24 10:28:44:857_R:] OK
[2025-02-24 10:28:45:374_S:] AT+QCOAPCFG="dtls",1,0
[2025-02-24 10:28:45:440_R:] AT+QCOAPCFG="dtls",1,0
[2025-02-24 10:28:45:440_R:] OK
[2025-02-24 10:28:45:998_S:] AT+QCOAPCFG="trans",1,60,5
[2025-02-24 10:28:46:058_R:] AT+QCOAPCFG="trans",1,60,5
[2025-02-24 10:28:46:058_R:] OK
[2025-02-24 10:29:05:088_S:] // ########## Open Connection ##########
[2025-02-24 10:29:07:454_S:] AT+QCOAPOPEN=0,"coap.thingsboard.cloud",5683
[2025-02-24 10:29:07:520_R:] AT+QCOAPOPEN=0,"coap.thingsboard.cloud",5683
[2025-02-24 10:29:07:520_R:] OK

[2025-02-24 10:29:09:053_R:] +QCOAPOPEN: 0,0
[2025-02-24 10:29:10:004_S:] AT+QCOAPHEADER=0,0,1
[2025-02-24 10:29:10:087_R:] AT+QCOAPHEADER=0,0,1
[2025-02-24 10:29:10:087_R:] OK
[2025-02-24 10:29:25:401_S:] // ########## Add options ##########
[2025-02-24 10:29:28:084_S:] AT+QCOAPOPTION=0,0,0,3,"coap.thingsboard.cloud"
[2025-02-24 10:29:28:151_R:] AT+QCOAPOPTION=0,0,0,3,"coap.thingsboard.cloud"
[2025-02-24 10:29:28:151_R:] OK
[2025-02-24 10:29:29:117_S:] AT+QCOAPOPTION=0,0,1,7,5683
[2025-02-24 10:29:29:184_R:] AT+QCOAPOPTION=0,0,1,7,5683
[2025-02-24 10:29:29:184_R:] OK
[2025-02-24 10:29:30:001_S:] AT+QCOAPOPTION=0,0,2,11,"api/v1/Lf3GbaryZzlKKQG6id2U/attributes"
[2025-02-24 10:29:30:068_R:] AT+QCOAPOPTION=0,0,2,11,"api/v1/Lf3GbaryZzlKKQG6id2U/attributes"
[2025-02-24 10:29:30:068_R:] OK
[2025-02-24 10:29:31:255_S:] AT+QCOAPOPTION=0,0,3,6,0
[2025-02-24 10:29:31:317_R:] AT+QCOAPOPTION=0,0,3,6,0
[2025-02-24 10:29:31:317_R:] OK
[2025-02-24 10:29:48:298_S:] // ########## Preset client options ##########
[2025-02-24 10:30:03:929_S:] AT+QCOAPOPTIOIN
[2025-02-24 10:30:03:995_R:] AT+QCOAPOPTIOIN
[2025-02-24 10:30:03:995_R:] ERROR
[2025-02-24 10:30:06:245_S:] AT+QCOAPOPTIOIN?
[2025-02-24 10:30:06:311_R:] AT+QCOAPOPTIOIN?
[2025-02-24 10:30:06:311_R:] ERROR
[2025-02-24 10:30:10:544_S:] AT+QCOAPOPTIOIN=?
[2025-02-24 10:30:10:611_R:] AT+QCOAPOPTIOIN=?
[2025-02-24 10:30:10:611_R:] ERROR
[2025-02-24 10:30:13:111_S:] AT+QCOAPOPTIOIN=0
[2025-02-24 10:30:13:177_R:] AT+QCOAPOPTIOIN=0
[2025-02-24 10:30:13:177_R:] ERROR
[2025-02-24 10:30:42:206_S:] AT+QGMR
[2025-02-24 10:30:42:273_R:] AT+QGMR
[2025-02-24 10:30:42:273_R:] BG77LAR02A04_01.204.01.204

[2025-02-24 10:30:42:273_R:] OK