Upload Files to Cloud
DyoCense cloud has the capability to receive any files as byte stream. The device may send the file as byte array, in a chunked manner to avoid performance issues.
(Optional)-If the devices need to get an acknowledgement of the file sent to the cloud, it may subscribe to the topic, {clientId}/files/res/#. This will be needed in scenarios where devices will retry of the file sending in case acknowledgement is not received.
Devices shall push the files to DyoCense cloud by publishing the byte arrays as chunks to the topic-
{clientId}/files/{directory}/POST/?name={file name}&handle={handle id} handle id – optional property. Required when any acknowledgement is required for the file sent to the cloud or if any telemetry is sent which is associated to the uploaded file. The telemetry message identifier should match with handle id, if they are related. The acknowledgement will be coming with handle id in the payload. file name – mandatory property Required when the device can re-send the events those are generated when it’s disconnected from cloud. If the value is not sent, the current time will be considered as the origintime by cloud.
The suggested chunk size is 2048 bytes per message. Based on the directory and filename, the cloud will append the bytes received to the already received data.
DyoCense cloud will publish an empty message as the acknowledgement for file upload on topic {clientId}/files/res/{status}/?handle={handle id} Where, handle id is the same identifier value sent by device in step 2. status will denote the status of telemetry message. The possible values of {status} are as in below table
201 Successfully saved 400 Bad request It’s expected that, the device will implement necessary retry logic, in case the success acknowledge message is not received within 300 seconds after sending the file to cloud.
Please give us feedback on this integration guide, so we can provide information that’s truly useful and helpful. Thanks!