Introducing Software Management on thin-edge.io 0.3

Debom Ghosh
thin-edge.io
Published in
5 min readOct 14, 2021

The thin-edge.io project was started to solve the common challenges involved in the IoT enablement of industrial devices, or more precisely, to make the integration of any embedded device with any cloud platform reliably and without any eco-system lock-in.

With millions of IoT devices being connected to the cloud every day, there is one big hurdle for embedded engineers- to handle everything around software management — Installation, Upgrade, Configure and Remove software package for these devices. In many cases, this is done Over-The-Air (OTA), adding additional challenges for reliability and efficiency.

In our latest 0.3 release of thin-edge.io, we are excited to introduce you to the following features:

  • OTA Software Management to install and uninstall software artifacts.
  • Additionally, the current list of installed artifacts can be reported to the cloud to e.g., allow complaints checks.
  • The data formats are cloud agnostics. In this version, mapping to Cumulocity IoT is supported out-of-the-box. Additional clouds can be supported by adding so-called data mappers.
  • A plugin architecture to plugin different package managers or other software artifacts like analytics models.
  • apt plugin to manage Debian packages organized in repositories.
  • Thin-edge.io is available in source code and as Debian packages in 3 architectures: amd64, arm64, and armhf

To better understand the Software Management feature, this blog post takes on a walkthrough using a few use-cases namely software installation, uninstallation and update commands from the cloud.

How is traditional Embedded Software updated in devices?

With most of today’s Linux distributions, software installations use pre-compiled packages or repositories(repos) containing binaries of software, configuration files, and information about software inter-dependencies stored on different servers. Each distro have different package management tools — keeping track of all these dependencies, managing the details of bug fixes and security updates for individual software installed requires dedicated efforts and precious time loss of valuable Embedded Software development.

Navigating Package Managers using plugin API

With the release 0.3, thin-edge.io has a new process “sm-agent” (Software Management Agent). The agent receives cloud agnostic commands, and performs the requested actions (install, uninstall, report software list) on the device.

“sm-agent” uses plugins to delegate software management commands received from the cloud to the appropriate package managers.

On a device, several plugins can be installed for various kinds of software artifacts, e.g .for Debian packages, Docker or for analytics models. Note that you can even have multiple plugins for the same artifact: For instance, for a Debian package manager, several plugins can concurrently be installed. Namely, apt to handle regular packages from the public apt repository and another named company-apt to install packages from company’s private package repository.

The plugin-architecture of thin-edge.io

Install and Enable the Software Management Feature

To install the Software Management feature on your “thin-edge devices,” we recommend you go through the following steps here:

https://github.com/thin-edge/thin-edge.io/blob/main/docs/src/howto-guides/0012_install_and_enable_software_management.md

As a prerequisite, thin-edge.io and other related components (namely the mapper component) are to be downloaded on your Linux device. Following this, tedge apt plugin and tedge agent needs to be downloaded.

In our latest release, we provide support from the Cumulocity cloud and show the examples respective to it. Once, the thin-edge Software Management services are started on the device, the “Software” tab gets enabled. The list of software installed on the device will be visible as shown in the figure below. However, we are always coming up with additional cloud support and you can add your own Cloud mapper component to receive commands from.

Software Management on a ‘thin-edge device’

The software management feature can be enabled and disabled for debugging purpose using the following commands-

Starting the service:

Stopping the service:

Software installations, un-installations, and updates from Cumulocity cloud-

Sequence of operations on the receipt of a software list request

The sequence diagram above identifies all the components involved in message flows between cloud and the device. The components are represented as objects, starting from the very right side with the actor “Cloud” reaching to the very left side — the actor “Package Manager”.

Use-Case 1> Update SW LIST

The purpose of this use-case is to install new software or remove existing ones from the device, according to commands received from the cloud. The operation is triggered from the cloud side with the desired package name and action performed(install/uninstall). The cloud gets status feedbacks (“executing” or “successful” or “failed”) and the up-to-date software list is shown to the cloud provider.

Use-Case 2> Report SW LIST

The device reports the current list of software packages installed on the device to the cloud.

Use-Case 3> Install/ Remove SW Packages

Installs one or more Software packages on the device, the Package manager gets involved. The SM-Agent, according to the cloud commands received, triggers the relevant package manager which further modifies the Software packages under it.

What comes next?

Using the flexible software plug-in API framework mentioned in this blogpost, we will allow additional customizations and support for other software artifacts like binaries, Debian packages, Docker containers and Snaps in future releases.

Additionally, it will be possible to explicitly download software artifacts in a reliable manner from the cloud.

Where to find more information?

If you want to add own software management plugins, please look at the tutorial here. Additionally, you can find code implementing the APT plugin here.

If you want to connect thin-edge.io to your own cloud, please check out here for the cloud-agnostic message formats on the MQTT bus. To add another cloud capability, please add or extend a data mapper that converts these messages into cloud-specific ones.

To keep updated of our progress or contribute towards our open-source development, join our Community on GitHub, and follow us on Twitter.

--

--

Debom Ghosh
thin-edge.io

A Product Manager working in the field of IoT, Edge Computing and Machine Learning topics