Introduction
Coap is a lightweight protocol based on UDP to communicate with IP devices. More information on coap could be find here : http://coap.technology/
Connexion and URL
Once we registered a new device we will give you a pair of sensorId and password to use to connect the device. The connexion is secured using DTLSv1.2.
Coap uses http like methods : POST/PUT to send data, GET to ask for data, DELETE to remove.
Pilot Things implements a set of URLs and query to communicate easily. The table hereunder sum-up the available URLs and usage.
The URL scheme is unique per SensorID.
URL | Query | Payload | Description |
telemetry |
none |
json with measurements |
Set/get multiple measurement using JSON PUT/POST, use the Json to set multiple measurements GET: return a JSON with all measurements values |
telemetry/{measurementName} | none |
PUT/POST : value GET: none |
Set/get one measurement Set or get measurement value. PUT/POST would create a new measurement if not existing |
properties |
Key = PropertyName GET : value not used |
none |
Get thing's custom property value No POST/PUT method supported
|
any other URL | none |
PUT/POST : value GET: none |
Set/get one measurement PUT/POST create a measurement with name = URL, value = payload value Get would get the value using name=URL |
Coap Example
The following command using unix coap client will send latitude and longitude values to the sensor with id after -u option
./coap-client -e "{ \"latitude\": \"35.9078\", \"longitude\": \"127.7669\" }" -m post coaps://coap.eu-west-1.amazonaws.com/telemetry -u <your sensor identity> -k <password>
Comments
0 comments
Please sign in to leave a comment.