As the latest RIOT update doesn’t include pkg/libcoap I wonder which is the necessary setup in order to flash the libCoAP server illustrated in the blog. In this link I’ve found a version from 3 years ago (RIOT/pkg at f5b2c80bd68b6f3ddb9090405f589798975ab0e1 - RIOT - RIOT-OS git forge) with that package, but after making some proofs I don’t get to make the example work on a nRF52840DK board.
Note: That PR is doing the work of porting a recent version of libcoap to RIOT. It is not a revert of the drop, but actually addressing the issue why libcoap was removed.
If you do not want to specifically libcoap but rather are interested in CoAP in general: There are three competing implementations already upstream:
Note that 1. and 2. are developed within the RIOT repo, so you need to use them using USEMODULE += nanocoap and USEMODULE += gcoap, while 3 is developed externally and only integrated into RIOT as package, so you need to use USEPKG += microcoap for that.
If you have interest in libcoap, maybe drop a friendly note in the PR. Knowing that a PR has users waiting for them can motivate both reviewers and contributors to prioritize a given PR
@Iotvan11
I have been developing a new unified and modular CoAP suite for RIOT: #20792 – Overhauled CoAP Stack and API. unicoap aims to solve many issues with nanoCoAP and GCoAP: a modular transport abstraction, more versatile functions for CoAP options, easier packet APIs, integrated block-wise transfer support, convenience functions, better documentation.
But to be fair: That package is < 500 lines of codes. Software projects with a clearly defined and narrow scope as well as a low complexity just tend to be “finished” at some point. And the package did not cause any maintenance pain yet.
Hi Maribu, thanks for your answer! I’ll definitely look at that PR.
I have worked with GCoAP in recent tasks, so I was interested in taking a step further using libCoAP. I’ll check if I find microcoap to be useful, or else I’ll try to add libcoap manually as in the PR.
Hi. I just wanted to check CoAP connectivity between my PC and nrf52840DK board, that I have already done with gCoAP (and I assume nanoCoAP would work as well), but using libCoAP since it has built-in Oscore.
However, I haven’t found yet an older version of RIOT repository that haves the package libcoap and supports a libCoAP example nrf52840dk. For instance, I have had trouble in order to do makeusing 2018.01 or 2020.01 versions.
I was able to flash the examples for RIOT in obgm/libcoap successfully, but I have encountered an issue I didn’t face when using gcoap. Basically I have the libCoAP server starting on a Pyterm console:
coaps start
Jan 01 00:30:31.483 INFO Server IP [fe80::64b3:7881:5633:4d32]
Jan 01 00:30:31.489 INFO libcoap server ready
While the libCoAP client is activated on another console, and there is ping between them. But when I do the following request for resource time (which is defined in server-coap.c):
coapc coap://[fe8064b3:7881:5633:4d32]/time
I get…
WARN Failed to create options
And I don’t know why the URI is not being submitted. I have also proven with this format: coap://[ip]/time?ticks coap://[ip]/.well-known/core that it’s specified in README, same answer.
I would be grateful if anyone has an idea about what it can be happening
Thanks.
Regarding unicoap, at first glance it seems like something very complete and could certainly be up to date. I’ll have to watch how far it goes.