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

Return to the regular view of this page.

Getting started

Explore different ways to connect and manage your edge device remotely using Eclipse Kanto.

1 - Install Eclipse Kanto

Run Eclipse Kanto on your edge device.

Before you begin

The containerd Debian package is required. You can install it manually or run:

curl -fsSL https://github.com/eclipse-kanto/kanto/raw/main/quickstart/install_ctrd.sh | sh

Install Eclipse Kanto

Choose the Eclipse Kanto Debian package for your target device architecture from the ones available at the project’s GitHub Releases page. Download and install it via executing the following (adjusted to your package name):

wget https://github.com/eclipse-kanto/kanto/releases/download/v0.1.0-M3/kanto_0.1.0-M3_linux_x86_64.deb && \
sudo apt install ./kanto_0.1.0-M3_linux_x86_64.deb

Verify

It’s important to check if all the services provided by the Eclipse Kanto package are up and running successfully. You can quickly do that via executing:

systemctl status \
suite-connector.service \
container-management.service \
software-update.service \
file-upload.service \
file-backup.service \
system-metrics.service

All listed services must be in an active running state.

What’s next

Explore via Eclipse Hono

2 - Explore via Eclipse Hono

Connect and start managing your edge device via Eclipse Hono.

By following the steps below you will connect your first device to a publicly available Eclipse Hono sandbox using Eclipse Kanto. A couple of simple Eclipse Hono northbound business applications written in Python are provided to explore the capabilities for remotely managing and monitoring your edge device.

Before you begin

The location where the Python applications and utility shell scripts will run does not have to be your edge device as they communicate remotely with Eclipse Hono only. To run them, you need:

  • Python 3 and pip3

  • The quickstart applications and provisioning scripts

    You can execute the script below to download them automatically:

    mkdir quickstart && cd quickstart && \
    wget https://github.com/eclipse-kanto/kanto/raw/main/quickstart/hono_commands.py && \
    wget https://github.com/eclipse-kanto/kanto/raw/main/quickstart/hono_events.py && \
    wget https://github.com/eclipse-kanto/kanto/raw/main/quickstart/requirements.txt && \
    wget https://github.com/eclipse-kanto/kanto/raw/main/quickstart/hono_provisioning.sh
    
  • OpenSSL and the following SSL and SASL related libraries: pkg-config, swig, libsasl2-dev, libsasl2-2 libsasl2-modules-gssapi-mit and libssl-dev, e.g.:

    sudo apt install openssl pkg-config swig libsasl2-dev libsasl2-2 libsasl2-modules-gssapi-mit libssl-dev
    
  • Required Python dependencies to run the scripts

    You can install them by using the downloaded requirements.txt file via executing:

    pip3 install -r requirements.txt
    

Provision the Eclipse Hono tenant and device

In order to be able to connect your device to Eclipse Hono, you need to have a dedicated tenant and a device instance provisioned for it. Fill in the required empty environmental variables definitions in the hono_provisioning.sh, e.g.:

# The Hono tenant to be created
export TENANT=demo
# The identifier of the device on the tenant
# Note! It's important for the ID to follow the convention namespace:name (e.g. demo:device)
export DEVICE_ID=demo:device
# The authentication identifier of the device
export AUTH_ID=demo_device
# A password for the device to authenticate with
export PWD=secret

Run the provisioning script and you will have your Eclipse Hono tenant and device ready to be connected:

./hono_provisioning.sh

Configure Eclipse Kanto

Eclipse Kanto uses the /etc/suite-connector/config.json to acquire all the remote communication, identification and authentication data to establish the remote connection. Update it with the following:

{
  "provisioningFile": "/etc/suite-connector/provisioning.json",
  "logFile": "/var/log/suite-connector/suite-connector.log",
  "address":"mqtts://hono.eclipseprojects.io:8883",
  "tenantId":"demo",
  "deviceId":"demo:device",
  "authId":"demo_device",
  "password":"secret"
}

Restart the Suite Connector service for the changes to take effect:

sudo systemctl restart suite-connector.service

Verify

To explore remote containerized applications management, we will use the two Python scripts to run, monitor and remove a simple InfluxDB container using its public container image available at Docker Hub.

First, start the monitoring application that requires the configured Eclipse Hono tenant (-t) and will print all received events triggered by the device:

python3 hono_events.py -t demo

In another terminal, we are ready to spin up an InfluxDB container instance at the edge via executing the second application that requires the command to execute (run), the Eclipse Hono tenant (-t), device identifier (-d) and the full container image reference to use (--img):

python3 hono_commands.py run -t demo -d demo:device --img docker.io/library/influxdb:1.8.4

After the script exits with success, you can check out the new container running on your edge device via executing:

sudo kanto-cm list

Looking at the terminal where the monitoring application is running, you will be able to see all the events triggered by the operation.

To remove the newly created container, execute the same application script only this time with the rm command and the identifier of the container to remove (--id), e.g.:

python3 hono_commands.py rm -t demo -d demo:device --id e6f7fbea-0e95-433c-acc7-16ef21b9c033