CREATING A YANDEX CONNECTION
The Yandex connector connects ThingPark X IoT Flow to Yandex IoT Core. It uses a service account of your Yandex Cloud folder to manage a registry and its devices, and exchanges the messages of your devices through this registry.
The data follows this path: LoRaWAN® device → ThingPark Enterprise → ThingPark X IoT Flow connection → Yandex IoT Core.
You must have an active Yandex account before you create a Yandex connection. Register a new account if you don't have one already.
Configuring Your Yandex Account
If you don't have the Yandex.Cloud command line interface yet, install and initialize it.
- Open the command line (CMD) and type the command
yc init. You should see a similar result:
yc init
Welcome! This command will take you through the configuration process.
Please go to https://oauth.yandex.ru/authorize?response_type=token&client_id=1a0967aa636643d9b2ef855fa7bec2fb in order to obtain OAuth token.
-
Go to the link and connect to your account.

-
You are redirected to a page that shows the OAuth token needed for the next step.
-
Enter the OAuth token in the command line, then choose a folder.
You have one cloud available: 'my-cloud' (id = b1guj45qubqp266nra43). It is going to be used by default.
Please choose folder to use:
[1] default (id = b1go9m152l1drhp8khe6)
[2] Create a new folder
Please enter your numeric choice: 1
- Finally, choose a compute zone like below.
Your current folder has been set to 'default' (id = b1go9m152l1drhp8khe6).
Do you want to configure a default Compute zone? [Y/n] Y
Which zone do you want to use as a profile default?
[1] ru-central1-a
[2] ru-central1-b
[3] ru-central1-c
[4] Don't set default zone
Please enter your numeric choice: 1
Your profile default Compute zone has been set to 'ru-central1-a'.
Collecting Expected Information
Parameters required
| UI Field | Description |
|---|---|
| Name | Name of the connection. |
| Folder ID | The Folder ID that you want to use. See Folder ID. |
| Service Account ID | Service account ID that allows the management of registry and devices. See Service Account ID. |
| Authorized Key ID | Defines the ID of the key for the service account. See Authorized Key ID and Authorized Private Key. |
| Authorized Private Key | Defines the private key of the authorization. |
| Registry ID | An existing registry could be used. If empty, a new registry named Actility_ThingPark is created. See Registry ID (optional). |
| Description | Optional description of the connection. |
After you have created your Yandex account, you need to retrieve the parameter values that are required to configure the Yandex connector.
Folder ID
-
Go to the management console. You can see the folder ID. Otherwise, select a folder.

-
You can see the folder ID in the URL, for example
https://console.cloud.yandex.com/folders/b1g9jainvkdss7dljq72.
In this example, b1g9jainvkdss7dljq72 is the folder ID.
Service Account ID
-
Go to the Yandex Cloud service.
-
Click the Management Console tab and select the Overview tab.

-
You can then retrieve the service account ID parameter.

Authorized Key ID and Authorized Private Key
-
Go to the Yandex Cloud service and select your cloud.

-
Click the Service accounts tab.

-
Click Create a service account if you don't have one already.

-
Choose a name and add one or several roles for your service account, then click Create. You need to create or link a billing account.

-
Go back to the Service accounts tab. Choose the service account and click the line with its name.
-
Click Create new key in the top panel.
-
Click Create authorized key. Enter a description of the key so that you can easily find it in the management console.
-
Save the ID and the private key.
Registry ID (optional)
To use an existing registry, get its ID:
-
Open the Yandex.Cloud command line.
-
Get the list of registries in the default folder with the command below:
$ yc container registry list
You should see a result like this:
$ yc container registry list +----------------------+--------+----------------------+ | ID | NAME | FOLDER ID | +----------------------+--------+----------------------+ | udol16490s9a2t1gr8mi | my-reg | b1g13tyubu5ek1omtsu0 | +----------------------+--------+----------------------+
The folder specified in the CLI profile is used by default. You can specify a different folder using the --folder-name or --folder-id parameter.
To create a registry, see Creating a New Registry.
Creating a Connection With UI
-
In ThingPark Enterprise, click Connections -> + Add Connection -> ThingPark X IoT Flow.

-
In ThingPark X IoT Flow, click Yandex in the list of connectors.

-
Fill in the form:
- Name: a clear name for the connection, for example
My Yandex Connection. - Folder ID: the ID of the folder that you want to use.
- Service Account ID: the ID of the service account that manages the registry and the devices.
- Authorized Key ID: the ID of the authorized key of the service account.
- Authorized Private Key: the private key of the authorized key.
- Registry ID: optional, the ID of an existing registry. When it is empty, a new registry named
Actility_ThingParkis created. - Description: optional.

- Name: a clear name for the connection, for example
-
Click Create. A notification confirms that the connection has been created, and the connection details open.
-
In the connection details, check that the connection is OPENED (see Connection States).
Parameters marked with * are mandatory.
Changing the Settings After Creation
In the connection details, the settings sections show the settings of the connection.
-
Click the Edit button next to the setting to change.
-
Enter the new value and click the Confirm button, then confirm the update.
A notification confirms that the setting is updated.
Creating a Connection With API
The creation of a connection establishes a bidirectional messaging transport link between ThingPark X IoT Flow and the cloud provider. Events and commands from multiple Devices will be multiplexed over this messaging transport link.
To do this, you need to use the Connections group resource:
POST /connectionsto create a new Connection instancePUT /connectionsto update a Connection instanceDELETE /connectionsto delete a Connection instance
We follow the REST-full API pattern, when updating configuration properties for a connection resource. Thus, you must also provide the whole configuration again.
Example for creation of a new connection instance:
POST /connections
{
"connectorId": "actility-yandex-iot",
"name": "Test Yandex Connection",
"configuration": {
"serviceAccountId": "ajeolm791v8k2qje7tht",
"authorizedKeyId": "auve9n3a5peq39kcuhtg",
"authorizedPrivateKey": "-----BEGIN PRIVATE KEY-----...-----END PRIVATE KEY-----",
"folderId": "b1f7re11con4ut4g3s6v"
}
}
The following table lists the properties applicable to a connection instance.
| Field | Description |
|---|---|
connectorId | Must be set to actility-yandex-iot. |
configuration/serviceAccountId | Service account ID that allows the management of registry and devices. |
configuration/authorizedKeyId | Defines the ID of the key for the service account. |
configuration/authorizedPrivateKey | Defines the private key of the authorization. |
configuration/folderId | The Folder ID that you want to use. |
configuration/registryId | ID of an existing registry. If empty, a new registry named Actility_ThingPark is created. |
All properties are not present in this example. You can check the rest of these properties in the common parameters section.
Configuring Yandex IoT Core
Creating a New Registry
Follow these steps to add a new registry.
-
In the management console, select the folder where you want to add a new registry.

-
Click Yandex IoT Core in the left menu.

-
Click Create registry.

-
Fill in the form like the example below.

-
Click Create.
Adding Devices to the Registry
Follow these steps to add a new device to your registry.
-
In the management console, select the folder where you want to add a new device.

-
Click Yandex IoT Core in the left menu.

-
Select the registry.
-
In the left part of the window, select Devices.
-
Click Add device.
-
Enter the name and the password of the new device.
-
Click Create.
Displaying Information to Know if It Worked
You need to have MQTT.fx and Mosquitto installed prior to these steps.
- Open MQTT.fx and create a connection with the following parameters:

| Parameter | Description |
|---|---|
| Certification authority certificate | Security certificate needed to connect to the broker. |
| Broker address | mqtt.cloud.yandex.net |
| Broker port | 8883 |
| Protocol | TLSv1.2 |
- Go to the root folder of Mosquitto, open a new command prompt and enter this command:
net start mosquitto
- Subscribe a registry to a single device's topic by entering the following command:
mosquitto_sub -h mqtt.cloud.yandex.net \
-p 8883 \
--cafile rootCA.crt \
--cert registry-cert.pem \
--key registry-key.pem \
-t '$devices/<device ID>/events' \
-q 1
- Send data to the device's topic with the following command:
$ mosquitto_pub -h mqtt.cloud.yandex.net \
-p 8883 \
--cafile rootCA.crt \
--cert device-cert.pem \
--key device-key.pem \
-t '$devices/<device ID>/events' \
-m 'Test data' \
-q 1
You will see the result in the MQTT's window.
Limitations
There are currently no known limitations to the YANDEX connector.
Troubleshooting
There is no known issue.