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

CoAP Client-server Model

I am using  NRF52840dk boards to make an openThread mesh network with CoAP. There is an example in NRF-SDK for coap client and another example for coap server. I used them and did the example project given Nordic documents. One board is server and others are client. It worked correctly.

My purpose is to adapt this example to my own project. I want reverse of exampel project. There will be one client and others will be server. After I search, I learnt that the sockets must be adjusted to implement my project.

For example; I want one client and four server. How many sockets does my client need? Is it four? And,  How many sockets does my each server need? İs it just one?

Is it enough to adjust sockets? Where can I start?  The example codes (one client and one server) make me confused. NRF is using Zephry RTOS.

Parents
  • Hi orkunsengur,

    I want reverse of exampel project. There will be one client and others will be server.

     I am not sure if I understand you correctly, the original Thread: CoAP Client and  Thread: CoAP Server samples already support this. With unicast, you can control all the CoAP servers inside the Tread network. 

    I want one client and four server. How many sockets does my client need? Is it four? And,  How many sockets does my each server need? İs it just one?

     if you want to use one client to control several servers separately, for example, using four buttons on the client to control one led on each four server boards separately. You do not need to initialize four CoAP sockets on the client, because the CoAP client sends requests(coap_send_request function) with a server address, so you can send to a different server address every time. Our example shows how to paired with one server through the provisioning process, which means how to get the unique IPv6 address from one server. You can modify it to pair with more different servers, then you would be able to control them as you want.

    Best regards,

    Charlie

Reply
  • Hi orkunsengur,

    I want reverse of exampel project. There will be one client and others will be server.

     I am not sure if I understand you correctly, the original Thread: CoAP Client and  Thread: CoAP Server samples already support this. With unicast, you can control all the CoAP servers inside the Tread network. 

    I want one client and four server. How many sockets does my client need? Is it four? And,  How many sockets does my each server need? İs it just one?

     if you want to use one client to control several servers separately, for example, using four buttons on the client to control one led on each four server boards separately. You do not need to initialize four CoAP sockets on the client, because the CoAP client sends requests(coap_send_request function) with a server address, so you can send to a different server address every time. Our example shows how to paired with one server through the provisioning process, which means how to get the unique IPv6 address from one server. You can modify it to pair with more different servers, then you would be able to control them as you want.

    Best regards,

    Charlie

Children
No Data
Related