Flexible Data Exchange
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.