Apertis maintains an instance of Eclipse cloud2edge that can be used to test the IoT images using Eclipse Kanto. The following sections describe how to set up the IoT image’s suite-connector configuration to be able to connect to this instance.
The following sections describe how to set the IoT image’s suite-connector configuration.
Required Information
Various stub values will be seen throughout the commands in this document that will need to be replaced. Any command that needs some values inside to be replaced will have those listed in the paragraph preceding the command.
The following variables need to be set to the credentials used to connect to the Apertis cloud2edge instance (these credentials are not publicly available, contact the Apertis team to request access):
$HONO_REGISTRY_USERNAME
,$HONO_REGISTRY_PASSWORD
: The username and password for Hono’s device registry.$DITTO_USERNAME
,$DITTO_PASSWORD
: The username and password for Ditto.
The following variables need to be set to unique values for each individual device registration:
$DEVICE_ID
: The identifier for the device, in the formatNAMESPACE:NAME
, whereNAMESPACE
is some unique identifying namespace for the device. In order to avoid conflicts, you are advised to use a non-trivial, hard-unique device identifier.$AUTH_ID
: The device’s authentication identifier (essentially a username) used to connect to Hono. This value is specific to a device and need not be globally unique, but for simplicity, feel free to reuse the device ID (note that:
is not valid here and should be replaced with another character, such as_
).$PASSWORD
: The device’s password used to connect to Hono. This should be a reasonably long, secure password, preferably generated via a secure password generation tool.
Device Registration
Registration is typically done outside of the IoT device.
You can register a new device $DEVICE_ID
via the following command (set $HONO_REGISTRY_USERNAME
, $HONO_REGISTRY_PASSWORD
, and $DEVICE_ID
):
|
|
After this, login credentials can be assigned to the device (set $HONO_REGISTRY_USERNAME
, $HONO_REGISTRY_PASSWORD
, $DEVICE_ID
, $AUTH_ID
, and $PASSWORD
):
|
|
Next, an Eclipse Ditto thing digital twin should be created for the device (set $DITTO_USERNAME
, $DITTO_PASSWORD
, and $DEVICE_ID
):
|
|
In this example, digital twin is registered with the attributes location: Germany
and the temperature
and humidity
features. (Note that the _policy
section should remain untouched!)
Once your device is registered, you are ready to configure the IoT image on the device.
Configure the IoT Image
The configuration to connect to the server needs to be written in the /etc/suite-connector/config.json
file and can be created via the following command (set $DEVICE_ID
, $AUTH_ID
, and $PASSWORD
):
|
|
This setup assumes the SSL certificate for Apertis’s cloud2edge is located at /etc/suite-connector/apertis.crt
. In order to obtain it, run:
|
|
Starting the Service
The suite-connector
service can now be enabled and started with:
|
|
Device Deletion
After you’re done with a device, you can delete it and its digital twin via the following commands:
|
|