Anedya OTA Overview
This section provides an overview of the OTA Deployment process in Anedya.
Assets
In Anedya, you can deploy anything to your devices. Be it firmware binaries, OS images, or even video files. Each deployable item is called an Asset. The first step of creating deployment in Anedya is to upload an asset.
You can upload an asset through the Anedya Management Dashboard and APIs. You can create an asset with a file size up to 4TB. An asset can hold a single file only if you want to deploy multiple files at once; consider compressing them together in a zip archive. You can upload an asset in a single request or in multiple parts. We recommend uploading assets larger than 100MB through multipart uploads. Once an asset is uploaded, you need to mark it as uploaded. If you are using the Anedya management dashboard, then this step is taken care by the dashboard automatically, but an additional API call is required in API-based uploads.
Please note that assets with deployable
status only will be available to create a deployment.
Anedya charges for asset storage in GB-Month. Please refer to the pricing section for more details.
Deployments
Once the asset is deployable, you can create a deployment by specifying the asset identifier and version.
Device Filters
You can specify the target devices by specifying the filters.
You can specify up to 50 tags in the filters. All of the tags are appended together using the AND
condition. Devices should contain all of the tags specified to be targeted by the deployment. The device can have additional tags.
For example, a device has the following tags:
Device 1:
model=mk1
hwversion=1.0
location=somelocation
Device 2:
model=mk1
hwversion=2.0
For different filters:
model=mk1
# Both Device 1 and Device 2 will be targeted as both devices have tag `model=mk1`
model=mk1
hwversion=2.0
# Only device 2 will be targeted
location=somelocation
# Only device 1 will be targeted
Deployment Stages
You want to start your deployment by targeting a few devices first to check that everything is working perfectly, then gradually target all other devices. You can define stages for any deployment in Anedya. In each stage, you can define:
- Number of devices you want to target in that stage
- An auto-abort criteria that abort deployment if the number of failures exceeds a predefined count
- Delay between two consecutive stages
You can also define the expiry of the deployment. A deployment can have a maximum timespan of 1 year. You can also create multiple deployments over the same set of devices.
In any case, Anedya determines the applicable update for any device using the following logic:
- First, the system checks for any completed or ongoing deployment for a device; if the device has no in-progress or completed deployments, Anedya looks for a deployment targeting that device. If multiple deployments are found, the system selects the oldest deployment. If there are in-progress or completed deployments found for that device, the system will look for all applicable deployments which are created after the last reported deployment
- System returns the same deployment until one of the following happens:
- The device skips the update by sending a
skipped
status - Device starts the update process by sending the
start
status
- The device skips the update by sending a
- If the device skips the update, that deployment is marked as skipped for that device, and the next time the device requests, the oldest applicable deployment is sent.
Deployment also takes care of the stage transition automatically. When a device reports the start
of any deployment, it is considered in progress and counted for the stage target quota. Once the number of devices defined in the target count
reports start
status, deployment transitions to the next stage. Depending on the configuration, the next stage can start immediately or after a delay. During the delay period, the deployment is
not available for any device.
Please note that only devices that start the update process are counted for stage target count. A higher number of devices may fetch deployment details than the target of any stage. Anedya allows any such device to complete the update process in such cases.
Device Status
All devices must provide feedback on the ongoing update process through status updates. Anedya allows you to define your custom status. However, a few statuses are mandatory for the device to report. At a minimum, the device should report the following three statuses:
start -> success/failure
start
marks a device in progress, while success
or failure
marks a device in a conclusion state. The device can report any arbitrary status after start
and before success
or failure
.
It is possible to report status like:
start -> download -> extract -> installing -> success/failure
or
start -> download -> retry1 -> retry2 -> installing -> success/failure
Along with each status update, device can also submit log string of upto 1000 characters for debug purpose.
Asset download on device
Along with deployment information, Anedya provides a URL from which the devices can download the asset. This URL is valid for 1 Hour, after which the device can request another URL for the same deployment. Currently, devices can download all the assets through HTTPS only. MQTT and FTP file delivery is not supported. Anedya endpoints also allow range requests and multi-connection downloads. Using multiple range requests the device can download asset using multiple connections in parallel to improve speed and, in case of download failure, can download only failed parts instead of the whole asset.
Billing
There will be no cost for OTA deployments for Beta period of the service.
Like other services, Anedya provides simple pay-as-you-go billing for OTA deployments. The following are the metrics which will be billed as per usage:
- Asset Storage: Charged on the GB-Month for all assets stored in Anedya
- Deployment Creation/Management: No charge
- Asset Delivery to Devices: Asset delivery is charged on the GBs of data downloaded by devices
Example,
If you are deploying a 10MB firmware binary to 1000 Devices and all 1000 Devices successfully perform OTA updates:
Storage Charge: (10MB/1024MB) = 0.009765625 GB x Months for Asset remains stored GB-Month
Deployment Creation/Management = 0
Asset Delivery: 1000 Devices x 10MB Download = 10000MB Total download = 9.76 GB Billable download
This page is being modified continuously and will be updated frequently. We are continuously adding content to the documentation. Feel free to get in touch with Team Anedya for any assistance.