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

Openthread CoAP - communication initiated by server?

Hi,

I'm developing multiprotocol applications based on examples from Thread SDK: Proximity/CoAP server and BLE UART/CoAP client. All CoAP communication in this examples is initiated from client by sending requests, but I'd like to have a possibility to initiate it also from the server. I tried to make a resource on the client but it didn't really work. What is the best way to accomplish this?

Thanks in advance.

  • You can't really do that, as the server/client architecture of CoAP is based on request/response operations. If you setup CoAP resources on the client, you are basically making it a SoAP server. What is the problem you are facing when trying to do this?

  • With 2 years delay :-)

    CoAP defines the message in a way, that it is very easy to implement a client and a server even on the same socket! If the used library supports that, depend on the libraries developer. Standards as LWM2M from the OMA are using that feature.

    If it works in your network environment is a different question and it's mostly the one, which denies that approach. In many case "some NATs" are on the way, and they usually close the IP-route back after a few seconds without traffic. With that, you can usually reach your client only within a few seconds after the client reached your server.

Related