Intercambio de datos flexible
Introduction
Flexible data exchange is the recommended MQTT integration method on the Gear Studio platform. All MQTT devices natively supported by the platform use flexible data exchange, but this method is also recommended for non-natively supported device models.
Flexible data exchange is based on two types of messages:
- Uplink: uplink messages are all those sent from devices to the platform. The platform must be able to process uplink messages to store the relevant information and process it.
- Downlink: downlink messages are those sent from the platform to devices, typically in the form of commands. Some devices do not support downlink messages, while others only support them for specific configuration operations.
For device models not natively supported by the platform, flexible data exchange allows using scripts to easily define uplink message processing and downlink message creation.
Steps to Follow
Configuring the Topic for Sending Data to the Platform
For the platform to receive device data, you need to configure the device to publish to the topic \{\*\*MQTTUserID\*\*\}/uplink/\{\*\*DeviceAddress\*\*\}, where:
- MQTTUserID is the MQTT user identifier chosen for the device. More information here.
- DeviceAddress is the device address, as entered when creating the device on the platform.
For example, if the device uses the MQTT user JH529LQK91G7 and the device address is 06A022B39C14, then it should be configured to publish information to the following topic:
JH529LQK91G7/uplink/06A022B39C14
Configuring the Topic for Receiving Data from the Platform (Optional)
For the platform to send data to the device, you need to configure the device to subscribe to the topic \{\*\*MQTTUserID\*\*\}/downlink/\{\*\*DeviceAddress\*\*\}, where:
- MQTTUserID is the MQTT user identifier chosen for the device. More information here.
- DeviceAddress is the device address, as entered when creating the device on the platform.
For example, if the device uses the MQTT user JH529LQK91G7 and the device address is 06A022B39C14, then it should be configured to subscribe to the following topic:
JH529LQK91G7/downlink/06A022B39C14
Once these steps are completed, the platform will begin receiving and processing device information. If the device uses a model not natively supported by the platform, you will also need to define the data processing scripts, as described in this section.
MQTT
Introduction Cette section décrit l'intégration avec la plateforme Gear Studio en utilisant MQTT. Cette fonctionnalité est conçue pour permettre l'intégration avec des appareils de divers fabricants, ainsi qu'avec des appareils construits sur mesure avec Arduino, nodeMCU, Raspberry Pi et toute autre plateforme supportant la communication MQTT avec sécurité TLS.
Pont HTTP
Introduction Le pont HTTP est une fonctionnalité de la plateforme Gear Studio qui permet l'intégration d'appareils en utilisant l'API HTTP à travers MQTT. Cela permet de migrer des appareils qui utilisent l'interface HTTP pour utiliser MQTT à la place, avec des changements minimes.