This is the multi-page printable view of this section. Click here to print.

Return to the regular view of this page.

Software Updatable

Customize the deployment and management of software artifacts.

1 - Software update configuration

Customize the deployment and management of software artifacts.

Properties

To control all aspects of the software update behavior.

PropertyTypeDefaultDescription
featureIdstringSoftwareUpdatableFeature unique identifier in the scope of the edge digital twin
moduleTypestringsoftwareType of the software that is managed by this feature
artifactTypestringarchiveType of the artifact that is to be processed: archive or plain
installstring[]Absolute path to the install script/command and an optional sequence of additional flags/parameters
storageLocationstring./Path to the storage directory where the working files are stored
installDirsstring[]File system directories where the local artifacts are stored
modestringstrictRestriction where the local artifacts can be stored on the file system, the supported modes are: strict, lax and scope
Download
downloadRetryCountint0Number of retries, in case of a failed download
downloadRetryIntervalstring5sInterval between retries, in case of a failed download as a sequence of decimal numbers, each with optional fraction and a unit suffix, such as: 300ms, 1.5h, 10m30s, etc., time units are: ns, us (or µs), ms, s, m, h
Download - TLS
serverCertstringPEM encoded certificate file for secure downloads
Local connectivity
brokerstringtcp://localhost:1883Address of the MQTT server/broker that the software update will connect for the local communication, the format is: scheme://host:port
usernamestringUsername that is a part of the credentials
passwordstringPassword that is a part of the credentials
Local connectivity - TLS
caCertstringPEM encoded CA certificates file
certstringPEM encoded certificate file to authenticate to the MQTT server/broker
keystringPEM encoded unencrypted private key file to authenticate to the MQTT server/broker
Logging
logFilestringlog/software-update.logPath to the file where log messages are written
logLevelstringINFOAll log messages at this or higher level will be logged, the log levels in descending order are: ERROR, WARN, INFO, DEBUG and TRACE
logFileCountint5Log file maximum rotations count
logFileMaxAgeint28Log file rotations maximum age in days, use 0 to not remove old log files
logFileSizeint2Log file size in MB before it gets rotated

Example

The minimal required configuration that sets the software type to firmware.

{
    "moduleType": "firmware",
    "storageLocation": "/var/lib/software-update",
    "logFile": "/var/log/software-update/software-update.log"
}

Template

The configuration can be further adjusted according to the use case. The following template illustrates all possible properties with their default values.

{
    "featureId": "SoftwareUpdatable",
    "moduleType": "software",
    "artifactType": "archive",
    "install": [],
    "storageLocation": "./",
    "installDirs": [],
    "mode": "strict",
    "downloadRetryCount": 0,
    "downloadRetryInterval": "5s",
    "serverCert": "",
    "broker": "tcp://localhost:1883",
    "username": "",
    "password": "",
    "caCert": "",
    "cert": "",
    "key": "",
    "logFile": "log/software-update.log",
    "logLevel": "INFO",
    "logFileCount": 5,
    "logFileMaxAge": 28,
    "logFileSize": 2
}

2 - Software Updatable API

The software updatable service provides the ability to install given list of software modules and to download modules.

Install

Install given list of software modules.

Request

Hono Command: command//<name>:<namespace>/req//install

Ditto Message:

NameValueDescription
topic<name>/<namespace>/things/live/messages/installInformation about the affected Thing and the type of operation
path/features/SoftwareUpdatable/inbox/messages/installA path to the SoftwareUpdatable Feature, it’s message channel, and install command
HeadersAdditional headers
response-requiredtrue/falseIf response is required
content-typeapplication/jsonThe content type
correlation-idUUIDUsed for correlating protocol messages, the same correlation-id as the response message
ValueJSON presentation of software module that will be installed
correlationIdUnique identifier that is used to associate and track the series of messages
weightThe weight is the priority in case of multiple, parallel instructions
metadataThe metadata is any other information which should be passed to the device
forcedtrue/falseForced to remove the software modules
softwareModulesAn array of software modules to be installed
metadataThe metadata is any other information which should be passed to the device
softwareModuleAn unique identifier for the software module
nameThe name of the software module
versionThe version of the software module
artifactsAn array of artifacts contained in the software module
filenameThe file name of the artifact
sizeArtifact file size in bytes
downloadA map with protocols and links for downloading the artifacts
keyHTTP/HTTPS/FTP/SFTPAvailable transport protocols
urlURL to download the artifact
md5urlMD5URL to download the MD5SUM file
checksumsA map with checksums to verify the proper download
MD5MD5 checksum
SHA1MD5 checksum
SHA256MD5 checksum

Example : Install a hello-world software module.

Topic: command//edge:device/req//install

{
	"topic":"edge/device/things/live/messages/install",
	"headers":{
		"response-required":true,
		"content-type":"application/json",
		"correlation-id":"<UUID>"
	},
	"path":"/features/SoftwareUpdatable/inbox/messages/install",
	"value":{
		"correlationId":"other_correlation_id",
		"softwareModules":[
			{
				"softwareModule":{
					"name":"install-hello",
					"version":"1.0.0"
				},
				"artifacts":[
					{
						"checksums":{
							"SHA256":"db954c633393c1402f145a60fd58d312f5af96ce49422fcfd6ce42a3c4cceeca",
							"MD5":"8c5a0fa2c01e218262d672bf643652fd",
							"SHA1":"7539b451d818d94bcd97d401a5467b3e1c0b8981"
						},
						"download":{
							"HTTPS":{
								"url":"https://github.com/eclipse-kanto/kanto/raw/main/quickstart/install_hello.sh"
							}
						},
						"filename":"install.sh",
						"size":544
					}
				]
			}
		]
	}
}
Response

Hono Command : command//<name>:<namespace>/res//install

Ditto Message:

NameValueDescription
topic<name>/<namespace>/things/live/messages/installInformation about the affected Thing and the type of operation
path/features/SoftwareUpdatable/outbox/messages/installA path to the SoftwareUpdatable Feature, it’s message channel, and install command
HeadersAdditional headers
content-typeapplication/jsonThe content type
correlation-id<UUID>The same correlation id as the sent request message
StatusStatus of the operation install software modules

Example : The response of the install software modules operation.

Topic: `command//edge:device/res//install``

{
	"topic":"edge/device/things/live/messages/install",
	"headers":{
		"content-type":"application/json",
		"correlation-id":"<UUID>"
	},
	"path":"/features/SoftwareUpdatable/outbox/messages/install",
	"status": 204
}

Download

Download software modules.

Request

Hono Command: command//<name>:<namespace>/req//download

Ditto Message:

NameValueDescription
topic<name>/<namespace>/things/live/messages/downloadInformation about the affected Thing and the type of operation
path/features/SoftwareUpdatable/inbox/messages/downloadA path to the SoftwareUpdatable Feature, it’s message channel, and download command
HeadersAdditional headers
response-requiredtrue/falseIf response is required
content-typeapplication/jsonThe content type
correlation-idUUIDUsed for correlating protocol messages, the same correlation-id as the sent back response message
ValueJSON representation of the software modules that will be downloaded
correlationIdUnique identifier that is used to associate and track the series of messages
weightThe weight is the priority in case of multiple, parallel instructions
metadataThe metadata is any other information which should be passed to the device
forcedtrue/falseRemove the software modules forcefully
softwareModulesAn array of software modules that will be downloaded
metadataThe metadata is any other information which should be passed to the device
softwareModuleA unique identifier for the software module
nameThe name of the software module
versionThe version of the software module
artifactsAn array of artifacts contained in the software module
filenameThe file name of the artifact
sizeArtifact file size in bytes
downloadA map with protocols and links for downloading the artifacts
keyHTTP/HTTPS/FTP/SFTPAvailable transport protocols
urlURL to download the artifact
md5urlMD5URL to download the MD5SUM file
checksumsA map with checksums to verify the proper download
MD5MD5 checksum
SHA1MD5 checksum
SHA256MD5 checksum

Example : Download a hello-world software module.

Topic: command//edge:device/req//download

{
	"topic":"edge/device/things/live/messages/download",
	"headers":{
		"response-required":true,
		"content-type":"application/json",
		"correlation-id":"<UUID>"
	},
	"path":"/features/SoftwareUpdatable/inbox/messages/download",
	"value": {
		"correlationId":"other_correlation_id",
        "softwareModules":[
			{
				"softwareModule":{
					"name":"install-hello",
					"version":"1.0.0"
				},
				"artifacts":[
					{
						"checksums":{
							"SHA256":"db954c633393c1402f145a60fd58d312f5af96ce49422fcfd6ce42a3c4cceeca",
							"MD5":"8c5a0fa2c01e218262d672bf643652fd",
							"SHA1":"7539b451d818d94bcd97d401a5467b3e1c0b8981"
						},
						"download":{
							"HTTPS":{
								"url":"https://github.com/eclipse-kanto/kanto/raw/main/quickstart/install_hello.sh"
							}
						},
						"filename":"install.sh",
						"size":544
					}
				]
			}
		],
	}
}
Response

Hono Command : command//<name>:<namespace>/res//download

Ditto Message:

NameValueDescription
topic<name>/<namespace>/things/live/messages/downloadInformation about the affected Thing and the type of operation
path/features/SoftwareUpdatable/outbox/messages/downloadA path to the SoftwareUpdatable Feature, it’s message channel, and download command
HeadersAdditional headers
correlation-idcontainer UUIDThe same correlation id as the request message
StatusStatus of the download operation

Example : Successful download response.

Topic: `command//edge:device/res//download``

{
	"topic":"edge/device/things/live/messages/download",
	"headers":{
		"correlation-id":"<UUID>"
	},
	"path":"/features/SoftwareUpdatable/outbox/messages/download",
	"status":204
}