This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

CoAP and CoAPs

Hi,

I use example projects from Nordic Thread: CoAP Client and  Thread: CoAP Server  with Segger Studio Nordic Edition (projects use Zephry which is generated by NRFConnect) I can send and receive data over CoAP. 

My purpose is to add DTLS. I want to send both CoAP and CoAPs(DTLS) messages. How can I do that? Can you give some detail since I am noob

  • Hello, 

    The thread expert on my team is currently away, and will need to look into this. I hope to have an answer within tomorrow.

    Kind regards,
    Øyvind

  • Hello again, 

    I've finally got some answer for you. The samples themselves do not use DTLS for CoAP communication, nor do they support it in the current state. To add DTLS support you will need to do this by yourself. Unfortunately we do not have a guide on how to implement this at the moment.

    That said, the CoAP Client would need a DTLS socket to send data over, instead of a regular socket. And the CoAP server would need to use the CoAP Secure API instead. Note that the CoAP server sample is provided as a reference on how to access the Thread API directly and should not be used for new products. The best solution is to rewrite the CoAP server in a similar way that the CoAP client is implemented i.e. using sockets API, and then use the Thread API for features that are not supported in the sockets API e.g. changing power, channel, etc.

    More information can be found in the NCS Thread documentation, and the Zephyr Thread protocol API.


    Kind regards,
    Øyvind

Related