-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Devdutt Shenoi
authored
May 8, 2024
1 parent
513f4c2
commit e62f398
Showing
1 changed file
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# File Downloader | ||
Uplink consists of a file downloader, a built-in application that can perform the initial stage of any OTA, downloading the update onto the device. | ||
|
||
## Configuring the Downloader | ||
As described in the [example `config.toml`](https://github.com/bytebeamio/uplink/blob/513f4c2def843f3c27bf0a7dc993667010944535/configs/config.toml#L135C1-L145C27), uplink will handle a special class of actions as [Download Actions](#download-actions) and download the associated files into the mentioned `path` within a directory with the same name as the download action(i.e. `/var/tmp/ota-file/update_firmware`). | ||
Here is one more example config to illustrate how uplink can be configured: | ||
``` | ||
[downloader] | ||
actions = [{ name = "update_firmware", timeout = 3600 }] // sets the timeout to 1hr, allowing for uplink to wait for a whole hour before timing out the download, useful for large downloads over slower networks | ||
path = "/data/local/downloads" // downloads the file into a location commonly seen in Android systems, i.e. /data/local/downloads/update_firmware | ||
``` | ||
|
||
## Download Actions | ||
Download actions contain a payload in JSON text format: | ||
``` | ||
{ | ||
"url": "https://firmware...", // URL to download file from | ||
"content-length": 123456, // Size of file in bytes | ||
"file-name": "example.txt", // Name of the file post download | ||
"checksum": "abc123...", // Checksum that can be used to verify the download was successful | ||
... | ||
} | ||
``` | ||
|
||
P.S. [Bytebeam OTA updates](https://bytebeam.io/docs/triggering-ota-update) are an example of Download Action |