9 years, 6 months ago.

server to device query using coap

couple questions for discussion:

1. in the world of COAP, how would a server send a get/query to a wireless device that is in sleep mode? does the server need to know about the wake up frequency of the device?

2. for communication over sockets, a data session need to be activated (over GPRS for example) who would be responsible for establishing such connection in the case of a query from the server?

thank you Jamal

Question relating to:

Simple client to illustrate the functionality of cantcoap library. The client sits in a while loop sending CoAP PUTs to a remote server and prints each acknowledgement.

1 Answer

9 years, 4 months ago.

CoAP itself doesn't speculate on how this behaviour is performed.

There is a related specification that uses CoAP by OMA called LWM2M (lightweight m2m). in LWM2M a device always phones home when it is online and tells the server any change in IP etc.

There is a special entry in the LWM2M standard for cellular devices which permits the CoAP packet to be sent over SMS.

This allows the client to respond with a CoAP packet over the SMS bearer so that no data session is required.

An alternative arrangement is that the SMS causes the client to re-register with the server and the response is made over the data bearer.

There isn't really any way around the problem of ad-hoc access from server-to-device unless the device is connected to some network.

If the IP of the device never changes, there is nothing to stop you communicating the sleep frequency to the server, so that the server only sends packets when the device is awake. But you would have to do all the sync yourself.

I hope this answers your question. If you need any clarification please ask more.

thank you for your feedback,

"An alternative arrangement is that the SMS causes the client to re-register with the server and the response is made over the data bearer."

this is exactly the implementation we have adopted couple month ago, and it seems to hold so far

by the way, among three different COAP implementations we have analyzed, we found yours to be the best, very straightforward and easy to use, and have incorporated it into our solution

no major bug so far, only minor warning issues when we run against the ARM compiler (IAR and GCC)

I would also like to share few lines of code for an encoding facility that is most useful for encoding remote port numbers for connecting to a COAP server... please advise on the appropriate process

with regards to LWM2M, is there any recommendation for a solution that would work on top of the cantcoap library?

best regards,

posted by Jamal Mouline 02 Dec 2014