We are here to help

Protocole Coap

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.

/telemetry

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}

Set/get one measurement

Set or get measurement value.

PUT/POST would create a new measurement if not existing

/properties

Get thing's custom property value (Key = PropertyName)

No POST/PUT method supported

/any other URL

Set/get one measurement

PUT/POST create a measurement with name = URL, value = payload value

Get would get the value using name=URL

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>