Relationship between service resources
Data is exchanged via MQTT version 3.1.1. This simplified network protocol for device communication is based on the publisher/subscriber pattern.
For devices and registries to begin exchanging data and commands, you need to log in. You can do this using X.509 certificates or your username and password.
A device is an instance of a physical device, such as a temperature sensor, represented in the service as the device name and its certificate.
Devices are created in a registry. They can send telemetry data to the server, get commands, and interact with other devices in the registry.
A registry is a set of devices that are logically related to each other. Registries can read device data and send commands to them.
The MQTT broker is the central node for exchanging MQTT messages between devices and registries. Data is only exchanged through the broker. It's responsible for receiving and processing messages and controls their delivery to clients (devices or registries) to ensure the necessary QoS.
Inside the service, devices and registries exchange data and commands as messages with specific topics.
No additional settings are required for working with the MQTT broker integrated in the YC CLI (
yc iot mqtt --help). If you use third-party libraries or applications (such as Mosquitto) as an MQTT broker, use the MQTT broker connection parameters.
When exchanging messages, Yandex IoT Core supports the following quality of service (QoS) levels for MQTT:
QoS 0: At most once. A message is sent no more than once and there is no guarantee of delivery.
QoS 1: At least once. This level guarantees that a message is delivered to a client at least once. There is a chance of receiving duplicate messages.
For more information about Yandex IoT Core service limits, see Quotas and limits.