Exchange CoAP messages between 2 boards

Hi all,

I’m trying to build my CoAP environment where i should have 2 CoAP servers and a collector, all 3 these nodes are based on SAMR21-XPRO board and the “microcoap_server” example on the RIOT repo.

I would like that these nodes could talk using CoAP, so, how can i perform a CoAP request from an other microCoAP server or similar?

Thanks a lot!

Hi Alessandro,

Hi all,

I’m trying to build my CoAP environment where i should have 2 CoAP servers and a collector, all 3 these nodes are based on SAMR21-XPRO board and the “microcoap_server” example on the RIOT repo.

I would like that these nodes could talk using CoAP, so, how can i perform a CoAP request from an other microCoAP server or similar?

By default, microcoap does not offer you the ability to build CoAP requests. You can cobble them together manually as a quick fix (as an example on how to you this, you could have a look at https://github.com/watr-li/nodes/blob/master/plant_node/coap_ext.c ), or you could use libcoap, which offers this functionality out of the box (as far as I know).

Cheers, Lotte

Hi ALESSANDRO,

In Berlin we talked about a number of CoAP implementations, including a new one specifically for riot called gcoap. Cant dig out the references right now, but Google for t2trg and riot.

Grüße, Carsten

Thanks for the mention, Carsten. gcoap still is a work in progress. However, source code is source code if that helps. See PR #5598. Also, notice the link in there for Kaspar's small server-only implementation, nanocoap.

Ken