Yandex cloud

<< Click to Display Table of Contents >>

Navigation:  Examples > IOT clouds >

Yandex cloud

Previous pageReturn to chapter overview

Yandex IoT Core is a cloud-based fail-safe MQTT broker that ensures secure two-way communication between devices and local or cloud resources.

Devices and registries interact using X.509 certificates:

If you have a certificate, just add it to the device in the registry.

If don't have one, you can create a certificate, for example, with OpenSSL:

 

openssl req -x509 \
-newkey rsa:4096 \
-keyout key.pem \
-out cert.pem \
-nodes \
-days 365 \
-subj '/CN=localhost'

 

Create registry

createregistry

You also have to add certificate you created.

 

Create device

yandexdevice

 

Setup MQTT publisher

yandexcloudmqttpublisher

Where:

Username - Device ID

Password - password of the device.

Write topic format - in our case $devices/arei326ajtmuvr4v26ve/events/{tagname}. 

It contains ID of the device and keyword {tagname} for publishing tag's values.

Read topic format - in our case $devices/arei326ajtmuvr4v26ve/commands/{tagname}

It contains ID of the device and keyword {tagname} for subscribing to tag's values.

Certificate filename - you have to download certificate file from here: 

https://cloud.yandex.com/en/docs/iot-core/concepts/mqtt-properties

And place this file in the folder private where installed TeslaSCADA2 Runtime.

 

Now when you run the project created with this MQTT publisher settings all tags values used in this project will be published in the broker.

The published values don't have retain properties.

 

Setup MQTT client

To read data from the Yandex IOT we create new project and setup MQTT server:

yandexmqttclient

Where:

Username - Registry ID

Password - password of the registry.

Certificate filename - you have to download certificate file from here: 

https://cloud.yandex.com/en/docs/iot-core/concepts/mqtt-properties

And place this file in the folder private where installed TeslaSCADA2 Runtime.

 

Setup Tag

yandextag

PV Input tag

pvinputtag

It contains ID of the device you setup in Yandex IOT core, keyword events and name of the tag you want to read from the publisher project.

PV Output tag

pvoutputtag

It contains ID of the device you setup in Yandex IOT core, keyword commands and name of the tag you want to write to the publisher project.

 

Now you can read values from the Yandex cloud by using this project. And write commands also.