Steps for registration
Device shall connect to the DyoCense cloud by using the username and default password combination.
Device should first subscribe to topic {clientId}/twin/credentials/PATCH/# to receive the registration status and new password which will be generated by DyoCense Cloud after successful registration.
Next, device need to publish the registration payload on the topic, {clientId}/twin/POST/?rid={request id} Here the request id is a random number which can be generated by the device to track the requests and correlate properly with the response messages received. Device may use 0 as default in place of request id. Registration payload shall follow below structure.
The device may decide to send any metadata related to the device on this payload. It can be an empty JSON object also if the device doesn’t want to update any metadata
The registration response will be published by the cloud on the topic mentioned in step 1 as, {clientId}/twin/credentials/PATCH/{status}/?rid={request id} Where, request id is the same request id sent by the device on the registration request. status will denote the status of the registration. The possible values of {status} are as in below table.
201 Successful registration 400 Bad request 404 Device not added in cloud 409 Already registered device. The response payload, which consists of the new password will look like,
Device shall persist this new password in encrypted manner to protect it safely and use for further connection establishments.