Skip to main content
Version: 1.8.5

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​

Note

If you don't have the Yandex.Cloud command line interface yet, install and initialize it.

  1. 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.
  1. Go to the link and connect to your account. Log in to Yandex

  2. You are redirected to a page that shows the OAuth token needed for the next step. OAuth token

  3. 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
  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 FieldDescription
NameName of the connection.
Folder IDThe Folder ID that you want to use. See Folder ID.
Service Account IDService account ID that allows the management of registry and devices. See Service Account ID.
Authorized Key IDDefines the ID of the key for the service account. See Authorized Key ID and Authorized Private Key.
Authorized Private KeyDefines the private key of the authorization.
Registry IDAn existing registry could be used. If empty, a new registry named Actility_ThingPark is created. See Registry ID (optional).
DescriptionOptional 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​

  1. Go to the management console. You can see the folder ID. Otherwise, select a folder. Folder ID in the management console

  2. You can see the folder ID in the URL, for example https://console.cloud.yandex.com/folders/b1g9jainvkdss7dljq72. Folder ID in the URL of the management console

In this example, b1g9jainvkdss7dljq72 is the folder ID.

Service Account ID​

  1. Go to the Yandex Cloud service.

  2. Click the Management Console tab and select the Overview tab. Management console

  3. You can then retrieve the service account ID parameter. Service account ID

Authorized Key ID and Authorized Private Key​

  1. Go to the Yandex Cloud service and select your cloud. Available clouds

  2. Click the Service accounts tab. Service accounts tab

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

  4. 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. Service account form

  5. Go back to the Service accounts tab. Choose the service account and click the line with its name.

  6. Click Create new key in the top panel.

  7. Click Create authorized key. Enter a description of the key so that you can easily find it in the management console.

  8. Save the ID and the private key.

Registry ID (optional)​

To use an existing registry, get its ID:

  1. Open the Yandex.Cloud command line.

  2. 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​

  1. In ThingPark Enterprise, click Connections -> + Add Connection -> ThingPark X IoT Flow. Add a ThingPark X IoT Flow connection in ThingPark Enterprise

  2. In ThingPark X IoT Flow, click Yandex in the list of connectors. Select the Yandex connector

  3. 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_ThingPark is created.
    • Description: optional. Set your Yandex connection
  4. Click Create. A notification confirms that the connection has been created, and the connection details open.

  5. In the connection details, check that the connection is OPENED (see Connection States).

Note

Parameters marked with * are mandatory.

Changing the Settings After Creation​

In the connection details, the settings sections show the settings of the connection.

  1. Click the Edit button next to the setting to change.

  2. 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 /connections to create a new Connection instance
  • PUT /connections to update a Connection instance
  • DELETE /connections to delete a Connection instance
Note

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.

FieldDescription
connectorIdMust be set to actility-yandex-iot.
configuration/serviceAccountIdService account ID that allows the management of registry and devices.
configuration/authorizedKeyIdDefines the ID of the key for the service account.
configuration/authorizedPrivateKeyDefines the private key of the authorization.
configuration/folderIdThe Folder ID that you want to use.
configuration/registryIdID of an existing registry. If empty, a new registry named Actility_ThingPark is created.
Important note

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.

  1. In the management console, select the folder where you want to add a new registry. Select the folder

  2. Click Yandex IoT Core in the left menu. Yandex IoT Core

  3. Click Create registry. Create a registry

  4. Fill in the form like the example below. Registry form

  5. Click Create.

Adding Devices to the Registry​

Follow these steps to add a new device to your registry.

  1. In the management console, select the folder where you want to add a new device. Select the folder

  2. Click Yandex IoT Core in the left menu. Yandex IoT Core

  3. Select the registry.

  4. In the left part of the window, select Devices.

  5. Click Add device.

  6. Enter the name and the password of the new device.

  7. Click Create.

Displaying Information to Know if It Worked​

You need to have MQTT.fx and Mosquitto installed prior to these steps.

  1. Open MQTT.fx and create a connection with the following parameters: Broker configuration in MQTT.fx
ParameterDescription
Certification authority certificateSecurity certificate needed to connect to the broker.
Broker addressmqtt.cloud.yandex.net
Broker port8883
ProtocolTLSv1.2
  1. Go to the root folder of Mosquitto, open a new command prompt and enter this command:
    net start mosquitto
  1. 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
  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.