diff --git a/_includes/templates/iot-gateway/get-set-connector-rpc/mqtt.md b/_includes/templates/iot-gateway/get-set-connector-rpc/mqtt.md index 426b9e85e8..35f40c3526 100644 --- a/_includes/templates/iot-gateway/get-set-connector-rpc/mqtt.md +++ b/_includes/templates/iot-gateway/get-set-connector-rpc/mqtt.md @@ -5,6 +5,7 @@ With the GET method you can subscribe to MQTT topic and receive message from it. ```bash get requestTopicExpression=;responseTopicExpression=;value=; ``` +{: .copy-code} Where: - `` - the topic to publish the request; @@ -18,54 +19,52 @@ To read the value of the room light level, run this query: ```bash get requestTopicExpression=data/get_light_level;responseTopicExpression=data/response;value=${params}; ``` +{: .copy-code} -**Response:** - -```json -{"result": {"success":true}} -``` +Also, let's take a look at the data received from the MQTT topic **"data/response"**: {:refdef: style="text-align: left;"} ![image](/images/gateway/get-set-connector-rpc/mqtt-get-set-rpc-1.png) {: refdef} -Also, let's take a look at the data received from the MQTT topic **"data/response"**: - -{:refdef: style="text-align: left;"} -![image](/images/gateway/get-set-connector-rpc/mqtt-get-set-rpc-3.jpeg) -{: refdef} ### SET method With the SET method you can publish a message to MQTT topic. ```bash -set requestTopicExpression=data/get_light_level;value=${params}; +set requestTopicExpression=data/set_light_level;value=${params}; ``` +{: .copy-code} Where: - `` - the topic to publish request; - `` - the value to send. For example, in our case, we know that we can set the value of the room light level to the MQTT topic -**"data/light_level"**. To set the value of the room light level, run the following query: +**"sata/light_level"**. To set the value of the room light level, run the following query: ```bash set requestTopicExpression=data/set_light_level;value=80; ``` +{: .copy-code} -**Response:** - -```json -{"result": {"success":true}} -``` +On the screenshot below, you can see that we have successfully sent the SET request to the MQTT topic **"data/set_light_level"**: {:refdef: style="text-align: left;"} ![image](/images/gateway/get-set-connector-rpc/mqtt-get-set-rpc-2.png) {: refdef} -Also, let's take a look at the result in the **"data/light_level"** MQTT topic: +Also, let's take a look at the result after SET method in the **"data/light_level"** MQTT topic by sending Two way GET RPC request. +To read the value of the room light level to make sure the room light level is really updated, run this query: + +```bash +get requestTopicExpression=data/get_light_level;responseTopicExpression=data/response;value=${params}; +``` +{: .copy-code} + +On the screenshot below, you can see that the room light level value is updated to 80 after the SET request: {:refdef: style="text-align: left;"} -![image](/images/gateway/get-set-connector-rpc/mqtt-get-set-rpc-4.jpeg) +![image](/images/gateway/get-set-connector-rpc/mqtt-get-set-rpc-3.png) {: refdef} diff --git a/_includes/templates/iot-gateway/mqtt-connector/attribute-request-subsection-advanced.md b/_includes/templates/iot-gateway/mqtt-connector/attribute-request-subsection-advanced.md deleted file mode 100644 index 7a968f5ec5..0000000000 --- a/_includes/templates/iot-gateway/mqtt-connector/attribute-request-subsection-advanced.md +++ /dev/null @@ -1,51 +0,0 @@ -This section in configuration file looks like: -```json -"attributeRequests": [ - { - "retain": false, - "topicFilter": "v1/devices/me/attributes/request", - "deviceInfo": { - "deviceNameExpressionSource": "message", - "deviceNameExpression": "${serialNumber}" - }, - "attributeNameExpressionSource": "message", - "attributeNameExpression": "${versionAttribute}", - "topicExpression": "devices/${deviceName}/attrs", - "valueExpression": "${attributeKey}: ${attributeValue}" - } -] -``` -{: .copy-code} - -Also, you can request multiple attributes at once. Simply add one more JSON-path to -attributeNameExpression parameter. For example, we want to request two shared attributes in one request, our config -will look like: -```json -"attributeRequests": [ - { - "retain": false, - "topicFilter": "v1/devices/me/attributes/request", - "deviceInfo": { - "deviceNameExpressionSource": "message", - "deviceNameExpression": "${serialNumber}" - }, - "attributeNameExpressionSource": "message", - "attributeNameExpression": "${versionAttribute}, ${pduAttribute}", - "topicExpression": "devices/${deviceName}/attrs", - "valueExpression": "${attributeKey}: ${attributeValue}" - } -] -``` - -![image](/images/gateway/mqtt-connector/attribute-requests-example-advanced-1-ce.png) - -| **Parameter** | **Default value** | **Description** | -|:--------------------------|:-|- -| retain | **false** | If set to true, the message will be set as the "last known good"/retained message for the topic. | -| topicFilter | **v1/devices/me/attributes/request** | Topic for attribute request | -| deviceNameExpression | **${serialNumber}** | JSON-path expression, for looking the device name in topicFilter message | -| attributeNameExpression | **${versionAttribute}** | JSON-path expression, for looking the attribute name in topicFilter message | -| topicExpression | **devices/${deviceName}/attrs** | JSON-path expression, for formatting reply topic | -| valueExpression | **${attributeKey}: ${attributeValue}** | Message that will be sent to topic from topicExpression | -| --- - diff --git a/_includes/templates/iot-gateway/mqtt-connector/attribute-request-subsection-basic.md b/_includes/templates/iot-gateway/mqtt-connector/attribute-request-subsection-basic.md index c9d4a3afe8..4258293ab9 100644 --- a/_includes/templates/iot-gateway/mqtt-connector/attribute-request-subsection-basic.md +++ b/_includes/templates/iot-gateway/mqtt-connector/attribute-request-subsection-basic.md @@ -1,4 +1,18 @@ -To adding new requests mapping, navigate to the "Requests mapping" tab and click the "plus" icon. -In the open modal window, select the "Attribute request" type, set a topic filter. Fill in the fields of the "Input request parsing" and "Output request parsing" sections. Then, click "Add". +In order to add new attribute request mapping, follow these steps: -![image](/images/gateway/mqtt-connector/attribute-request-1-ce.png) \ No newline at end of file +{% assign AttributesRequest = ' + === + image: /images/gateway/mqtt-connector/mqtt-gateway-configuring-11-ce.png, + title: Click the "**Add mapping**" under "**Requests mapping**" section to add new attribute request mapping. + === + image: /images/gateway/mqtt-connector/mqtt-attribute-requests-1.png, + title: Select "**Attribute request**" in the **Request type** field, enter the "**Topic filter**" + === + image: /images/gateway/mqtt-connector/mqtt-attribute-requests-2.png, + title: Configure the **Device name expression**, **Response topic expression**, and **Attribute name expression** fields. + Select the source type for each field (`Message`, `Topic`, or `Constant`) and enter the corresponding values. + You can also set the **Retain** option to determine whether the attribute response message should be retained by the MQTT broker. + ' +%} + +{% include images-gallery.liquid showListImageTitles="true" imageCollection=AttributesRequest %} diff --git a/_includes/templates/iot-gateway/mqtt-connector/attribute-updates-subsection-advanced.md b/_includes/templates/iot-gateway/mqtt-connector/attribute-updates-subsection-advanced.md deleted file mode 100644 index c3495a6ff7..0000000000 --- a/_includes/templates/iot-gateway/mqtt-connector/attribute-updates-subsection-advanced.md +++ /dev/null @@ -1,24 +0,0 @@ -This section in configuration file looks like: - -```json - "attributeUpdates": [ - { - "retain": false, - "deviceNameFilter": ".*", - "attributeFilter": "firmwareVersion", - "topicExpression": "sensor/${deviceName}/${attributeKey}", - "valueExpression": "{\"${attributeKey}\":\"${attributeValue}\"}" - } - ] -``` - -![image](/images/gateway/mqtt-connector/attribute-updates-example-advanced-1-ce.png) - -| **Parameter** | **Default value** | **Description** | -|:-|:----------------------------------------------------|-------------------------------------------------------------------------------------------------- -| retain | **false** | If set to true, the message will be set as the "last known good"/retained message for the topic. | -| deviceNameFilter | **.\*** | Regular expression device name filter, used to determine, which function to execute. | -| attributeFilter | **uploadFrequency** | Regular expression attribute name filter, used to determine, which function to execute. | -| topicExpression | **sensor/${deviceName}/${attributeKey}** | JSON-path expression used for creating topic address to send a message. | -| valueExpression | **{\\"${attributeKey}\\":\\"${attributeValue}\\"}** | JSON-path expression used for creating the message data that will send to topic. | -|--- \ No newline at end of file diff --git a/_includes/templates/iot-gateway/mqtt-connector/attribute-updates-subsection-basic.md b/_includes/templates/iot-gateway/mqtt-connector/attribute-updates-subsection-basic.md index a14b6d5176..9011625d53 100644 --- a/_includes/templates/iot-gateway/mqtt-connector/attribute-updates-subsection-basic.md +++ b/_includes/templates/iot-gateway/mqtt-connector/attribute-updates-subsection-basic.md @@ -1,4 +1,17 @@ -To adding new requests mapping, navigate to the "Requests mapping" tab and click the "plus" icon. -In the open modal window, select the "Attribute update" type, and set a device name filter, attribute filter, response value expression, and response topic expression. Then, click “Add”. +In order to add new attribute update mapping, follow these steps: -![image](/images/gateway/mqtt-connector/attribute-updates-example-basic-1-ce.png) \ No newline at end of file +{% assign AttributesUpdate = ' + === + image: /images/gateway/mqtt-connector/mqtt-gateway-configuring-11-ce.png, + title: Click the "**Add mapping**" under "**Requests mapping**" section to add new attribute request mapping. + === + image: /images/gateway/mqtt-connector/mqtt-attribute-updates-1.png, + title: Select "**Attribute update**" in the **Request type** field, enter the "**Device name filter**" + === + image: /images/gateway/mqtt-connector/mqtt-attribute-updates-2.png, + title: Configure the **Attribute filter**, **Response value expression**, and **Response topic expression** fields. + You can also set the **Retain** option to determine whether the attribute response message should be retained by the MQTT broker. + ' +%} + +{% include images-gallery.liquid showListImageTitles="true" imageCollection=AttributesUpdate %} diff --git a/_includes/templates/iot-gateway/mqtt-connector/connect-request-subsection-advanced.md b/_includes/templates/iot-gateway/mqtt-connector/connect-request-subsection-advanced.md deleted file mode 100644 index 8fd8defc37..0000000000 --- a/_includes/templates/iot-gateway/mqtt-connector/connect-request-subsection-advanced.md +++ /dev/null @@ -1,47 +0,0 @@ -This section in configuration looks like: -```json -"connectRequests": [ - { - "topicFilter": "sensor/connect", - "deviceInfo": { - "deviceNameExpressionSource": "message", - "deviceNameExpression": "${serialNumber}", - "deviceProfileExpressionSource": "constant", - "deviceProfileExpression": "Thermometer" - } - } -] -``` -{: .copy-code} - -![image](/images/gateway/mqtt-connector/connect-request-example-1-ce.png) - -**Device name from the message body:** - -| **Parameter** | **Default value** | **Description** | -|:----------------------|:-------------------------------------|:---------------------------------------------------------------------------------------------| -| topicFilter | **sensor/connect** | Topic address on the broker, where the broker sends information about new connected devices. | -| deviceNameExpression | **${serialNumber}** | JSON-path expression, for looking the new device name. | -| --- - -In this case the following messages are valid: - -```bash -mosquitto_pub -h YOUR_MQTT_BROKER_HOST -p YOUR_MQTT_BROKER_PORT -t "sensor/connect" -m '{"serialNumber":"SN-001"}' -``` -{: .copy-code} - -**Device name from the topic:** - -| **Parameter** | **Default value** | **Description** | -|:--------------------------|:-------------------------------------|:---------------------------------------------------------------------------------------------| -| topicFilter | **sensor/+/connect** | Topic address on the broker, where the broker sends information about new connected devices. | -| deviceNameTopicExpression | **(?<=sensor\/)(.\*?)(?=\/connect)** | Regular expression for looking the device name in topic path. | -| --- - -In this case the following messages are valid: - -```bash -mosquitto_pub -h YOUR_MQTT_BROKER_HOST -p YOUR_MQTT_BROKER_PORT -t "sensor/SN-001/connect" -m '' -``` -{: .copy-code} \ No newline at end of file diff --git a/_includes/templates/iot-gateway/mqtt-connector/connect-request-subsection-basic.md b/_includes/templates/iot-gateway/mqtt-connector/connect-request-subsection-basic.md deleted file mode 100644 index 88355bad50..0000000000 --- a/_includes/templates/iot-gateway/mqtt-connector/connect-request-subsection-basic.md +++ /dev/null @@ -1,24 +0,0 @@ -To adding new requests mapping, navigate to the "Requests mapping" tab and click the "plus" icon. -In the open modal window, select the "Connect request" type, set a topic filter, and fill in the "Name" and "Profile name" fields of the "Device" section. Then, click "Add". - -**Device name from the message body:** - -![image](/images/gateway/mqtt-connector/connect-request-1-ce.png) - -In this case the following messages are valid: - -```bash -mosquitto_pub -h YOUR_MQTT_BROKER_HOST -p YOUR_MQTT_BROKER_PORT -t "sensor/connect" -m '{"serialNumber":"SN-001"}' -``` -{: .copy-code} - -**Device name from the topic:** - -![image](/images/gateway/mqtt-connector/connect-request-device-name-from-the-topic-1-ce.png) - -In this case the following messages are valid: - -```bash -mosquitto_pub -h YOUR_MQTT_BROKER_HOST -p YOUR_MQTT_BROKER_PORT -t "sensor/SN-001/connect" -m '' -``` -{: .copy-code} \ No newline at end of file diff --git a/_includes/templates/iot-gateway/mqtt-connector/connection-to-broker-advanced-section.md b/_includes/templates/iot-gateway/mqtt-connector/connection-to-broker-advanced-section.md deleted file mode 100644 index e45aab49cc..0000000000 --- a/_includes/templates/iot-gateway/mqtt-connector/connection-to-broker-advanced-section.md +++ /dev/null @@ -1,29 +0,0 @@ -This configuration section contains settings of the connection to broker, such as: - -| **Parameter** | **Default value** | **Description** | -|:--------------|:-------------------------|-------------------------------------------------------------------- -| name | **Default Local Broker** | Broker name for logs and saving to persistent devices. | -| host | **127.0.0.1** | MQTT broker hostname or ip address. | -| port | **1883** | MQTT port on the broker. | -| version | **5** | MQTT protocol version may be 3 (3.1), 4(3.11) or 5(5) | -| clientId | **tb_gw_li06e** | This is the client ID. It must be unique for each session. | -| security | **anonymous** | This is the configuration for client authorization at MQTT Broker. | -| --- - -Example: - -```json -"broker": { - "name": "Default Local Broker", - "host": "127.0.0.1", - "port": 1883, - "version": 5, - "clientId": "tb_gw_li06e", - "security": { - "type": "anonymous" - } -}, -``` -{: .copy-code} - -![image](/images/gateway/mqtt-connector/connection-to-broker-advanced-section-1-ce.png) \ No newline at end of file diff --git a/_includes/templates/iot-gateway/mqtt-connector/connection-to-broker-basic-section.md b/_includes/templates/iot-gateway/mqtt-connector/connection-to-broker-basic-section.md deleted file mode 100644 index b9efb48b2e..0000000000 --- a/_includes/templates/iot-gateway/mqtt-connector/connection-to-broker-basic-section.md +++ /dev/null @@ -1,9 +0,0 @@ -This configuration section contains settings of the connection to broker, such as: - -- Host - MQTT broker hostname or ip address; -- Port - MQTT port on the broker; -- MQTT version - MQTT protocol version; -- Client ID - this is the client ID. It must be unique for each session; -- Security - configuration for client authorization at MQTT Broker (anonymous, basic, or certificates). - -![image](/images/gateway/mqtt-connector/connection-to-broker-basic-section-1-ce.png) \ No newline at end of file diff --git a/_includes/templates/iot-gateway/mqtt-connector/data-conversion-bytes-config.md b/_includes/templates/iot-gateway/mqtt-connector/data-conversion-bytes-config.md deleted file mode 100644 index 9cf8e4dd15..0000000000 --- a/_includes/templates/iot-gateway/mqtt-connector/data-conversion-bytes-config.md +++ /dev/null @@ -1,60 +0,0 @@ -Bytes converter is the default converter, it looks for '**deviceName**', '**deviceType**', attributes and telemetry in the incoming -message from the broker, following the rules described in this subsection: - -| **Parameter** | **Default value** | **Description** | -|:------------------------|:------------------|------------------------------------------------------------------------------------------------------------------| -| type | **bytes** | Provides information to connector that default converter is to be used for converting data from topic. | -| deviceNameExpression | **[0:4]** | The expression that is used to find device name in the incoming message. | -| deviceProfileExpression | **[1:3]** | The expression that is used to find device type in the incoming message. | -| timeout | **60000** | Timeout for triggering "Device Disconnected" event. | -| attributes: | | This subsection contains parameters of the incoming message, to be interpreted as attributes for the device. | -| ... type | **raw** | Type of incoming data for a current attribute. | -| ... key | **temp** | Attribute name, to be sent to ThingsBoard instance. | -| ... value | **[:]** | Final view of data that will be sent to ThingsBoard, [:] - will replace to device data using python slice rules. | -| timeseries: | | This subsection contains parameters of the incoming message, to be interpreted as telemetry for the device. | -| ... type | **raw** | Type of incoming data for a current telemetry. | -| ... key | **rawData** | Telemetry name, to be sent to ThingsBoard instance. | -| ... value | **[4:]** | Final view of data that will be sent to ThingsBoard, [:] - will replace to device data using python slice rules. | -| --- - -{% capture difference %} -**Parameters in attributes and telemetry section may differ from those presented above, but will have the same structure.** -{% endcapture %} -{% include templates/info-banner.md content=difference %} - -**Note**: The device profile is set when the device is created. Changing the device profile using a Gateway is not supported. - -Mapping subsection will look like: -```json -{ - "topicFilter": "sensor/raw_data", - "subscriptionQos": 1, - "converter": { - "type": "bytes", - "deviceInfo": { - "deviceNameExpressionSource": "message", - "deviceNameExpression": "[0:4]", - "deviceProfileExpressionSource": "constant", - "deviceProfileExpression": "default" - }, - "sendDataOnlyOnChange": false, - "timeout": 60000, - "attributes": [ - { - "type": "raw", - "key": "rawData", - "value": "[:]" - } - ], - "timeseries": [ - { - "type": "raw", - "key": "temp", - "value": "[4:]" - } - ] - } -} -``` - -![image](/images/gateway/mqtt-connector/data-conversion-advanced-bytes-1-ce.png) \ No newline at end of file diff --git a/_includes/templates/iot-gateway/mqtt-connector/data-conversion-custom-config.md b/_includes/templates/iot-gateway/mqtt-connector/data-conversion-custom-config.md deleted file mode 100644 index b221a46e17..0000000000 --- a/_includes/templates/iot-gateway/mqtt-connector/data-conversion-custom-config.md +++ /dev/null @@ -1,35 +0,0 @@ -A custom converter is converter written for some device: - -| **Parameter** | **Default value** | **Description** | -|:------------------|:------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| type | **custom** | Provides information to connector that a custom converter will be used for converting data from the topic. | -| extension | **CustomMqttUplinkConverter** | Name of custom converter class. | -| extension-config | | This subsection is a configuration for the custom converter. In default example it contains the number of bytes and keys for telemetry. | -| temperatureBytes | **2** | In the default example, first 2 bytes from received message will be interpreted as **temperature** key of telemetry (Substring "Bytes" will remove if exists). | -| humidityBytes | **2** | In the default example, the second and third byte from received message will be interpreted as **humidity** key of telemetry (Substring "Bytes" will remove if exists). | -| batteryLevelBytes | **1** | In the default example, the fifth byte from received message will be interpreted as **batteryLevel** key of telemetry (Substring "Bytes" will removed if exists). | -| --- - -{% capture difference %} -**All parameters from this subsection and topic will be transferred as dictionary during initialization to the converter object.** -{% endcapture %} -{% include templates/info-banner.md content=difference %} - - -Converter subsection in the configuration will look like: -```json -"topicFilter": "custom/sensors/+", - "subscriptionQos": 1, - "converter": { - "type": "custom", - "extension": "CustomMqttUplinkConverter", - "cached": true, - "extensionConfig": { - "temperature": 2, - "humidity": 2, - "batteryLevel": 1 - } - } -``` - -![image](/images/gateway/mqtt-connector/data-conversion-advanced-custom-1-ce.png) \ No newline at end of file diff --git a/_includes/templates/iot-gateway/mqtt-connector/data-conversion-json-config.md b/_includes/templates/iot-gateway/mqtt-connector/data-conversion-json-config.md deleted file mode 100644 index f533f3b565..0000000000 --- a/_includes/templates/iot-gateway/mqtt-connector/data-conversion-json-config.md +++ /dev/null @@ -1,140 +0,0 @@ -Json converter is the default converter, it looks for '**deviceName**', '**deviceType**', attributes and telemetry in -the incoming message from the broker, following the rules described in this subsection: - -| **Parameter** | **Default value** | **Description** | -|:------------------------|:----------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| type | **json** | Provides information to connector that default converter is to be used for converting data from topic. | -| deviceNameExpression | **${serialNumber}** | Simple JSON expression, is used for looking up device name in the incoming message (parameter "serialNumber" will be used as the device name). | -| deviceProfileExpression | **${sensorType}** | Simple JSON expression, is used for looking up device type in the incoming message (parameter "sensorType" will be used as the device type). | -| timeout | **60000** | Timeout for triggering "Device Disconnected" event | -| attributes: | | This subsection contains parameters of the incoming message, to be interpreted as attributes for the device. | -| ... type | **string** | Type of incoming data for a current attribute. | -| ... key | **model** | Attribute name, to be sent to ThingsBoard instance. | -| ... value | **${sensorModel}** | Simple JSON expression, is used for looking up value in the incoming message, to be sent to ThingsBoard instance as the value of key parameter. | -| | | | -| ... type | **string** | Type of incoming data for a current attribute. | -| ... key | **${sensorModel}** | Simple JSON expression, is used for looking up value in the incoming message, to be used as attribute name. | -| ... value | **on** | Attribute value, to be sent to ThingsBoard instance. | -| timeseries: | | This subsection contains parameters of the incoming message, to be interpreted as telemetry for the device. | -| ... type | **integer** | Type of incoming data for a current telemetry. | -| ... key | **temperature** | Telemetry name, to be sent to ThingsBoard instance. | -| ... value | **${temp}** | Simple JSON expression, is used for looking up value in the incoming message, to be sent to ThingsBoard instance as the value of key parameter. | -| | | | -| ... type | **integer** | Type of incoming data for a current telemetry. | -| ... key | **humidity** | Telemetry name, to be sent to ThingsBoard instance. | -| ... value | **${hum}** | Simple JSON expression, is used for looking up value in the incoming message, to be sent to ThingsBoard instance as the value of key parameter. | -| ... tsField | **${timestampField}** | **Optional.** JSON-path expression for field that carries a datetime string. If not present, the `ts` or `timestamp` properties from incoming message will be used as timestamp for data entry. | -| ... dayfirst | **false** | **Optional.** Points out that the first number is the **day** (`DD.MM.YY HH:mm:ss.SSS`).
• `false` → `10.11.24 10:10:10.252` → **11 Oct 2024 10:10:10.252**
• `true` → `10.11.24 10:10:10.252` → **10 Nov 2024 10:10:10.252** | -| ... yearfirst | **false** | **Optional.** Points out that the first number is the **year** (`DD.MM.YY HH:mm:ss.SSS`).
• `false` → follows `dayfirst` rule
• `true` → `10.11.24 10:10:10.252` → **24 Nov 2010 10:10:10.252** | -| --- - -{% capture difference %} -**Parameters in attributes and telemetry section may differ from those presented above, but will follow the same -structure.** -{% endcapture %} -{% include templates/info-banner.md content=difference %} - -{% capture difference %} -**Note**: The device profile is set when the device is created. Changing the device profile using a Gateway is not -supported. -{% endcapture %} -{% include templates/info-banner.md content=difference %} - -**Mapping subsection for Example 1 will look like:** - -```json -{ - "topicFilter": "sensor/data", - "subscriptionQos": 1, - "converter": { - "type": "json", - "deviceInfo": { - "deviceNameExpressionSource": "message", - "deviceNameExpression": "${serialNumber}", - "deviceProfileExpressionSource": "message", - "deviceProfileExpression": "${sensorType}" - }, - "sendDataOnlyOnChange": false, - "timeout": 60000, - "attributes": [ - { - "type": "string", - "key": "model", - "value": "${sensorModel}" - }, - { - "type": "string", - "key": "${sensorModel}", - "value": "on" - } - ], - "timeseries": [ - { - "type": "string", - "key": "temperature", - "value": "${temp}" - }, - { - "type": "double", - "key": "humidity", - "value": "${hum}", - "tsField": "${timestampField}", - "dayfirst": true - }, - { - "type": "string", - "key": "combine", - "value": "${hum}:${temp}" - } - ] - } -} -``` - -![image](/images/gateway/mqtt-connector/data-conversion-advanced-json-1-ce.png) - -{% capture tsField %} -**Note**: In **Example 1** configuration section for `humidity` timeseries key illustrates how to use the `tsField` and -`dayfirst` options. -{% endcapture %} -{% include templates/info-banner.md content=tsField %} - -**Mapping for Example 2 will look like:** - -```json -"topicFilter": "sensor/+/data", - "subscriptionQos": 1, - "converter": { - "type": "json", - "deviceInfo": { - "deviceNameExpressionSource": "topic", - "deviceNameExpression": "(?<=sensor/)(.*?)(?=/data)", - "deviceProfileExpressionSource": "constant", - "deviceProfileExpression": "Thermometer" - }, - "sendDataOnlyOnChange": false, - "timeout": 60000, - "attributes": [ - { - "type": "string", - "key": "model", - "value": "${sensorModel}" - } - ], - "timeseries": [ - { - "type": "double", - "key": "temperature", - "value": "${temp}" - }, - { - "type": "string", - "key": "humidity", - "value": "${hum}" - } - ] - } -} -``` - -![image](/images/gateway/mqtt-connector/data-conversion-advanced-json-2-ce.png) \ No newline at end of file diff --git a/_includes/templates/iot-gateway/mqtt-connector/data-conversion-subsection-advanced.md b/_includes/templates/iot-gateway/mqtt-connector/data-conversion-subsection-advanced.md deleted file mode 100644 index 51416f2c39..0000000000 --- a/_includes/templates/iot-gateway/mqtt-connector/data-conversion-subsection-advanced.md +++ /dev/null @@ -1,59 +0,0 @@ -Now select the payload type: - -{% capture mqttconvertertypespec %} -JSONRecommended if json will be received in response%,%json%,%templates/iot-gateway/mqtt-connector/data-conversion-json-config.md%br% -BytesRecommended if bytes will be received in response%,%bytes%,%templates/iot-gateway/mqtt-connector/data-conversion-bytes-config.md%br% -CustomRecommended if bytes or anything else will be received in response%,%custom%,%templates/iot-gateway/mqtt-connector/data-conversion-custom-config.md{% endcapture %} - -{% include content-toggle.liquid content-toggle-id="MqttConverterTypeConfig" toggle-spec=mqttconvertertypespec %} - -{% capture difference %} -**Note**: You can specify multiple mapping objects inside the array.{% endcapture %} -{% include templates/info-banner.md content=difference %} - -Also, you can combine values from MQTT message in attributes, telemetry and serverSideRpc section, for example: -{% highlight json %} -{ - { - "topicFilter": "sensor/data", - "subscriptionQos": 1, - "converter": { - "type": "json", - "deviceInfo": { - "deviceNameExpressionSource": "message", - "deviceNameExpression": "${serialNumber}", - "deviceProfileExpressionSource": "message", - "deviceProfileExpression": "${sensorType}" - "timeout": 60000, - "attributes": [], - "timeseries": [ - { - "type": "integer", - "key": "temperature", - "value": "${temp}" - }, - { - "type": "integer", - "key": "humidity", - "value": "${hum}" - }, - { - "type": "string", - "key": "combine", - "value": "${hum}:${temp}" - } - ] - } - } -} -{% endhighlight %} - -Mapping process subscribes to the MQTT topics using **topicFilter** parameter of the mapping object. -Each message that is published to this topic by other devices or applications is analyzed to extract device name, type and data (attributes and/or timeseries values). -By default, gateway uses Json converter, but it is possible to provide custom converter. See examples in the source code. - -{% capture difference %} -**Connector won't pass the '**None**' value from the converter** -{% endcapture %} -{% include templates/info-banner.md content=difference %} - diff --git a/_includes/templates/iot-gateway/mqtt-connector/data-conversion-subsection-basic.md b/_includes/templates/iot-gateway/mqtt-connector/data-conversion-subsection-basic.md deleted file mode 100644 index 8f7d010174..0000000000 --- a/_includes/templates/iot-gateway/mqtt-connector/data-conversion-subsection-basic.md +++ /dev/null @@ -1,8 +0,0 @@ -Now select the payload type: - -{% capture mqttconnectordataconversionsubsection %} -JSONRecommended if json will be received in response%,%json%,%templates/iot-gateway/mqtt-connector/data-conversion-subsection-json.md%br% -BytesRecommended if bytes will be received in response%,%bytes%,%templates/iot-gateway/mqtt-connector/data-conversion-subsection-bytes.md%br% -CustomRecommended if bytes or anything else will be received in response%,%custom%,%templates/iot-gateway/mqtt-connector/data-conversion-subsection-custom.md{% endcapture %} - -{% include content-toggle.liquid content-toggle-id="mqttconnectordataconversionsubsection" toggle-spec=mqttconnectordataconversionsubsection %} \ No newline at end of file diff --git a/_includes/templates/iot-gateway/mqtt-connector/data-conversion-subsection-bytes.md b/_includes/templates/iot-gateway/mqtt-connector/data-conversion-subsection-bytes.md deleted file mode 100644 index 450213f364..0000000000 --- a/_includes/templates/iot-gateway/mqtt-connector/data-conversion-subsection-bytes.md +++ /dev/null @@ -1,22 +0,0 @@ -Converter for this payload type designed for binary MQTT payloads, this converter directly interprets binary data to retrieve device names and device profile names, along with attributes and time series, using specific byte positions for data extraction. - -{% assign dataConversionBasicBytesSubsection = ' - === - image: /images/gateway/mqtt-connector/data-conversion-basic-bytes-subsection-1-ce.png, - title: Select "Bytes" payload type, and fill in the fields in the "Device" section. Then click "pencil" icon of the "Attributes" section to add new attribute key; - === - image: /images/gateway/mqtt-connector/data-conversion-basic-bytes-subsection-2-ce.png, - title: In the opened window click "Add attribute". Enter the key name, select the type and enter the value of the key. Click "Apply"; - === - image: /images/gateway/mqtt-connector/data-conversion-basic-bytes-subsection-3-ce.png, - title: Now click on the "pencil" icon of the "Time series" section to add new time series key; - === - image: /images/gateway/mqtt-connector/data-conversion-basic-bytes-subsection-4-ce.png, - title: In the opened window click "Add time series". Enter the key name, select the type and enter the value of the key. Click "Apply"; - === - image: /images/gateway/mqtt-connector/data-conversion-basic-bytes-subsection-5-ce.png, - title: Click "Add". -' -%} - -{% include images-gallery.liquid showListImageTitles="true" imageCollection=dataConversionBasicBytesSubsection %} \ No newline at end of file diff --git a/_includes/templates/iot-gateway/mqtt-connector/data-conversion-subsection-custom.md b/_includes/templates/iot-gateway/mqtt-connector/data-conversion-subsection-custom.md deleted file mode 100644 index 90f7fac16f..0000000000 --- a/_includes/templates/iot-gateway/mqtt-connector/data-conversion-subsection-custom.md +++ /dev/null @@ -1,18 +0,0 @@ -This option allows you to use a custom converter for specific data tasks. -You need to add your custom converter to the extension folder and enter its class name in the UI settings. -Any keys you provide will be sent as configuration to your custom converter. - -{% assign dataConversionBasicCustomSubsection = ' - === - image: /images/gateway/mqtt-connector/data-conversion-basic-custom-subsection-1-ce.png, - title: Select "Custom" payload type, and fill in the fields in the "Device" section. Then click "pencil" icon of the "Keys" section to add new key; - === - image: /images/gateway/mqtt-connector/data-conversion-basic-custom-subsection-2-ce.png - title: In the opened window click "Add key". Enter the key name and its value. Click "Apply"; - === - image: /images/gateway/mqtt-connector/data-conversion-basic-custom-subsection-3-ce.png - title: Click "Add". -' -%} - -{% include images-gallery.liquid showListImageTitles="true" imageCollection=dataConversionBasicCustomSubsection %} \ No newline at end of file diff --git a/_includes/templates/iot-gateway/mqtt-connector/data-conversion-subsection-json.md b/_includes/templates/iot-gateway/mqtt-connector/data-conversion-subsection-json.md deleted file mode 100644 index b6ca5e3193..0000000000 --- a/_includes/templates/iot-gateway/mqtt-connector/data-conversion-subsection-json.md +++ /dev/null @@ -1,24 +0,0 @@ -Converter for this payload type processes MQTT messages in JSON format. -It uses JSON Path expressions to extract vital details such as device names, device profile names, attributes, and time series from the message. -And regular expressions to get device details from topics. - -{% assign dataConversionBasicJsonSubsection = ' - === - image: /images/gateway/mqtt-connector/data-conversion-basic-json-subsection-1-ce.png, - title: Select "JSON" payload type, and fill in the fields in the "Device" section. Then click "pencil" icon of the "Attributes" section to add new attribute key; - === - image: /images/gateway/mqtt-connector/data-conversion-basic-json-subsection-2-ce.png, - title: In the opened window click "Add attribute". Enter the key name, select the type and enter the value of the key. Click "Apply"; - === - image: /images/gateway/mqtt-connector/data-conversion-basic-json-subsection-3-ce.png, - title: Now click on the "pencil" icon of the "Time series" section to add new time series key; - === - image: /images/gateway/mqtt-connector/data-conversion-basic-json-subsection-4-ce.png, - title: In the opened window click "Add time series". Enter the key name, select the type and enter the value of the key. Click "Apply"; - === - image: /images/gateway/mqtt-connector/data-conversion-basic-json-subsection-5-ce.png, - title: Click "Add". -' -%} - -{% include images-gallery.liquid showListImageTitles="true" imageCollection=dataConversionBasicJsonSubsection %} \ No newline at end of file diff --git a/_includes/templates/iot-gateway/mqtt-connector/data-mapping-subsection-advanced.md b/_includes/templates/iot-gateway/mqtt-connector/data-mapping-subsection-advanced.md deleted file mode 100644 index 25f1e43de5..0000000000 --- a/_includes/templates/iot-gateway/mqtt-connector/data-mapping-subsection-advanced.md +++ /dev/null @@ -1,13 +0,0 @@ -| **Parameter** | **Default value** | **Description** | -|:---------------|:------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| topicFilter | **sensor/data** | Topic address for subscribing. | -| QoS | **1** | An agreement between the message sender and receiver that defines the level of delivery guarantee for a specific message. (0-At most once, 1-At least once, 2-Exactly once) | -| --- - -The **topicFilter** supports special symbols: '#' and '+', allowing to subscribe to multiple topics. - -Also, MQTT connector supports shared subscriptions. -To create shared subscription you need to add "**$share/**" as a prefix for topic filter and shared subscription group name. -For example to subscribe to the *my-shared-topic* in group ***my-group-name*** you can set the topic filter to "$share/***my-group-name***/*my-shared-topic*". - -![image](/images/gateway/mqtt-connector/data-mapping-advanced-section-1-ce.png) \ No newline at end of file diff --git a/_includes/templates/iot-gateway/mqtt-connector/data-mapping-subsection-basic.md b/_includes/templates/iot-gateway/mqtt-connector/data-mapping-subsection-basic.md deleted file mode 100644 index fbdd0eebcc..0000000000 --- a/_includes/templates/iot-gateway/mqtt-connector/data-mapping-subsection-basic.md +++ /dev/null @@ -1,15 +0,0 @@ -For adding new data mapping, click the "plus" icon: - -![image](/images/gateway/mqtt-connector/data-mapping-basic-section-1-ce.png) - -Opened modal window provide the following fields: topic filter, QoS, payload type: - -![image](/images/gateway/mqtt-connector/data-mapping-basic-section-2-ce.png) - -The **Topic filter** - topic address for subscribing. The **Topic filter** supports special symbols: '#' and '+', allowing to subscribe to multiple topics. - -Also, MQTT connector supports shared subscriptions. -To create shared subscription you need to add "**$share/**" as a prefix for topic filter and shared subscription group name. -For example to subscribe to the *my-shared-topic* in group ***my-group-name*** you can set the topic filter to "$share/***my-group-name***/*my-shared-topic*". - -**MQTT Quality of Service** (QoS) is an agreement between the message sender and receiver that defines the level of delivery guarantee for a specific message. (0-At most once, 1-At least once, 2-Exactly once) \ No newline at end of file diff --git a/_includes/templates/iot-gateway/mqtt-connector/device-connect-request-basic-section.md b/_includes/templates/iot-gateway/mqtt-connector/device-connect-request-basic-section.md new file mode 100644 index 0000000000..852ae60401 --- /dev/null +++ b/_includes/templates/iot-gateway/mqtt-connector/device-connect-request-basic-section.md @@ -0,0 +1,15 @@ +In order to add new connect request mapping, follow these steps: + +{% assign ConnectRequest = ' + === + image: /images/gateway/mqtt-connector/mqtt-gateway-configuring-11-ce.png, + title: Click the “**Add mapping**” under “**Requests mapping**” section to add new connect request mapping. + === + image: /images/gateway/mqtt-connector/mqtt-gateway-configuring-12-ce.png, + title: Select "**Connect request**" in the **Request type** field, enter the "**Topic filter**", and select source + type for **Name** and **Profile name** fields (`Message`, `Constant`, or `Topic`). Enter the corresponding + value which can be [json path](/docs/iot-gateway/config/mqtt/#json-path), [regex](/docs/iot-gateway/config/mqtt/#regular-expressions), or constant value based on the selected source type. + ' +%} + +{% include images-gallery.liquid showListImageTitles="true" imageCollection=ConnectRequest %} diff --git a/_includes/templates/iot-gateway/mqtt-connector/device-rpc-basic-section.md b/_includes/templates/iot-gateway/mqtt-connector/device-rpc-basic-section.md new file mode 100644 index 0000000000..fe678d3b0b --- /dev/null +++ b/_includes/templates/iot-gateway/mqtt-connector/device-rpc-basic-section.md @@ -0,0 +1,19 @@ +In order to add a new RPC method, follow these steps: + +{% assign creatingRPC = ' + === + image: /images/gateway/mqtt-connector/mqtt-gateway-configuring-11-ce.png, + title: Click the "**Add mapping**" under "**Requests mapping**" section to add new server side rpc command. + === + image: /images/gateway/mqtt-connector/mqtt-rpc-overview-1.png, + title: Choose the "**Request type**": `With response` or `Without response`. + === + image: /images/gateway/mqtt-connector/mqtt-rpc-overview-3.png, + title: Fill in the required fields - "**Device name filter**", "**Method filter**", "**Request topic expression**", and "**Value expression**". + === + image: /images/gateway/mqtt-connector/mqtt-rpc-overview-2.png, + title: For two-way RPC, also configure "**Response topic expression**", "**Response topic QoS**", and "**Response timeout**". Click "**Add**" when done. + ' +%} + +{% include images-gallery.liquid showListImageTitles="true" imageCollection=creatingRPC %} \ No newline at end of file diff --git a/_includes/templates/iot-gateway/mqtt-connector/disconnect-request-subsection-advanced.md b/_includes/templates/iot-gateway/mqtt-connector/disconnect-request-subsection-advanced.md deleted file mode 100644 index 8ac9da378b..0000000000 --- a/_includes/templates/iot-gateway/mqtt-connector/disconnect-request-subsection-advanced.md +++ /dev/null @@ -1,53 +0,0 @@ -This section in configuration file looks like: - -```json -"disconnectRequests": [ - { - "topicFilter": "sensor/disconnect", - "deviceInfo": { - "deviceNameExpressionSource": "message", - "deviceNameExpression": "${serialNumber}" - } -}, - { - "topicFilter": "sensor/+/disconnect", - "deviceInfo": { - "deviceNameExpressionSource": "topic", - "deviceNameExpression": "(?<=sensor/)(.*?)(?=/connect)" - } - } -] -``` -{: .copy-code} - -![image](/images/gateway/mqtt-connector/disconnect-request-example-1-ce.png) - -**Name in a message from broker:** - -| **Parameter** | **Default value** | **Description** | -|:-|:-------------------------------------|- -| topicFilter | **sensor/disconnect** | Topic address on the broker, where the broker sends information about disconnected devices. | -| deviceNameExpression | **${serialNumber}** | JSON-path expression, for looking the new device name. | -|--- - -In this case the following messages are valid: - -```bash -mosquitto_pub -h YOUR_MQTT_BROKER_HOST -p YOUR_MQTT_BROKER_PORT -t "sensor/disconnect" -m '{"serialNumber":"SN-001"}' -``` -{: .copy-code} - -**Name in topic address:** - -| **Parameter** | **Default value** | **Description** | -|:-|:-------------------------------------|- -| topicFilter | **sensor/+/disconnect** | Topic address on the broker, where the broker sends information about disconnected devices. | -| deviceNameTopicExpression | **(?<=sensor\/)(.\*?)(?=\/connect)** | Regular expression for looking the device name in topic path. | -|--- - -In this case the following messages are valid: - -```bash -mosquitto_pub -h YOUR_MQTT_BROKER_HOST -p YOUR_MQTT_BROKER_PORT -t "sensor/SN-001/disconnect" -m '' -``` -{: .copy-code} \ No newline at end of file diff --git a/_includes/templates/iot-gateway/mqtt-connector/disconnect-request-subsection-basic.md b/_includes/templates/iot-gateway/mqtt-connector/disconnect-request-subsection-basic.md index df42cb1aca..754607b12a 100644 --- a/_includes/templates/iot-gateway/mqtt-connector/disconnect-request-subsection-basic.md +++ b/_includes/templates/iot-gateway/mqtt-connector/disconnect-request-subsection-basic.md @@ -1,24 +1,15 @@ -To adding new requests mapping, navigate to the "Requests mapping" tab and click the "plus" icon. -In the open modal window, select the "Disconnect request" type, set a topic filter, and fill in the "Name" field of the "Device" section. Then, click "Add". - -**Name in a message from broker:** - -![image](/images/gateway/mqtt-connector/disconnect-request-1-ce.png) - -In this case the following messages are valid: - -```bash -mosquitto_pub -h YOUR_MQTT_BROKER_HOST -p YOUR_MQTT_BROKER_PORT -t "sensor/disconnect" -m '{"serialNumber":"SN-001"}' -``` -{: .copy-code} - -**Name in topic address:** - -![image](/images/gateway/mqtt-connector/disconnect-request-2-ce.png) - -In this case the following messages are valid: - -```bash -mosquitto_pub -h YOUR_MQTT_BROKER_HOST -p YOUR_MQTT_BROKER_PORT -t "sensor/SN-001/disconnect" -m '' -``` -{: .copy-code} \ No newline at end of file +In order to add new disconnect request mapping, follow these steps: + +{% assign DisconnectRequest = ' + === + image: /images/gateway/mqtt-connector/mqtt-gateway-configuring-11-ce.png, + title: Click the "**Add mapping**" under "**Requests mapping**" section to add new disconnect request mapping. + === + image: /images/gateway/mqtt-connector/mqtt-gateway-disconnect-configuring-12-ce.png, + title: Select "**Disconnect request**" in the **Request type** field, enter the "**Topic filter**", and select source + type for **Name** field (`Message`, `Topic`, or `Constant`). Enter the corresponding + value which can be [json path](/docs/iot-gateway/config/mqtt/#json-path), [regex](/docs/iot-gateway/config/mqtt/#regular-expressions), or constant value based on the selected source type. + ' +%} + +{% include images-gallery.liquid showListImageTitles="true" imageCollection=DisconnectRequest %} diff --git a/_includes/templates/iot-gateway/mqtt-connector/examples/request-mapping/attribute-request.md b/_includes/templates/iot-gateway/mqtt-connector/examples/request-mapping/attribute-request.md new file mode 100644 index 0000000000..de507104f7 --- /dev/null +++ b/_includes/templates/iot-gateway/mqtt-connector/examples/request-mapping/attribute-request.md @@ -0,0 +1,161 @@ +For an Attribute request, the gateway must know which device name to target and which attribute to request. You can extract the device name either from the `Message` payload using [json-path](/docs/iot-gateway/config/mqtt/#json-path) +or from the topic using a [regex](/docs/iot-gateway/config/mqtt/#regular-expressions). Choose [json-path](/docs/iot-gateway/config/mqtt/#json-path) when the device name is inside the JSON message; choose [regex](/docs/iot-gateway/config/mqtt/#regular-expressions) when it's encoded in the topic. + +Suppose you want to retrieve the current firmware version for device `SN-001` from ThingsBoard to make decisions based on the firmware version. + +{% capture difference %} +**Please note:** +An **Attribute request** allows a device to retrieve attribute values from ThingsBoard. This is useful for: +- Getting configuration parameters stored as shared attributes +- Retrieving client attributes that were previously reported +- Implementing device configuration management + +The gateway acts as a bridge, receiving the attribute request from the device, fetching the attribute from ThingsBoard, and delivering the response back to the device. +{% endcapture %} +{% include templates/info-banner.md content=difference %} + +Let's configure an Attribute request in the MQTT connector to allow devices to request attribute values from ThingsBoard. +We'll demonstrate two ways to extract the device name: + +- From message (`JSON` payload). +- From topic (e.g., `sensor/SN-001/attributes/request`). + +Follow these steps: + +{% assign deviceNameAttributeJson = ' + === + image: /images/gateway/mqtt-connector/examples/device-name-and-profile-message-json-1.png, + title: Go to "**Entities**" - "**Gateways**" on the left sidebar and select your gateway. + === + image: /images/gateway/mqtt-connector/examples/disconnect-request-gateway.png, + title: Click on the "**Connectors configuration**" button on the right side menu. + === + image: /images/gateway/mqtt-connector/examples/mqtt-gateway-configuring-11-ce.png, + title: Select the MQTT connector, click on the "**Basic**". Click the "**Add mapping**" under "**Requests mapping**" section to add new attribute request mapping. + === + image: /images/gateway/mqtt-connector/examples/attribute-request-1.png, + title: Select "**Attribute request**" in the **Request type** field, enter the "**Topic filter**" as `v1/devices/me/attributes/request`. + === + image: /images/gateway/mqtt-connector/examples/attribute-request-2.png, + title: Configure the device name and attribute settings. For device name expression, select source type as `Message` and enter `${serialNumber}` as the value. For attribute name expression, select source type as `Message` and enter `${versionAttribute}, ${pduAttribute}` as the value. + === + image: /images/gateway/mqtt-connector/examples/attribute-request-3.png, + title: Configure the response topic as `devices/${deviceName}/attrs` and the response value expression as `${attributeKey}: ${attributeValue}`. + === + image: /images/gateway/mqtt-connector/examples/attribute-request-4.png, + title: Remember to save your changes by clicking the designated button. + ' +%} + +{% include images-gallery.liquid showListImageTitles="true" imageCollection=deviceNameAttributeJson %} + +Let's demonstrate how to use these attribute request configurations with two examples: + +### Example 1: Device name and attribute from message payload + +Suppose we have a device with an attribute `firmwareVersion` stored as a shared attribute in ThingsBoard and suppose we want to request this attribute +for some purposes. + +Let's add this attribute to the device `SN-001` in ThingsBoard first: + +1. Go to "**Devices**" → select device `SN-001` - "**Attributes**" tab - select "**Shared attributes**". + +2. Then click on the "**+**" icon and add `firmwareVersion` attribute with type "**String**" and set it to `1.2.3` click the "**Add**" button. + +![image](/images/gateway/mqtt-connector/examples/result-device-overview-attribute-requests-1.png) + +This message contains the device name in the JSON payload, which is extracted using the `${serialNumber}` JSON path, and the attribute name using the `${attributeNames}` JSON path. After processing this message, ThingsBoard will retrieve the "firmwareVersion" attribute for device "SN-001" and publish it to the response topic. + +The response will be published to the topic `devices/SN-001/attrs` with a payload like: Let's subscribe to the response topic to see the result: +Open terminal and type the following command and press Enter: + +```bash +mosquitto_sub -h 127.0.0.1 -p 1884 -t devices/SN-001/attrs +``` +{: .copy-code} + +Open another terminal to simulate sending a message from the device to the MQTT broker with the device name and attribute name in the JSON payload: + +```bash +mosquitto_pub -h 127.0.0.1 -p 1884 -t v1/devices/me/attributes/request -m '{"serialNumber": "SN-001", "versionAttribute": "firmwareVersion"}' +``` +{: .copy-code} + +This message contains the device name in the JSON payload, which is extracted using the `${serialNumber}` JSON path, +and the attribute name using the `${attributeNames}` JSON path. After processing this message, ThingsBoard will retrieve the `firmwareVersion` attribute for device `SN-001` and publish it to the response topic.) + +![image](/images/gateway/mqtt-connector/examples/result-device-overview-attribute-requests-2.png) + +```bash +firmwareVersion: "1.2.3" +``` + +![image](/images/gateway/mqtt-connector/examples/result-device-overview-attribute-requests-3.png) + + + +If you are using advanced configuration mode, you can +use the following configuration: + +```json +{ + "broker": { + "host": "127.0.0.1", + "port": 1884, + "clientId": "ThingsBoard_gateway", + "version": 5, + "maxMessageNumberPerWorker": 10, + "maxNumberOfWorkers": 100, + "keepAlive": 60, + "cleanSession": true, + "cleanStart": true, + "sessionExpiryInterval": 0, + "security": { + "type": "anonymous" + } + }, + "mapping": [ + { + "topicFilter": "sensor/data", + "subscriptionQos": 1, + "converter": { + "type": "json", + "deviceInfo": { + "deviceNameExpressionSource": "message", + "deviceNameExpression": "${serialNumber}", + "deviceProfileExpressionSource": "message", + "deviceProfileExpression": "${sensorType}" + }, + "timeout": 60000, + "attributes": [ + + ], + "timeseries": [ + { + "type": "string", + "key": "temperature", + "value": "${temp}" + } + ] + } + } + ], + "requestsMapping": { + "attributeRequests": [ + { + "retain": false, + "topicFilter": "v1/devices/me/attributes/request", + "deviceInfo": { + "deviceNameExpressionSource": "message", + "deviceNameExpression": "${serialNumber}" + }, + "attributeNameExpressionSource": "message", + "attributeNameExpression": "${attributeNames}", + "topicExpression": "v1/devices/${deviceName}/attributes/response", + "valueExpression": "{\"${attributeKey}\": \"${attributeValue}\"}" + } + ] + } +} +``` +{:.copy-code.expandable-15} \ No newline at end of file diff --git a/_includes/templates/iot-gateway/mqtt-connector/examples/request-mapping/attribute-update.md b/_includes/templates/iot-gateway/mqtt-connector/examples/request-mapping/attribute-update.md new file mode 100644 index 0000000000..8943c2a6a7 --- /dev/null +++ b/_includes/templates/iot-gateway/mqtt-connector/examples/request-mapping/attribute-update.md @@ -0,0 +1,135 @@ +For Attribute updates, the gateway needs to know which devices should receive updates for which attributes. You configure this using regular expressions for both device names and attribute names. When an attribute is updated in ThingsBoard, the gateway publishes the new value to a configured MQTT topic. + +Suppose you want ThingsBoard to automatically push firmware version updates to your devices. When you update the `firmwareVersion` shared attribute in ThingsBoard, the gateway should publish this update to a topic that your devices are subscribed to. + +{% capture difference %} +**Please note:** +**Attribute updates** allow ThingsBoard to push shared attribute changes to devices. This is useful for: +- Remotely configuring devices +- Pushing firmware/software version information +- Sending operational parameters to devices +- Implementing device configuration management + +The gateway acts as a bridge, detecting attribute changes in ThingsBoard and publishing them to MQTT topics that devices can subscribe to. +{% endcapture %} +{% include templates/info-banner.md content=difference %} + +Let's configure Attribute updates in the MQTT connector to allow ThingsBoard to push attribute changes to devices. + +Follow these steps: + +{% assign AttributesUpdate = ' + === + image: /images/gateway/mqtt-connector/examples/device-name-and-profile-message-json-1.png, + title: Go to "**Entities**" - "**Gateways**" in the left sidebar and select your gateway. + === + image: /images/gateway/mqtt-connector/examples/disconnect-request-gateway.png, + title: Click on the "**Connectors configuration**" button on the right side menu. + === + image: /images/gateway/mqtt-connector/examples/mqtt-gateway-configuring-11-ce.png, + title: Select the MQTT connector, click on the "**Basic**". Click the "**Add mapping**" under "**Requests mapping**" section to add new attribute update mapping. + === + image: /images/gateway/mqtt-connector/examples/attribute-updates-1.png, + title: Select "**Attribute update**" in the **Request type** field, enter the "**Device name filter**" as `.*` to match all devices, or use a specific pattern to match only certain devices). + === + image: /images/gateway/mqtt-connector/examples/attribute-updates-2.png, + title: Configure the **Attribute filter** as `firmwareVersion` to only update this specific attribute. Set the **Response topic expression** to `sensor/${deviceName}/${attributeKey}` and the **Response value expression** to `{"${attributeKey}":"${attributeValue}"}`. You can also set the **Retain** option to determine whether the attribute update message should be retained by the MQTT broker. + === + image: /images/gateway/mqtt-connector/examples/attribute-updates-3.png, + title: Remember to save your changes by clicking the designated button. + === + image: /images/gateway/mqtt-connector/examples/result-device-overview-attribute-updates-1.png, + title: Go to "**Devices**" - select device `SN-001` - "**Attributes**" tab - select "**Shared attributes**" + === + image: /images/gateway/mqtt-connector/examples/result-device-overview-attribute-updates-2.png, + title: Add the `firmwareVersion` attribute with type "**String**" and set its value to "1.2.3". + === + image: /images/gateway/mqtt-connector/examples/result-device-overview-attribute-updates-3.png, + title: Find the `firmwareVersion` attribute and click the pencil icon to edit it. + ' +%} + +{% include images-gallery.liquid showListImageTitles="true" imageCollection=AttributesUpdate %} + +Let's demonstrate how to use this attribute update configuration: + +### Example: Updating a device attribute in ThingsBoard + +1. First, let's subscribe to the topic where attribute updates will be published: + +```bash +mosquitto_sub -h 127.0.0.1 -p 1884 -t sensor/SN-001/firmwareVersion +``` +{: .copy-code} + +2. After updating the attribute in ThingsBoard, the gateway will detect the change and publish a message to the configured topic: + +```json +{"firmwareVersion":"1.2.4"} +``` + +![image](/images/gateway/mqtt-connector/examples/result-device-overview-attribute-updates-4.png) + +This message will be received by any device subscribed to the topic `sensor/SN-001/firmwareVersion`. + +![image](/images/gateway/mqtt-connector/examples/result-device-overview-attribute-updates-5.png) + +If you are using advanced configuration mode, you can use the following configuration: + +```json +{ + "broker": { + "host": "127.0.0.1", + "port": 1884, + "clientId": "ThingsBoard_gateway", + "version": 5, + "maxMessageNumberPerWorker": 10, + "maxNumberOfWorkers": 100, + "keepAlive": 60, + "cleanSession": true, + "cleanStart": true, + "sessionExpiryInterval": 0, + "security": { + "type": "anonymous" + } + }, + "mapping": [ + { + "topicFilter": "sensor/data", + "subscriptionQos": 1, + "converter": { + "type": "json", + "deviceInfo": { + "deviceNameExpressionSource": "message", + "deviceNameExpression": "${serialNumber}", + "deviceProfileExpressionSource": "message", + "deviceProfileExpression": "${sensorType}" + }, + "timeout": 60000, + "attributes": [ + + ], + "timeseries": [ + { + "type": "string", + "key": "temperature", + "value": "${temp}" + } + ] + } + } + ], + "requestsMapping": { + "attributeUpdates": [ + { + "retain": true, + "deviceNameFilter": ".*", + "attributeFilter": "firmwareVersion", + "topicExpression": "sensor/${deviceName}/${attributeKey}", + "valueExpression": "{\"${attributeKey}\":\"${attributeValue}\"}" + } + ] + } +} +``` +{:.copy-code.expandable-15} \ No newline at end of file diff --git a/_includes/templates/iot-gateway/mqtt-connector/examples/request-mapping/configurable-rpc.md b/_includes/templates/iot-gateway/mqtt-connector/examples/request-mapping/configurable-rpc.md new file mode 100644 index 0000000000..ce0cc6d738 --- /dev/null +++ b/_includes/templates/iot-gateway/mqtt-connector/examples/request-mapping/configurable-rpc.md @@ -0,0 +1,162 @@ +RPC to Device allows sending RPC commands to the device that is connected to ThingsBoard directly or via Gateway. + +Suppose we have a device `SN-001` that tracks the light level of the room and is connected to ThingsBoard via an MQTT Gateway. +We want to send an RPC command to know the current state of the light level with two options: in the first case we want to get a response back, and in the second case we don't need a response. + +As an example, we will use ThingsBoard MQTT Demo Broker, which can be run using Docker and the following command: + +```bash +docker run -it -p 1884:1884 thingsboard/tb-gw-mqtt-broker:latest +``` +{:.copy-code} + +The demo broker runs at `0.0.0.0:1884` and simulates a device for our RPC examples. For configurable RPC, the device listens on topic `sensor/${deviceName}/request/${methodName}/${requestId}` for incoming commands and responds on topic `sensor/${deviceName}/response/${methodName}/${requestId}` when a response is expected. + +{% capture difference %} +**Please note:** +The RPC Debug Terminal is used only for example purposes, so you can use any other widget that supports RPC calls. +The custom MQTT publisher is used only to simulate the device behavior, but it is not applicable for real-production +use cases. +{% endcapture %} +{% include templates/info-banner.md content=difference %} + +Let's configure RPC commands in the MQTT connector to allow ThingsBoard to send commands to devices. + +Follow these steps: + +{% assign CustomRPC = ' + === + image: /images/gateway/mqtt-connector/examples/device-name-and-profile-message-json-1.png, + title: Go to "**Entities**" - "**Gateways**" on the left sidebar and select your gateway. + === + image: /images/gateway/mqtt-connector/examples/disconnect-request-gateway.png, + title: Click on the "**Connectors configuration**" button on the right side menu. + === + image: /images/gateway/mqtt-connector/examples/mqtt-gateway-configuring-11-ce.png, + title: Select the MQTT connector, click on the "**Basic**". Click the "**Add mapping**" under "**Requests mapping**" section to add new RPC mapping. + === + image: /images/gateway/mqtt-connector/examples/server-side-rpc-commands-1.png, + title: Select "**RPC command**" in the **Request type** field. For two-way RPC (with response). + === + image: /images/gateway/mqtt-connector/examples/server-side-rpc-commands-2.png, + title: Configure the **Device name filter** as `.*` to apply to all devices, set the **Method filter** to `echo`, the **Request topic expression** to `sensor/${deviceName}/request/${methodName}/${requestId}`, the **Value expression** to `${params}`, the **Response topic expression** to `sensor/${deviceName}/response/${methodName}/${requestId}`, and set an appropriate **Response timeout** (e.g., 10000 ms). + === + image: /images/gateway/mqtt-connector/examples/server-side-rpc-commands-3.png, + title: Remember to save your changes by clicking the designated button. + === + image: /images/gateway/mqtt-connector/examples/server-side-rpc-commands-4.png, + title: For one-way RPC (without response), click on the **Without response** tab. Configure the **Device name filter** as `.*` to apply to all devices, set the **Method filter** to `no-reply`, the **Request topic expression** to `sensor/${deviceName}/request/${methodName}/${requestId}`, and the **Value expression** to `${params}`. + === + image: /images/gateway/mqtt-connector/examples/server-side-rpc-commands-5.png, + title: Remember to save your changes by clicking the designated button. + ' +%} + +{% include images-gallery.liquid showListImageTitles="true" imageCollection=CustomRPC %} + +Let's demonstrate how to use this RPC configuration: + +### Example 1: Two Way RPC (with response) + +In the RPC Debug Terminal widget, run the following command to send a two-way RPC request: + +```bash +echo {"deviceName":"SN-001", "methodName":"echo"} +``` +{: .copy-code} + +The gateway will: +1. Receive this RPC request +2. Match it to the "echo" method configuration +3. Send a message to the topic `sensor/SN-001/request/echo/12345` (where 12345 is a unique request ID) +4. Subscribe to the topic `sensor/SN-001/response/echo/12345` to wait for a response +5. Return the response to ThingsBoard when received + +![image](/images/gateway/mqtt-connector/examples/result-device-overview-rpc-1.png) + +### Example 2: One Way RPC (without response) + +In the RPC Debug Terminal widget, run the following command to send a one-way RPC request: + +```bash +no-reply {"deviceName":"SN-001", "methodName":"no-reply"} +``` +{: .copy-code} + +The gateway will: +1. Receive this RPC request +2. Match it to the "no-reply" method configuration +3. Send a message to the topic `sensor/SN-001/request/no-reply/12345` (where 12345 is a unique request ID) +4. Not wait for any response + +![image](/images/gateway/mqtt-connector/examples/result-device-overview-rpc-2.png) + +If you are using advanced configuration mode, you can use the following configuration: + +```json +{ + "broker": { + "host": "127.0.0.1", + "port": 1884, + "clientId": "ThingsBoard_gateway", + "version": 5, + "maxMessageNumberPerWorker": 10, + "maxNumberOfWorkers": 100, + "keepAlive": 60, + "cleanSession": true, + "cleanStart": true, + "sessionExpiryInterval": 0, + "security": { + "type": "anonymous" + } + }, + "mapping": [ + { + "topicFilter": "sensor/data", + "subscriptionQos": 1, + "converter": { + "type": "json", + "deviceInfo": { + "deviceNameExpressionSource": "message", + "deviceNameExpression": "${serialNumber}", + "deviceProfileExpressionSource": "message", + "deviceProfileExpression": "${sensorType}" + }, + "timeout": 60000, + "attributes": [ + + ], + "timeseries": [ + { + "type": "string", + "key": "temperature", + "value": "${temp}" + } + ] + } + } + ], + "requestsMapping": { + "serverSideRpc": [ + { + "type": "twoWay", + "deviceNameFilter": ".*", + "methodFilter": "echo", + "requestTopicExpression": "sensor/${deviceName}/request/${methodName}/${requestId}", + "responseTopicExpression": "sensor/${deviceName}/response/${methodName}/${requestId}", + "responseTopicQoS": 1, + "responseTimeout": 10000, + "valueExpression": "${params}" + }, + { + "type": "oneWay", + "deviceNameFilter": ".*", + "methodFilter": "no-reply", + "requestTopicExpression": "sensor/${deviceName}/request/${methodName}/${requestId}", + "valueExpression": "${params}" + } + ] + } +} +``` +{:.copy-code.expandable-15} diff --git a/_includes/templates/iot-gateway/mqtt-connector/examples/request-mapping/connect-request.md b/_includes/templates/iot-gateway/mqtt-connector/examples/request-mapping/connect-request.md new file mode 100644 index 0000000000..6b4755e27b --- /dev/null +++ b/_includes/templates/iot-gateway/mqtt-connector/examples/request-mapping/connect-request.md @@ -0,0 +1,122 @@ +For a Connect request, the gateway must know which device name to target. You can extract it either from the `Message` payload using [json-path](/docs/iot-gateway/config/mqtt/#json-path) +or from the topic using a [regex](/docs/iot-gateway/config/mqtt/#regular-expressions). Choose [json-path](/docs/iot-gateway/config/mqtt/#json-path) when the device name is inside the JSON message; choose [regex](/docs/iot-gateway/config/mqtt/#regular-expressions) when it's encoded in the topic. + +Device `SN-001` hasn't sent telemetry for 10 minutes and is marked inactive, but you still need to send an RPC (and you're not planning to resume telemetry). +Let's configure a Connect request in the MQTT connector to (re)announce the device so RPC can be delivered. We'll demonstrate two ways to extract the device name: + +- From message (`JSON` payload). +- From topic (e.g., `sensor/SN-001/connect`). + +Follow these steps: + +{% assign deviceNameAndProfileTopicAndConstantJson = ' + === + image: /images/gateway/mqtt-connector/examples/device-name-and-profile-message-json-1.png, + title: Go to "**Entities**" - "**Gateways**" on the left sidebar and select your gateway. + === + image: /images/gateway/mqtt-connector/examples/connect-request-gateway.png, + title: Click on the "**Connectors configuration**" button on the right side menu. + === + image: /images/gateway/mqtt-connector/examples/mqtt-gateway-configuring-11-ce.png, + title: Select the MQTT connector, click on the "**Basic**". Click the "**Add mapping**" under "**Requests mapping**" section to add new connect request mapping. + === + image: /images/gateway/mqtt-connector/examples/connect-request-1.png, + title: Select `Connect request` in the **Request type** field then fill the "**Topic filter**" with `sensor/connect`. + === + image: /images/gateway/mqtt-connector/examples/connect-request-2.png, + title: Select **Name** - source `Message` and **Profile name** - source `Constant`. In Value, enter `${serialNumber}` for the device name and `Thermometer` for the device profile. + === + image: /images/gateway/mqtt-connector/examples/connect-request-3.png, + title: Remember to save your changes by clicking the designated button. + === + image: /images/gateway/mqtt-connector/examples/connect-request-4.png, + title: Select `Connect request` in the **Request type** field then fill the "**Topic filter**" with `sensor/+/connect`. + === + image: /images/gateway/mqtt-connector/examples/connect-request-5.png, + title: Select **Name** - source `Topic` and **Profile name** - source `Constant`. In Value, enter `(?<=sensor/)(.*?)(?=/connect)` for the device name and `Thermometer` for the device profile. + === + image: /images/gateway/mqtt-connector/examples/connect-request-6.png, + title: Remember to save your changes by clicking the designated button. +' +%} + +{% include images-gallery.liquid showListImageTitles="true" imageCollection=deviceNameAndProfileTopicAndConstantJson %} + +After 10 minutes without sending telemetry, device `SN-001` is marked as inactive in ThingsBoard, as shown below: + +![image](/images/gateway/mqtt-connector/examples/result-device-overview-1-connect.png) + +To reactivate the device so it can receive RPC commands, we need to send a Connect request. Let's demonstrate this with two examples: + +### Example 1: Device name from message payload + +Use a terminal to simulate sending a message from the device to the MQTT broker with the device name in the JSON payload: + +```bash +mosquitto_pub -h 127.0.0.1 -p 1884 -t "sensor/connect" -m '{"serialNumber": "SN-001"}' +``` +{: .copy-code} + +After sending this message, ThingsBoard updates both the lastActivityTime and lastConnectTime of the `SN-001` device, and its status changes to `Active`: + +![image](/images/gateway/mqtt-connector/examples/result-device-overview-connect-2.png) + +![image](/images/gateway/mqtt-connector/examples/result-device-overview-connect-3.png) + + +### Example 2: Device name from topic + +The same reactivation can be achieved using the second mapping configuration, where the device name is extracted from the topic instead of the message payload: + +```bash +mosquitto_pub -h 127.0.0.1 -p 1884 -t "sensor/SN-001/connect" -m '' +``` +{: .copy-code} + + +If you are using advanced configuration mode, you can +use the following configuration: + +```json +{ + "broker": { + "host": "127.0.0.1", + "port": 1884, + "clientId": "ThingsBoard_gateway", + "version": 5, + "maxMessageNumberPerWorker": 10, + "maxNumberOfWorkers": 100, + "keepAlive": 60, + "cleanSession": true, + "cleanStart": true, + "sessionExpiryInterval": 0, + "security": { + "type": "anonymous" + } + }, + "mapping": [], + "requestsMapping": { + "connectRequests": [ + { + "topicFilter": "sensor/connect", + "deviceInfo": { + "deviceNameExpression": "${serialNumber}", + "deviceNameExpressionSource": "message", + "deviceProfileExpressionSource": "constant", + "deviceProfileExpression": "Thermometer" + } + }, + { + "topicFilter": "sensor/+/connect", + "deviceInfo": { + "deviceNameExpression": "(?<=sensor/)(.*?)(?=/connect)", + "deviceNameExpressionSource": "topic", + "deviceProfileExpressionSource": "constant", + "deviceProfileExpression": "Thermometer" + } + } + ] + } +} +``` +{:.copy-code.expandable-15} \ No newline at end of file diff --git a/_includes/templates/iot-gateway/mqtt-connector/examples/request-mapping/disconnect-request.md b/_includes/templates/iot-gateway/mqtt-connector/examples/request-mapping/disconnect-request.md new file mode 100644 index 0000000000..5486ba6030 --- /dev/null +++ b/_includes/templates/iot-gateway/mqtt-connector/examples/request-mapping/disconnect-request.md @@ -0,0 +1,127 @@ +For a Disconnect request, the gateway must know which device name to target. You can extract it either from the `Message` payload using [json-path](/docs/iot-gateway/config/mqtt/#json-path) +or from the topic using a [regex](/docs/iot-gateway/config/mqtt/#regular-expressions). Choose [json-path](/docs/iot-gateway/config/mqtt/#json-path) when the device name is inside the JSON message; choose [regex](/docs/iot-gateway/config/mqtt/#regular-expressions) when it's encoded in the topic. + +Suppose you want to disconnect device `SN-001` from the platform immediately, without waiting for the 10-minute inactivity timeout-useful for dashboards, alarms, +and rule chains that react to status changes. + +{% capture difference %} +**Please note:** +A **Disconnect request** tells the platform the device is offline **immediately** and stops routing **RPCs** and **attribute updates** to it. +It does not block MQTT traffic: if the device (or gateway) continues publishing, +new messages will arrive and the device may be marked active again based on the inactivity timeout which is 10 minutes. +The UI “Active” flag follows last-activity timing; it may remain active until the timeout elapses unless no further messages arrive. +. +{% endcapture %} +{% include templates/info-banner.md content=difference %} + +Let's configure a Disconnect request in the MQTT connector to notify the platform when a device disconnects. +We'll demonstrate two ways to extract the device name: + +- From message (`JSON` payload). +- From topic (e.g., `sensor/SN-001/disconnect`). + +Follow these steps: + +{% assign deviceNameDisconnectJson = ' + === + image: /images/gateway/mqtt-connector/examples/device-name-and-profile-message-json-1.png, + title: Go to "**Entities**" - "**Gateways**" on the left sidebar and select your gateway. + === + image: /images/gateway/mqtt-connector/examples/disconnect-request-gateway.png, + title: Click on the "**Connectors configuration**" button on the right side menu. + === + image: /images/gateway/mqtt-connector/examples/mqtt-gateway-configuring-11-ce.png, + title: Select the MQTT connector, click on the "**Basic**". Click the "**Add mapping**" under "**Requests mapping**" section to add new disconnect request mapping. + === + image: /images/gateway/mqtt-connector/examples/disconnect-request-1.png, + title: Select "**Disconnect request**" in the **Request type** field, enter the "**Topic filter**" as `sensor/disconnect`. + === + image: /images/gateway/mqtt-connector/examples/disconnect-request-2.png, + title: Select source type for **Name** field as `Message`. In Value, enter `${serialNumber}` for the device name. + === + image: /images/gateway/mqtt-connector/examples/disconnect-request-3.png, + title: Remember to save your changes by clicking the designated button. + === + image: /images/gateway/mqtt-connector/examples/disconnect-request-4.png, + title: Select "**Disconnect request**" in the **Request type** field then fill the "**Topic filter**" with `sensor/+/disconnect`. + === + image: /images/gateway/mqtt-connector/examples/disconnect-request-5.png, + title: Select source type for **Name** field as `Topic`. In Value, enter `(?<=sensor/)(.*?)(?=/disconnect)` for the device name. + === + image: /images/gateway/mqtt-connector/examples/disconnect-request-6.png, + title: Remember to save your changes by clicking the designated button. +' +%} + +{% include images-gallery.liquid showListImageTitles="true" imageCollection=deviceNameDisconnectJson %} + +Let's demonstrate how to use these disconnect request configurations with two examples: + +![image](/images/gateway/mqtt-connector/examples/result-device-overview-1-disconnect.png) + +### Example 1: Device name from message payload + +When the device name is included in the message payload, you can send a disconnect request as follows: + +```bash +mosquitto_pub -h 127.0.0.1 -p 1884 -t "sensor/disconnect" -m '{"serialNumber": "SN-001"}' +``` +{: .copy-code} + +This message contains the device name in the JSON payload, which is extracted using the `${serialNumber}` JSON path. After processing this message, ThingsBoard will mark the device `SN-001` as disconnected. + +![image](/images/gateway/mqtt-connector/examples/result-device-overview-2-disconnect.png) + +### Example 2: Device name from topic + +When the device name is encoded in the topic path, you can send a disconnect request as follows: + +```bash +mosquitto_pub -h 127.0.0.1 -p 1884 -t "sensor/SN-001/disconnect" -m '' +``` +{: .copy-code} + +In this case, the device name is extracted from the topic using the regular expression `(?<=sensor/)(.*?)(?=/disconnect)`. After processing this message, ThingsBoard will mark the device `SN-001` as disconnected. + +If you are using advanced configuration mode, you can +use the following configuration: + +```json +{ + "broker": { + "host": "127.0.0.1", + "port": 1884, + "clientId": "ThingsBoard_gateway", + "version": 5, + "maxMessageNumberPerWorker": 10, + "maxNumberOfWorkers": 100, + "keepAlive": 60, + "cleanSession": true, + "cleanStart": true, + "sessionExpiryInterval": 0, + "security": { + "type": "anonymous" + } + }, + "mapping": [], + "requestsMapping": { + "disconnectRequests": [ + { + "topicFilter": "sensor/disconnect", + "deviceInfo": { + "deviceNameExpression": "${serialNumber}", + "deviceNameExpressionSource": "message" + } + }, + { + "topicFilter": "sensor/+/disconnect", + "deviceInfo": { + "deviceNameExpression": "(?<=sensor/)(.*?)(?=/disconnect)", + "deviceNameExpressionSource": "topic" + } + } + ] + } +} +``` +{:.copy-code.expandable-15} \ No newline at end of file diff --git a/_includes/templates/iot-gateway/mqtt-connector/examples/request-mapping/reserved-rpc.md b/_includes/templates/iot-gateway/mqtt-connector/examples/request-mapping/reserved-rpc.md new file mode 100644 index 0000000000..6ec03bd014 --- /dev/null +++ b/_includes/templates/iot-gateway/mqtt-connector/examples/request-mapping/reserved-rpc.md @@ -0,0 +1,142 @@ +## Reserved RPC Methods + +`GET` and `SET` RPC methods are out of the box, so you don’t need to configure them manually. + +Suppose we have a device `SN-001` that tracks the light level of the room and is connected to ThingsBoard via an MQTT Gateway. +We want to send an RPC command to know the current state of the light level with two options: in the first case we want to get a response back, and in the second case we don't need a response. +Additionally, we will update the room light level by sending a command without expecting a response. + +As an example, we will use ThingsBoard MQTT Demo Broker, which can be run using Docker and the following command: + +```bash +docker run -it -p 1884:1884 thingsboard/tb-gw-mqtt-broker:latest +``` +{:.copy-code} + +The broker available at `0.0.0.0:1884` and simulates a device that listens to the topic `data/get_light_level` for getting the current light level and responds on the topic `data/response`. +It also listens to the topic `data/set_light_level` to update the light level value. + +{% capture difference %} +**Please note:** +The RPC Debug Terminal is used only for example purposes, so you can use any other widget that supports RPC calls. +The custom MQTT publisher is used only to simulate the device behavior, but it is not applicable for real-production +use cases. +{% endcapture %} +{% include templates/info-banner.md content=difference %} + +### Example 1: Get current light level (Two Way RPC with response) + +In the RPC Debug Terminal widget, run the following command to send a two-way RPC request: + +```bash +get requestTopicExpression=data/get_light_level;responseTopicExpression=data/response;value=${params}; +``` +{: .copy-code} + +The gateway will: +1. Receive this RPC request +2. Process the built-in "get" method +3. Send a message to the topic `data/get_light_level` with the specified parameters +4. Subscribe to the topic `data/response` to wait for a response +5. Return the response to ThingsBoard when received + +![image](/images/gateway/mqtt-connector/examples/result-device-overview-reserved-rpc-1.png) + +### Example 2: Get current light level with no response (One Way RPC) + +In the RPC Debug Terminal widget, run the following command to send a one-way RPC request: + +```bash +get requestTopicExpression=data/get_light_level;value=${params}; +``` +{: .copy-code} + +The gateway will: +1. Receive this RPC request +2. Process the built-in "get" method +3. Send a message to the topic `data/get_light_level` with the specified parameters +4. Not wait for any response since no response topic was specified + +![image](/images/gateway/mqtt-connector/examples/result-device-overview-reserved-rpc-2.png) + +### Example 3: SET new light level (One Way RPC) + +In the RPC Debug Terminal widget, run the following command to set a new light level value: + +```bash +set requestTopicExpression=data/set_light_level;value=90; +``` +{: .copy-code} + +The gateway will: +1. Receive this RPC request +2. Process the built-in "set" method +3. Send a message to the topic `data/set_light_level` with the value "90" +4. Not wait for any response since no response topic was specified + +![image](/images/gateway/mqtt-connector/examples/result-device-overview-reserved-rpc-3.png) + +### Example 4: Check updated light level (Two Way RPC with response) + +After setting the new light level, you can verify the updated value by running: + +```bash +get requestTopicExpression=data/get_light_level;responseTopicExpression=data/response;value=${params}; +``` +{: .copy-code} + +The gateway will process this request as in Example 1, and you should see the updated light level value in the response. + +![image](/images/gateway/mqtt-connector/examples/result-device-overview-reserved-rpc-4.png) + +If you are using advanced configuration mode, you can use the following configuration: + +```json +{ + "broker": { + "host": "127.0.0.1", + "port": 1884, + "clientId": "ThingsBoard_gateway", + "version": 5, + "maxMessageNumberPerWorker": 10, + "maxNumberOfWorkers": 100, + "keepAlive": 60, + "cleanSession": true, + "cleanStart": true, + "sessionExpiryInterval": 0, + "security": { + "type": "anonymous" + } + }, + "mapping": [ + { + "topicFilter": "sensor/data", + "subscriptionQos": 1, + "converter": { + "type": "json", + "deviceInfo": { + "deviceNameExpressionSource": "message", + "deviceNameExpression": "${serialNumber}", + "deviceProfileExpressionSource": "message", + "deviceProfileExpression": "${sensorType}" + }, + "timeout": 60000, + "attributes": [ + + ], + "timeseries": [ + { + "type": "string", + "key": "temperature", + "value": "${temp}" + } + ] + } + } + ], + "requestsMapping": { + "serverSideRpc": [] + } +} +``` +{:.copy-code.expandable-15} \ No newline at end of file diff --git a/_includes/templates/iot-gateway/mqtt-connector/examples/time-series-and-attributes/attributes-time-series-bytes.md b/_includes/templates/iot-gateway/mqtt-connector/examples/time-series-and-attributes/attributes-time-series-bytes.md new file mode 100644 index 0000000000..a2291ae164 --- /dev/null +++ b/_includes/templates/iot-gateway/mqtt-connector/examples/time-series-and-attributes/attributes-time-series-bytes.md @@ -0,0 +1,116 @@ +Attributes and time series data can be retrieved using [slices](/docs/iot-gateway/config/mqtt/#slices) +in the MQTT Connector. This allows to extract the required field(s) from the `BYTES` payload received on the subscribed topic(s). + +As an example, we will use ThingsBoard MQTT Demo Broker, which can be run using Docker and the following command: + +```bash +docker run -it -p 1884:1884 thingsboard/tb-gw-mqtt-broker:latest +``` +{:.copy-code} + +The broker available at `0.0.0.0:1884` and publishes data to the topic `sensor/raw_data` with the following BYTES payload: + +`b"AM-120"` — Python bytes literal (ASCII) + +The first four bytes represent the device name, and the remaining bytes represent the temperature value. +Configure the MQTT connector to store the entire raw payload in the `rawData` attribute, and to parse bytes 5–6 as the `temperature` and publish it as the temp timeseries. +Then configure the device name and profile in the MQTT connector. + +Follow these steps: + +{% assign deviceNameAndProfileIdentifierPath = ' + === + image: /images/gateway/mqtt-connector/examples/device-name-and-profile-message-json-1.png, + title: Go to "**Entities**" → "**Gateways**" on the left sidebar and select your gateway. + === + image: /images/gateway/mqtt-connector/examples/device-name-and-profile-message-json-2.png, + title: Click on the "**Connectors configuration**" button on the right side menu. + === + image: /images/gateway/mqtt-connector/examples/device-name-and-profile-message-json-3.png, + title: Select the MQTT connector, click on the "**Data mapping**" tab. Select data mapping with device to which you want to add time series data (if you do not know how to add a new device, see the [Getting Started](/docs/iot-gateway/getting-started/?connectorsCreation=opcua){:target="_blank"} guide or [Data mapping](/docs/iot-gateway/config/opc-ua/#data-mapping) section of this guide with respective examples). + === + image: /images/gateway/mqtt-connector/examples/attributes-time-series-bytes-2.png, + title: In the opened data mapping windows, click on the "**pencil**" icon next to the "**Attributes**" section. + === + image: /images/gateway/mqtt-connector/examples/attributes-time-series-bytes-3.png, + title: Click on the "**Add attribute**" button. Fill in the "**Key**" field with `rawData`, also select `Raw` in "**Type**" field, and fill in the "**Value**" field with `[:]`. Those are [slices](/docs/iot-gateway/config/mqtt/#slices). + === + image: /images/gateway/mqtt-connector/examples/attributes-time-series-bytes-4.png, + title: Remember to save your changes by clicking the designated button on the screenshot. + === + image: /images/gateway/mqtt-connector/examples/attributes-time-series-bytes-5.png, + title: In the opened data mapping windows, click on the "**pencil**" icon next to the "**Time series**" section. + === + image: /images/gateway/mqtt-connector/examples/attributes-time-series-bytes-6.png, + title: Click on the "**Add time series**" button. Fill in the "**Key**" field with `temp`, also select `Raw` in "**Type**" field, and fill in the "**Value**" field with `[4:]`. Those are [slices](/docs/iot-gateway/config/mqtt/#slices). + === + image: /images/gateway/mqtt-connector/examples/attributes-time-series-bytes-7.png, + title: Remember to save your changes by clicking the designated button on the screenshot. +' +%} + +{% include images-gallery.liquid showListImageTitles="true" imageCollection=deviceNameAndProfileIdentifierPath %} + +Now we can check if the attribute data is set correctly. Go to "**Entities**" > "**Devices**", select a created device and as you +can see, the humidity data is available in the "**Attributes**" section: + +![image](/images/gateway/mqtt-connector/examples/result-device-overview-4.png) + +Now we can check if the temperature data is sending correctly. Go to "**Entities**" > "**Devices**", select a created device and as you +can see, the humidity data is available in the "**Latest telemetry**" section: + +![image](/images/gateway/mqtt-connector/examples/result-device-overview-3.png) + +If you are using advanced configuration mode and want to set the `temperature` and `model` data using [json-path](/docs/iot-gateway/config/mqtt/#json-path), you can +use the following configuration: + +```json +{ + "broker": { + "host": "127.0.0.1", + "port": 1884, + "clientId": "ThingsBoard_gateway", + "version": 5, + "maxMessageNumberPerWorker": 10, + "maxNumberOfWorkers": 100, + "keepAlive": 60, + "cleanSession": true, + "cleanStart": true, + "sessionExpiryInterval": 0, + "security": { + "type": "anonymous" + } + }, + "mapping": [ + { + "topicFilter": "sensor/raw_data", + "subscriptionQos": 1, + "converter": { + "type": "bytes", + "deviceInfo": { + "deviceNameExpression": "[0:4]", + "deviceNameExpressionSource": "message", + "deviceProfileExpressionSource": "constant", + "deviceProfileExpression": "default" + }, + "attributes": [ + { + "key": "rawData", + "type": "raw", + "value": "[:]" + } + ], + "timeseries": [ + { + "key": "temp", + "type": "raw", + "value": "[4:]" + } + ] + } + } + ], + "requestsMapping": {} +} +```` +{:.copy-code.expandable-15} \ No newline at end of file diff --git a/_includes/templates/iot-gateway/mqtt-connector/examples/time-series-and-attributes/attributes-time-series-json-path.md b/_includes/templates/iot-gateway/mqtt-connector/examples/time-series-and-attributes/attributes-time-series-json-path.md new file mode 100644 index 0000000000..4c45c4b0de --- /dev/null +++ b/_includes/templates/iot-gateway/mqtt-connector/examples/time-series-and-attributes/attributes-time-series-json-path.md @@ -0,0 +1,120 @@ +Attributes and time series data can be retrieved using [json-path](/docs/iot-gateway/config/mqtt/#json-path) +in the MQTT Connector. This allows to extract the required field(s) from the `JSON` payload received on the subscribed topic(s).”. + +As an example, we will use ThingsBoard MQTT Demo Broker, which can be run using Docker and the following command: + +```bash +docker run -it -p 1884:1884 thingsboard/tb-gw-mqtt-broker:latest +``` +{:.copy-code} + +The broker available at `0.0.0.0:1884` and publishes data to the topic `sensor/data` with the following JSON payload: + +```json +{ + "serialNumber": "SN-001", + "sensorType": "Thermometer", + "sensorModel": "T-100", + "temp": 22.82, + "hum": 59.3 +} +``` +We’ll map `sensorModel` → `model` and `temp` → timeseries `temperature`. Next, configure the device name and profile in the MQTT connector. +Follow these steps: + +{% assign deviceNameAndProfileTopicAndConstantJson = ' + === + image: /images/gateway/mqtt-connector/examples/device-name-and-profile-message-json-1.png, + title: Go to "**Entities**" → "**Gateways**" on the left sidebar and select your gateway. + === + image: /images/gateway/mqtt-connector/examples/device-name-and-profile-message-json-2.png, + title: Click on the "**Connectors configuration**" button on the right side menu. + === + image: /images/gateway/mqtt-connector/examples/device-name-and-profile-message-json-3.png, + title: Select the MQTT connector, click on the "**Data mapping**" tab. Select data mapping with device to which you want to add time series data (if you do not know how to add a new device, see the [Getting Started](/docs/iot-gateway/getting-started/?connectorsCreation=opcua){:target="_blank"} guide or [Data mapping](/docs/iot-gateway/config/opc-ua/#data-mapping) section of this guide with respective examples). + === + image: /images/gateway/mqtt-connector/examples/attributes-time-series-json-path-2.png, + title: In the opened data mapping windows, click on the "**pencil**" icon next to the "**Attributes**" section. + === + image: /images/gateway/mqtt-connector/examples/attributes-time-series-json-path-3.png, + title: Click on the "**Add attribute**" button. Fill in the "**Key**" field with `model`, also select `String` in "**Type**" field, and fill in the "**Value**" field with `${sensorModel}`. This is a [json-path](/docs/iot-gateway/config/mqtt/#json-path). + === + image: /images/gateway/mqtt-connector/examples/attributes-time-series-json-path-4.png, + title: Remember to save your changes by clicking the designated button. + === + image: /images/gateway/mqtt-connector/examples/attributes-time-series-json-path-5.png, + title: In the opened data mapping windows, click on the "**pencil**" icon next to the "**Time series**" section. + === + image: /images/gateway/mqtt-connector/examples/attributes-time-series-json-path-6.png, + title: Click on the "**Add time series**" button. Fill in the "**Key**" field with `temperature`, also select `Double` in "**Type**" field, and fill in the "**Value**" field with [json-path](/docs/iot-gateway/config/mqtt/#json-path) - `${temp}`. This is a [json-path](/docs/iot-gateway/config/mqtt/#json-path). + === + image: /images/gateway/mqtt-connector/examples/attributes-time-series-json-path-7.png, + title: Remember to save your changes by clicking the designated button. +' +%} + +{% include images-gallery.liquid showListImageTitles="true" imageCollection=deviceNameAndProfileTopicAndConstantJson %} + +Now we can check if the attribute data is set correctly. Go to "**Entities**" > "**Devices**", select a created device and as you +can see, the humidity data is available in the "**Attributes**" section: + +![image](/images/gateway/mqtt-connector/examples/result-device-overview-2.png) + +Now we can check if the temperature data is sending correctly. Go to "**Entities**" > "**Devices**", select a created device and as you +can see, the humidity data is available in the "**Latest telemetry**" section: + +![image](/images/gateway/mqtt-connector/examples/result-device-overview-1.png) + +If you are using advanced configuration mode and want to set the `temperature` and `model` data using [json-path](/docs/iot-gateway/config/mqtt/#json-path), you can +use the following configuration: + +```json +{ + "broker": { + "host": "127.0.0.1", + "port": 1884, + "clientId": "ThingsBoard_gateway", + "version": 5, + "maxMessageNumberPerWorker": 10, + "maxNumberOfWorkers": 100, + "keepAlive": 60, + "cleanSession": true, + "cleanStart": true, + "sessionExpiryInterval": 0, + "security": { + "type": "anonymous" + } + }, + "mapping": [ + { + "topicFilter": "sensor/data", + "subscriptionQos": 1, + "converter": { + "type": "json", + "deviceInfo": { + "deviceNameExpression": "${serialNumber}", + "deviceNameExpressionSource": "message", + "deviceProfileExpressionSource": "message", + "deviceProfileExpression": "${sensorType}" + }, + "attributes": [ + { + "key": "model", + "type": "string", + "value": "${sensorModel}" + } + ], + "timeseries": [ + { + "key": "temperature", + "type": "double", + "value": "${temp}" + } + ] + } + } + ], + "requestsMapping": {} +} +``` +{:.copy-code.expandable-15} \ No newline at end of file diff --git a/_includes/templates/iot-gateway/mqtt-connector/examples/time-series-and-attributes/device-name-and-profile-message-and-constant-bytes.md b/_includes/templates/iot-gateway/mqtt-connector/examples/time-series-and-attributes/device-name-and-profile-message-and-constant-bytes.md new file mode 100644 index 0000000000..a7a59218f1 --- /dev/null +++ b/_includes/templates/iot-gateway/mqtt-connector/examples/time-series-and-attributes/device-name-and-profile-message-and-constant-bytes.md @@ -0,0 +1,102 @@ +The device name and profile can be extracted from the message source and bytes payload. In this example, we will use +[slices](/docs/iot-gateway/config/mqtt/#slices) to specify the device name and constant for profile. + +As an example, we will use ThingsBoard MQTT Demo Broker, which can be run using Docker and the following command: + +```bash +docker run -it -p 1884:1884 thingsboard/tb-gw-mqtt-broker:latest +``` +{:.copy-code} + +The broker available at `0.0.0.0:1884` and publishes data to the topic `sensor/raw_data` with the following BYTES payload: + +`b"AM-120"` — Python bytes literal (ASCII) + +Suppose we want to create a device from this payload. The first four bytes represent the device name, and the remaining bytes represent the temperature value. + +Configure the MQTT connector to extract the device name from the raw bytes and use a constant value for the device profile (for example, `default`). + +Follow these steps: + +{% assign deviceNameAndProfileTopicAndConstantJson = ' + === + image: /images/gateway/mqtt-connector/examples/device-name-and-profile-message-json-1.png, + title: Go to "**Entities**" → "**Gateways**" on the left sidebar and select your gateway. + === + image: /images/gateway/mqtt-connector/examples/device-name-and-profile-message-json-2.png, + title: Click on the "**Connectors configuration**" button on the right side menu. + === + image: /images/gateway/mqtt-connector/examples/device-name-and-profile-message-json-3.png, + title: Select the created MQTT connector, select "**Basic**" click on the "**Data mapping**" Click on the "**+ Add mapping**" button. + === + image: /images/gateway/mqtt-connector/examples/device-name-and-profile-message-and-constant-bytes-4.png, + title: In the opened window, fill in "**Topic filter**" field with `sensor/raw_data`, also fill "**QoS**" with one of these values(`0`,`1`,`2`) and for "**Payload type**" select `Bytes`. + === + image: /images/gateway/mqtt-connector/examples/device-name-and-profile-message-and-constant-bytes-5.png, + title: Then under "**Device**" subsection choose "**Message**" for the "**Name**" field, enter `[0:4]`, those are the [slices](/docs/iot-gateway/config/mqtt/#slices) used to extract device name. + === + image: /images/gateway/mqtt-connector/examples/device-name-and-profile-message-and-constant-bytes-6.png, + title: Then under "**Profile name**" subsection choose "**Constant**" for the "**Name**" field, enter `default`, this is **Constant** value that will be used to form device profile name. + === + image: /images/gateway/mqtt-connector/examples/device-name-and-profile-message-and-constant-bytes-7.png, + title: Also, we need to add at least one attribute/time series because the connector will not add a device without any data to read as we remember. The first four bytes represent the device name, and the remaining bytes represent the temperature value. Click on the "**pencil**" icon next to the "**Time series**" section. + === + image: /images/gateway/mqtt-connector/examples/device-name-and-profile-message-and-constant-bytes-8.png, + title: In the opened window, click on the "**Add time series**" button and fill the fields as on the corresponding image. Do not forget to save changes. +' +%} + +{% include images-gallery.liquid showListImageTitles="true" imageCollection=deviceNameAndProfileTopicAndConstantJson %} + +Now we can check if the device name and profile are set correctly. Go to "**Entities**" > "**Devices**" and as you can see, the device +name is set to `AM-1` and the profile is set to `default`. + +![image](/images/gateway/mqtt-connector/examples/device-name-and-profile-message-and-constant-bytes-9.png) + +If you are using advanced configuration mode and want to set the device name and profile using topic and json path, you can +use the following configuration: + +```json +{ + "broker": { + "host": "127.0.0.1", + "port": 1884, + "clientId": "ThingsBoard_gateway", + "version": 5, + "maxMessageNumberPerWorker": 10, + "maxNumberOfWorkers": 100, + "keepAlive": 60, + "cleanSession": true, + "cleanStart": true, + "sessionExpiryInterval": 0, + "security": { + "type": "anonymous" + } + }, + "mapping": [ + { + "topicFilter": "sensor/raw_data", + "subscriptionQos": 1, + "converter": { + "type": "bytes", + "deviceInfo": { + "deviceNameExpression": "[0:4]", + "deviceNameExpressionSource": "message", + "deviceProfileExpressionSource": "constant", + "deviceProfileExpression": "default" + }, + "attributes": [], + "timeseries": [ + { + "key": "temp", + "type": "raw", + "value": "[4:]" + } + ] + } + } + ], + "requestsMapping": {} +} +``` +{:.copy-code.expandable-15} \ No newline at end of file diff --git a/_includes/templates/iot-gateway/mqtt-connector/examples/time-series-and-attributes/device-name-and-profile-message-json.md b/_includes/templates/iot-gateway/mqtt-connector/examples/time-series-and-attributes/device-name-and-profile-message-json.md new file mode 100644 index 0000000000..f0879ffb1d --- /dev/null +++ b/_includes/templates/iot-gateway/mqtt-connector/examples/time-series-and-attributes/device-name-and-profile-message-json.md @@ -0,0 +1,112 @@ +The device name and profile can be extracted from the incoming message. In this example, we will use +[json path](/docs/iot-gateway/config/mqtt/#json-path) to specify the device name and profile. + +As an example, we will use ThingsBoard MQTT Demo Broker, which can be run using Docker and the following command: + +```bash +docker run -it -p 1884:1884 thingsboard/tb-gw-mqtt-broker:latest +``` +{:.copy-code} + +The broker available at `0.0.0.0:1884` and publishes data to the topic `sensor/data` with the following JSON payload: + +```json +{ + "serialNumber": "SN-001", + "sensorType": "Thermometer", + "sensorModel": "T-100", + "temp": 22.82, + "hum": 59.3 +} +``` +We also want to extract the device name from the `serialNumber` field and the device profile from the `sensorType` field. +Let's configure the device name and profile in the MQTT connector. For this purpose, follow these steps: + +{% assign deviceNameAndProfileTopicAndConstantJson = ' + === + image: /images/gateway/mqtt-connector/examples/device-name-and-profile-message-json-1.png, + title: Go to "**Entities**" → "**Gateways**" on the left sidebar and select your gateway. + === + image: /images/gateway/mqtt-connector/examples/device-name-and-profile-message-json-2.png, + title: Click on the "**Connectors configuration**" button on the right side menu. + === + image: /images/gateway/mqtt-connector/examples/device-name-and-profile-message-json-3.png, + title: Select the created MQTT connector, select "**Basic**" click on the "**Data mapping**" Click on the "**+ Add mapping**" button. + === + image: /images/gateway/mqtt-connector/examples/device-name-and-profile-message-json-4.png, + title: In the opened window, fill in "**Topic filter**" field with `sensor/data`, also fill "**QoS**" with one of these values(`0`,`1`,`2`) and for "**Payload type**" select `JSON`. + === + image: /images/gateway/mqtt-connector/examples/device-name-and-profile-message-json-5.png, + title: Then under "**Device**" subsection choose "**Message**" for the "**Name**" field, enter `${serialNumber}`, this is the [json path](/docs/iot-gateway/config/mqtt/#json-path) to the field that contains the device name. + === + image: /images/gateway/mqtt-connector/examples/device-name-and-profile-message-json-6.png, + title: Then under "**Profile name**" subsection choose "**Message**" for the "**Name**" field, enter `${sensorType}`, this is the [json path](/docs/iot-gateway/config/mqtt/#json-path) to the field that contains the device name. + === + image: /images/gateway/mqtt-connector/examples/device-name-and-profile-message-json-7.png, + title: Also, we need to add at least one attribute/time series because the connector will not add a device without any data to read. Click on the "**pencil**" icon next to the "**Time series**" section. + === + image: /images/gateway/mqtt-connector/examples/device-name-and-profile-message-json-8.png, + title: In the opened window, click on the "**Add time series**" button and fill the fields as on the corresponding image. Do not forget to save changes. +' +%} + +{% include images-gallery.liquid showListImageTitles="true" imageCollection=deviceNameAndProfileTopicAndConstantJson %} + +Now we can check if the device name and profile are set correctly. Go to "**Entities**" > "**Devices**" and as you can see, the device +name is set to `SN-001` and the profile is set to `Thermometer`. + +![image](/images/gateway/mqtt-connector/examples/device-name-and-profile-message-json-9.png) + +If you are using advanced configuration mode and want to set the device name and profile using topic and json path, you can +use the following configuration: + +```json +{ + "broker": { + "host": "127.0.0.1", + "port": 1884, + "clientId": "ThingsBoard_gateway", + "version": 5, + "maxMessageNumberPerWorker": 10, + "maxNumberOfWorkers": 100, + "keepAlive": 60, + "cleanSession": true, + "cleanStart": true, + "sessionExpiryInterval": 0, + "security": { + "type": "anonymous" + } + }, + "mapping": [ + { + "topicFilter": "sensor/data", + "subscriptionQos": 1, + "converter": { + "type": "json", + "deviceInfo": { + "deviceNameExpression": "${serialNumber}", + "deviceNameExpressionSource": "message", + "deviceProfileExpressionSource": "message", + "deviceProfileExpression": "${sensorType}" + }, + "attributes": [ + { + "key": "model", + "type": "string", + "value": "${sensorModel}" + } + ], + "timeseries": [ + { + "key": "temperature", + "type": "double", + "value": "${temp}" + } + ] + } + } + ], + "requestsMapping": {} +} +``` +{:.copy-code.expandable-15} diff --git a/_includes/templates/iot-gateway/mqtt-connector/examples/time-series-and-attributes/device-name-and-profile-topic-and-constant-json.md b/_includes/templates/iot-gateway/mqtt-connector/examples/time-series-and-attributes/device-name-and-profile-topic-and-constant-json.md new file mode 100644 index 0000000000..6f1032a78f --- /dev/null +++ b/_includes/templates/iot-gateway/mqtt-connector/examples/time-series-and-attributes/device-name-and-profile-topic-and-constant-json.md @@ -0,0 +1,107 @@ +The device name and profile can be extracted from the topic. In this example, we will use +[regex](/docs/iot-gateway/config/mqtt/#regular-expressions) to specify the device name and constant for profile. + +As an example, we will use ThingsBoard MQTT Demo Broker, which can be run using Docker and the following command: + +```bash +docker run -it -p 1884:1884 thingsboard/tb-gw-mqtt-broker:latest +``` +{:.copy-code} + +The broker available at `0.0.0.0:1884` and publishes data to the topic `sensor/Thermo-A/data` where `Thermo-A` is the device name: with the following JSON payload: + +```json +{ + "sensorModel": "T-100", + "temp": 23.82, + "hum": 60.3 +} +``` +To match this topic, either enter `sensor/Thermo-A/data` in **Topic filter** field or use [wildcards](/docs/iot-gateway/config/mqtt/#wildcard-usage) +to subscribe to both `sensor/Thermo-A/data` and let's say `sensor/Thermo-B/data`. + +Let’s configure the MQTT connector to take the device name from the topic and use a constant for the device profile (e.g., `Thermometer`). +Follow these steps: + +{% assign deviceNameAndProfileTopicAndConstantJson = ' + === + image: /images/gateway/mqtt-connector/examples/device-name-and-profile-message-json-1.png, + title: Go to "**Entities**" → "**Gateways**" on the left sidebar and select your gateway. + === + image: /images/gateway/mqtt-connector/examples/device-name-and-profile-message-json-2.png, + title: Click on the "**Connectors configuration**" button on the right side menu. + === + image: /images/gateway/mqtt-connector/examples/device-name-and-profile-message-json-3.png, + title: Select the created MQTT connector, select "**Basic**" click on the "**Data mapping**" Click on the "**+ Add mapping**" button. + === + image: /images/gateway/mqtt-connector/examples/device-name-and-profile-topic-constant-json-4.png, + title: In the opened window, fill in "**Topic filter**" field with `sensor/+/data`, also fill "**QoS**" with one of these values(`0`,`1`,`2`) and for "**Payload type**" select `JSON`. + === + image: /images/gateway/mqtt-connector/examples/device-name-and-profile-topic-constant-json-5.png, + title: Then under "**Device**" subsection choose "**Topic**" for the "**Name**" field, enter `(?<=sensor/)(.*?)(?=/data)`, this is the [regex](/docs/iot-gateway/config/mqtt/#regular-expressions) used to extract device name. + === + image: /images/gateway/mqtt-connector/examples/device-name-and-profile-topic-constant-json-6.png, + title: Then under "**Profile name**" subsection choose "**Constant**" for the "**Name**" field, enter `Thermometer`, this is **Constant** value that will be used to form device profile name. + === + image: /images/gateway/mqtt-connector/examples/device-name-and-profile-topic-constant-json-7.png, + title: Also, we need to add at least one attribute/time series because the connector will not add a device without any data to read. Click on the "**pencil**" icon next to the "**Time series**" section. + === + image: /images/gateway/mqtt-connector/examples/device-name-and-profile-message-json-8.png, + title: In the opened window, click on the "**Add time series**" button and fill the fields as on the corresponding image. Do not forget to save changes. +' +%} + +{% include images-gallery.liquid showListImageTitles="true" imageCollection=deviceNameAndProfileTopicAndConstantJson %} + +Now we can check if the device name and profile are set correctly. Go to "**Entities**" > "**Devices**" and as you can see, the device +name is set to `Thermo-A` and the profile is set to `Thermometer`. + +![image](/images/gateway/mqtt-connector/examples/device-name-and-profile-topic-constant-json-9.png) + +If you are using advanced configuration mode and want to set the device name and profile using topic and json path, you can +use the following configuration: + +```json +{ + "broker": { + "host": "127.0.0.1", + "port": 1884, + "clientId": "ThingsBoard_gateway", + "version": 5, + "maxMessageNumberPerWorker": 10, + "maxNumberOfWorkers": 100, + "keepAlive": 60, + "cleanSession": true, + "cleanStart": true, + "sessionExpiryInterval": 0, + "security": { + "type": "anonymous" + } + }, + "mapping": [ + { + "topicFilter": "sensor/+/data", + "subscriptionQos": 1, + "converter": { + "type": "json", + "deviceInfo": { + "deviceNameExpression": "(?<=sensor/)(.*?)(?=/data)", + "deviceNameExpressionSource": "topic", + "deviceProfileExpressionSource": "constant", + "deviceProfileExpression": "Thermometer" + }, + "attributes": [], + "timeseries": [ + { + "key": "temperature", + "type": "double", + "value": "${temp}" + } + ] + } + } + ], + "requestsMapping": {} +} +``` +{:.copy-code.expandable-15} \ No newline at end of file diff --git a/_includes/templates/iot-gateway/mqtt-connector/mqtt-attr-and-time-series-basic-section.md b/_includes/templates/iot-gateway/mqtt-connector/mqtt-attr-and-time-series-basic-section.md new file mode 100644 index 0000000000..05e0225033 --- /dev/null +++ b/_includes/templates/iot-gateway/mqtt-connector/mqtt-attr-and-time-series-basic-section.md @@ -0,0 +1,40 @@ +To add new time series or attribute key, follow these steps: + +{% assign attrAndTimeseries = ' + === + image: /images/gateway/mqtt-connector/mqtt-gateway-configuring-3-ce.png, + title: Click the “**pencil**” icon in the “**Attributes**” section to add new attribute key; + === + image: /images/gateway/mqtt-connector/mqtt-gateway-configuring-4-ce.png, + title: Click on "**Add attribute**" in the opened window; + === + image: /images/gateway/mqtt-connector/mqtt-gateway-configuring-5-ce.png, + title: Enter the "**Key**" field, select the "**Type**" (It could be one of the following `string`, `boolean`, `integer`, `double` or `Raw` if the **Payload type** `Bytes`.), enter "**Value**" and click "**Apply**" button; + === + image: /images/gateway/mqtt-connector/mqtt-gateway-configuring-6-ce.png, + title: Now click on the “**pencil**” icon in the “**Time series**” section to add new time series key; + === + image: /images/gateway/mqtt-connector/mqtt-gateway-configuring-7-ce.png, + title: Click on "**Add time series**" in the opened window; + === + image: /images/gateway/mqtt-connector/mqtt-gateway-configuring-8-ce.png, + title: Enter the "**Key**" field, select the "**Type**" (It could be one of the following `string`, `boolean`, `integer`, `double` or `Raw` if the **Payload type** `Bytes`.), enter "**Value**" and click "**Apply**" button. + ' +%} + +{% include images-gallery.liquid showListImageTitles="true" imageCollection=attrAndTimeseries %} + +You can enable a specific report strategy for each time series or attribute. This strategy defines how often +data is sent to the ThingsBoard server. The following strategies are available: + +- **On report period** - sends data to ThingsBoard after the report period; +- **On value change** - sends data to ThingsBoard when the value changes; +- **On value change or report period** - sends data to ThingsBoard when the value changes or after the report period; +- **On received** - sends data to ThingsBoard after receiving data from the device (default strategy). + +{% capture difference %} +Additional information about the report strategy can be found [here](/docs/iot-gateway/features-overview/report-strategy){:target="_blank"}. +{% endcapture %} +{% include templates/info-banner.md content=difference %} + +![image](/images/gateway/mqtt-connector/mqtt-gateway-configuring-10-ce.png) diff --git a/_includes/templates/iot-gateway/mqtt-connector/mqtt-basic-section.md b/_includes/templates/iot-gateway/mqtt-connector/mqtt-basic-section.md new file mode 100644 index 0000000000..dbfda5a1cd --- /dev/null +++ b/_includes/templates/iot-gateway/mqtt-connector/mqtt-basic-section.md @@ -0,0 +1,40 @@ +This configuration section contains settings of the MQTT broker connection, such as: +- **Host** - MQTT broker hostname or ip address; +- **Port** - listening port on the MQTT broker that will be used for establishing connection; +- **MQTT version** - MQTT protocol version (there are three versions currently supported by gateway - **3.1**, **3.11**, **5**); +- **Client ID** ** - Unique identifier for each client’s session on the broker; +- **Security** - configuration for client authorization at MQTT Broker (anonymous, basic, or certificates). + +{% capture difference %} +**Please note:** +\** -- The broker (or broker cluster) does not allow two simultaneous sessions with the same **Client ID**. If a second connection uses that ID, +the broker closes the existing session and accepts the new one (session takeover). The **Client ID** can be any valid UTF-8 string; +if you don’t have a descriptive one, you can generate it in the MQTT connector configuration UI—see the last screenshots under this subsection. +{% endcapture %} +{% include templates/info-banner.md content=difference %} + +{% capture difference %} +All configuration parameters list, and their detailed description can be found in the +[Advanced configuration](/docs/iot-gateway/config/mqtt/#advanced-configuration) section. +{% endcapture %} +{% include templates/info-banner.md content=difference %} + +![image](/images/gateway/mqtt-connector/connection-to-broker-basic-section-1-ce.png) + +If you want the UI to generate a **Client ID**, leave the **Client ID** field blank and click *Generate Client ID* (see the screenshot below). +The gateway will create a unique identifier. + +![image](/images/gateway/mqtt-connector/generate-clientID-from-UI.png) + +UI form with generated **Client ID** identifier e.g., *tb_gw_rfpev* — this is just an example; your value will be different. + +![image](/images/gateway/mqtt-connector/generated-clientID-from-UI.png) + + + + + + + + + diff --git a/_includes/templates/iot-gateway/mqtt-connector/requests-mapping-section-advanced.md b/_includes/templates/iot-gateway/mqtt-connector/requests-mapping-section-advanced.md deleted file mode 100644 index 682e60dd8d..0000000000 --- a/_includes/templates/iot-gateway/mqtt-connector/requests-mapping-section-advanced.md +++ /dev/null @@ -1 +0,0 @@ -![image](/images/gateway/mqtt-connector/requests-mapping-advanced-1-ce.png) \ No newline at end of file diff --git a/_includes/templates/iot-gateway/mqtt-connector/requests-mapping-section-basic.md b/_includes/templates/iot-gateway/mqtt-connector/requests-mapping-section-basic.md deleted file mode 100644 index c8b4a37a18..0000000000 --- a/_includes/templates/iot-gateway/mqtt-connector/requests-mapping-section-basic.md +++ /dev/null @@ -1,7 +0,0 @@ -For adding new requests mapping, click "plus" icon: - -![image](/images/gateway/mqtt-connector/requests-mapping-1-ce.png) - -Modal window will open. Select request type, set a topic filter, fill in the entities fields of the "Device" section. Then, click "Add". - -![image](/images/gateway/mqtt-connector/requests-mapping-2-ce.png) \ No newline at end of file diff --git a/_includes/templates/iot-gateway/mqtt-connector/security-basic-anonymous-subsection.md b/_includes/templates/iot-gateway/mqtt-connector/security-basic-anonymous-subsection.md deleted file mode 100644 index 899bed9533..0000000000 --- a/_includes/templates/iot-gateway/mqtt-connector/security-basic-anonymous-subsection.md +++ /dev/null @@ -1,3 +0,0 @@ -Anonymous auth is the most simple option. It is useful for testing on public MQTT brokers, like test.mosquitto.org. - -![image](/images/gateway/mqtt-connector/security-basic-anonymous-subsection-1-ce.png) \ No newline at end of file diff --git a/_includes/templates/iot-gateway/mqtt-connector/security-basic-basic-subsection.md b/_includes/templates/iot-gateway/mqtt-connector/security-basic-basic-subsection.md deleted file mode 100644 index 49fd171370..0000000000 --- a/_includes/templates/iot-gateway/mqtt-connector/security-basic-basic-subsection.md +++ /dev/null @@ -1,3 +0,0 @@ -One type of security configuration is basic. For authorization, a combination of username and password provided in this section, in config will be used. - -![image](/images/gateway/mqtt-connector/security-basic-basic-subsection-1-ce.png) \ No newline at end of file diff --git a/_includes/templates/iot-gateway/mqtt-connector/security-config-anonymous.md b/_includes/templates/iot-gateway/mqtt-connector/security-config-anonymous.md deleted file mode 100644 index 09c384fb6a..0000000000 --- a/_includes/templates/iot-gateway/mqtt-connector/security-config-anonymous.md +++ /dev/null @@ -1,17 +0,0 @@ -Anonymous auth is the most simple option. It is useful for testing on public MQTT brokers, like test.mosquitto.org. - - -|**Parameter**|**Default value**|**Description**| -|:-|:-|- -| type | **anonymous** | Type of authorization. | -|--- - -Security subsection in configuration file will look like this: - -```json - "security": { - "type": "anonymous" - } -``` - -![image](/images/gateway/mqtt-connector/security-advanced-anonymous-subsection-1-ce.png) \ No newline at end of file diff --git a/_includes/templates/iot-gateway/mqtt-connector/security-config-basic.md b/_includes/templates/iot-gateway/mqtt-connector/security-config-basic.md deleted file mode 100644 index ce58cd214a..0000000000 --- a/_includes/templates/iot-gateway/mqtt-connector/security-config-basic.md +++ /dev/null @@ -1,22 +0,0 @@ -One type of security configuration is basic. -For authorization, a combination of username and password provided in this section, in config will be used. - - -| **Parameter** | **Default value** | **Description** | -|:--------------|:------------------|-----------------------------| -| type | **basic** | Type of authorization. | -| username | **username** | Username for authorization. | -| password | **password** | Password for authorization. | -| --- - -Security subsection in configuration file will look like this: - -```json - "security": { - "type": "basic", - "username": "username", - "password": "password" - } -``` - -![image](/images/gateway/mqtt-connector/security-advanced-basic-subsection-1-ce.png) \ No newline at end of file diff --git a/_includes/templates/iot-gateway/mqtt-connector/security-config-certificates.md b/_includes/templates/iot-gateway/mqtt-connector/security-config-certificates.md deleted file mode 100644 index c212ee11c0..0000000000 --- a/_includes/templates/iot-gateway/mqtt-connector/security-config-certificates.md +++ /dev/null @@ -1,22 +0,0 @@ -The table below describes the parameters required to configure authorization on MQTT broker. - -| **Parameter** | **Default value** | **Description** | -|:------------------|:---------------------------------------------|---------------------------- -| type | **certificates** | Type of authorization. | -| pathToCACert | **/etc/thingsboard-gateway/ca.pem** | Path to CA file. | -| pathToPrivateKey | **/etc/thingsboard-gateway/privateKey.pem** | Path to private key file. | -| pathToClientCert | **/etc/thingsboard-gateway/certificate.pem** | Path to certificate file. | -| --- - -Security subsection in configuration file will look like this: - -```json -"security":{ - "type": "certificates", - "pathToCACert": "/etc/thingsboard-gateway/ca.pem", - "pathToPrivateKey": "/etc/thingsboard-gateway/privateKey.pem", - "pathToClientCert": "/etc/thingsboard-gateway/certificate.pem" -} -``` - -![image](/images/gateway/mqtt-connector/security-advanced-certificates-subsection-1-ce.png) \ No newline at end of file diff --git a/_includes/templates/iot-gateway/mqtt-connector/security-subsection-advanced.md b/_includes/templates/iot-gateway/mqtt-connector/security-subsection-advanced.md deleted file mode 100644 index 70a6dc9959..0000000000 --- a/_includes/templates/iot-gateway/mqtt-connector/security-subsection-advanced.md +++ /dev/null @@ -1,8 +0,0 @@ -Now select the security type: - -{% capture mqttsecurityadvancedsubsection %} -AnonymousNo security%,%anonymous%,%templates/iot-gateway/mqtt-connector/security-config-anonymous.md%br% -BasicRecommended%,%basic%,%templates/iot-gateway/mqtt-connector/security-config-basic.md%br% -CertificatesFor advanced security%,%certificates%,%templates/iot-gateway/mqtt-connector/security-config-certificates.md{% endcapture %} - -{% include content-toggle.liquid content-toggle-id="mqttsecurityadvancedsubsection" toggle-spec=mqttsecurityadvancedsubsection %} \ No newline at end of file diff --git a/_includes/templates/iot-gateway/mqtt-connector/security-subsection-anonymous.md b/_includes/templates/iot-gateway/mqtt-connector/security-subsection-anonymous.md new file mode 100644 index 0000000000..34b83c0d22 --- /dev/null +++ b/_includes/templates/iot-gateway/mqtt-connector/security-subsection-anonymous.md @@ -0,0 +1,11 @@ +**Anonymous** is the simplest option: no credentials are required to publish/subscribe on the MQTT broker. +It can be useful for testing
(e.g., public test brokers), +but not recommended for production because it allows unattended access.. + +{% assign securityBasic = ' + === + image: /images/gateway/mqtt-connector/security-basic-anonymous-subsection-1-ce.png, + ' +%} + +{% include images-gallery.liquid showListImageTitles="true" imageCollection=securityBasic %} \ No newline at end of file diff --git a/_includes/templates/iot-gateway/mqtt-connector/security-subsection-basic.md b/_includes/templates/iot-gateway/mqtt-connector/security-subsection-basic.md index d050591ff2..7f3a236c1c 100644 --- a/_includes/templates/iot-gateway/mqtt-connector/security-subsection-basic.md +++ b/_includes/templates/iot-gateway/mqtt-connector/security-subsection-basic.md @@ -1,8 +1,11 @@ -Now select the security type: +**Basic** authentication option uses a **username** and **password** configured on the MQTT broker. +It’s a good default for most setups - just use strong, unique credentials. For stronger identity and mutual verification, +consider certificate-based authentication. -{% capture mqttsecuritybasicsubsection %} -AnonymousNo security%,%anonymous%,%templates/iot-gateway/mqtt-connector/security-basic-anonymous-subsection.md%br% -BasicRecommended%,%basic%,%templates/iot-gateway/mqtt-connector/security-basic-basic-subsection.md%br% -CertificatesFor advanced security%,%certificates%,%templates/iot-gateway/mqtt-connector/security-basic-certificates-subsection.md{% endcapture %} +{% assign securityBasic = ' + === + image: /images/gateway/mqtt-connector/security-basic-basic-subsection-1-ce.png, + ' +%} -{% include content-toggle.liquid content-toggle-id="mqttsecuritybasicsubsection" toggle-spec=mqttsecuritybasicsubsection %} \ No newline at end of file +{% include images-gallery.liquid showListImageTitles="true" imageCollection=securityBasic %} \ No newline at end of file diff --git a/_includes/templates/iot-gateway/mqtt-connector/security-subsection-certificates.md b/_includes/templates/iot-gateway/mqtt-connector/security-subsection-certificates.md new file mode 100644 index 0000000000..38d2090fb2 --- /dev/null +++ b/_includes/templates/iot-gateway/mqtt-connector/security-subsection-certificates.md @@ -0,0 +1,12 @@ +**Certificate-based authentication** uses TLS so the gateway and broker verify each other. +Set the **Path to CA certificate file** to your CA certificate (to trust the broker), **Path to client certificate file** +to the gateway’s client certificate, and **Path to private key file** to its private key (so the broker can authenticate the gateway). +Use the broker’s TLS port (typically 8883) for encrypted, production-grade security. + +{% assign securityBasic = ' + === + image: /images/gateway/mqtt-connector/security-basic-certificates-subsection-1-ce.png, + ' +%} + +{% include images-gallery.liquid showListImageTitles="true" imageCollection=securityBasic %} \ No newline at end of file diff --git a/_includes/templates/iot-gateway/mqtt-connector/server-side-rpc-commands-subsection-advanced.md b/_includes/templates/iot-gateway/mqtt-connector/server-side-rpc-commands-subsection-advanced.md deleted file mode 100644 index 4fd560dfcc..0000000000 --- a/_includes/templates/iot-gateway/mqtt-connector/server-side-rpc-commands-subsection-advanced.md +++ /dev/null @@ -1,65 +0,0 @@ - -This section in configuration file looks like: - -```json -"serverSideRpc": [ - { - "type": "twoWay", - "deviceNameFilter": ".*", - "methodFilter": "echo", - "requestTopicExpression": "sensor/${deviceName}/request/${methodName}/${requestId}", - "responseTopicExpression": "sensor/${deviceName}/response/${methodName}/${requestId}", - "responseTopicQoS": 1, - "responseTimeout": 10000, - "valueExpression": "${params}" - }, - { - "type": "oneWay", - "deviceNameFilter": ".*", - "methodFilter": "no-reply", - "requestTopicExpression": "sensor/${deviceName}/request/${methodName}/${requestId}", - "valueExpression": "${params}" - } -] -``` -{: .copy-code} - -![image](/images/gateway/mqtt-connector/server-side-rpc-commands-advanced-1-ce.png) - -| **Parameter** | **Default value** | **Description** | -|:------------------------|:-------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------ -| deviceNameFilter | **.\*** | Regular expression device name filter, is used to determine, which function to execute. | -| methodFilter | **echo** | Regular expression method name filter, is used to determine, which function to execute. | -| requestTopicExpression | **sensor/${deviceName}/request/${methodName}/${requestId}** | JSON-path expression, is used for creating topic address to send RPC request. | -| responseTopicExpression | **sensor/${deviceName}/response/${methodName}/${requestId}** | JSON-path expression, is used for creating topic address to subscribe for response message. | -| responseTimeout | **10000** | Value in milliseconds. If there is no response within this period after sending the request, gateway will unsubscribe from the response topic. | -| valueExpression | **${params}** | JSON-path expression, is used for creating data for sending to broker. | -| --- - -{% capture methodFilterOptions %} -There are 2 options for RPC request: -1. **With a response** -- If the configuration includes a responseTopicExpression, the gateway will attempt to subscribe to it and wait for a response. -2. **Without a response** -- If the configuration does not include a responseTopicExpression, the gateway will simply send the message without waiting for a response. - {% endcapture %} - {% include templates/info-banner.md content=methodFilterOptions %} - -You can use **deviceNameFilter** and **methodFilter** to apply different mapping rules for various devices/methods. -Once Gateway receives RPC request from the server to the device, it will publish the corresponding message based on **requestTopicExpression** and **valueExpression**. -In case you expect a reply to the request from the device, you should also specify **responseTopicExpression** and **responseTimeout**. -The Gateway will subscribe to the "response" topic and wait for a device reply until "responseTimeout" is reached (in milliseconds). - -Here is an example of an RPC request (rpc-request.json) that needs to be sent from the server: - -```json -{ - "method": "echo", - "params": { - "message": "Hello!" - } -} -``` - -Also, every telemetry and attribute parameter has built-in GET and SET RPC methods out of the box, so you don’t need to configure -it manually. To use them, make sure you set all the required parameters (in the case of MQTT Connector, these are the following: -**requestTopicExpression**, **responseTopicExpression**, **responseTimeout**, **valueExpression**). -See [the guide](/docs/iot-gateway/guides/how-to-use-get-set-rpc-methods). \ No newline at end of file diff --git a/_includes/templates/iot-gateway/mqtt-connector/server-side-rpc-commands-subsection-basic.md b/_includes/templates/iot-gateway/mqtt-connector/server-side-rpc-commands-subsection-basic.md deleted file mode 100644 index 1af9dd0d90..0000000000 --- a/_includes/templates/iot-gateway/mqtt-connector/server-side-rpc-commands-subsection-basic.md +++ /dev/null @@ -1,45 +0,0 @@ -There are 2 options for RPC request: -**With a response** -- If the configuration includes a responseTopicExpression, the gateway will attempt to subscribe to it and wait for a response. - -To adding new requests mapping, navigate to the "Requests mapping" tab and click the "plus" icon. -In the open modal window, select the "RPC command" request type, and set a device name filter, method filter, request topic expression, value expression, response topic expression, response topic QoS and response timeout. Then, click "Add". - -![image](/images/gateway/mqtt-connector/server-side-rpc-commands-basic-1-ce.png) - -**Without a response** -- If the configuration does not include a responseTopicExpression, the gateway will simply send the message without waiting for a response. - -To adding new requests mapping, navigate to the "Requests mapping" tab and click the "plus" icon. -In the open modal window, select the "RPC command" request type, toggle "Without response" option, and set a device name filter, method filter, and value expression. Then, click "Add". - -![image](/images/gateway/mqtt-connector/server-side-rpc-commands-basic-2-ce.png) - -| **Parameter** | **Default value** | **Description** | -|:------------------------|:-------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------ -| deviceNameFilter | **.\*** | Regular expression device name filter, is used to determine, which function to execute. | -| methodFilter | **echo** | Regular expression method name filter, is used to determine, which function to execute. | -| requestTopicExpression | **sensor/${deviceName}/request/${methodName}/${requestId}** | JSON-path expression, is used for creating topic address to send RPC request. | -| responseTopicExpression | **sensor/${deviceName}/response/${methodName}/${requestId}** | JSON-path expression, is used for creating topic address to subscribe for response message. | -| responseTimeout | **10000** | Value in milliseconds. If there is no response within this period after sending the request, gateway will unsubscribe from the response topic. | -| valueExpression | **${params}** | JSON-path expression, is used for creating data for sending to broker. | -| --- - -You can use **device name filter** and **method filter** to apply different mapping rules for various devices/methods. -Once Gateway receives RPC request from the server to the device, it will publish the corresponding message based on **request topic expression** and **value expression**. -In case you expect a reply to the request from the device, you should also specify **response topic expression** and **response timeout**. -The Gateway will subscribe to the "response" topic and wait for a device reply until "responseTimeout" is reached (in milliseconds). - -Here is an example of an RPC request (rpc-request.json) that needs to be sent from the server: - -```json -{ - "method": "echo", - "params": { - "message": "Hello!" - } -} -``` - -Also, every telemetry and attribute parameter has built-in GET and SET RPC methods out of the box, so you don’t need to configure -it manually. To use them, make sure you set all the required parameters (in the case of MQTT Connector, these are the following: -**request topic expression**, **response topic expression**, **response timeout**, **value expression**). -See [the guide](/docs/iot-gateway/guides/how-to-use-get-set-rpc-methods). \ No newline at end of file diff --git a/_includes/templates/iot-gateway/mqtt-connector/workers-settings-section-advanced.md b/_includes/templates/iot-gateway/mqtt-connector/workers-settings-section-advanced.md deleted file mode 100644 index e9fe8ca5b1..0000000000 --- a/_includes/templates/iot-gateway/mqtt-connector/workers-settings-section-advanced.md +++ /dev/null @@ -1,4 +0,0 @@ -![image](/images/gateway/mqtt-connector/workers-settings-advanced-1-ce.png) - -- **maxNumberOfWorkers** is a maximal number of workers thread for converters (amount of workers changes dynamically, depending on load). Recommended amount 50-100; -- **maxMessageNumberPerWorker** is a maximal messages count that will be in queue for each converter worker. \ No newline at end of file diff --git a/_includes/templates/iot-gateway/mqtt-connector/workers-settings-section-basic.md b/_includes/templates/iot-gateway/mqtt-connector/workers-settings-section-basic.md index 4f70ab5c2f..a4dd1d32c8 100644 --- a/_includes/templates/iot-gateway/mqtt-connector/workers-settings-section-basic.md +++ b/_includes/templates/iot-gateway/mqtt-connector/workers-settings-section-basic.md @@ -1,5 +1,9 @@ ![image](/images/gateway/mqtt-connector/workers-settings-1-ce.png) -**Max number of workers** is a maximal number of workers thread for converters (amount of workers changes dynamically, depending on load). Recommended amount 50-100. +1. **Max messages queue per worker**
+How many MQTT messages one worker handles in a single turn before letting others run. +Bigger number = higher throughput; smaller = lower latency. Example: ~100 for heavy telemetry, ~10–20 for fast RPC. -**Max messages queue per worker** is a maximal messages count that will be in queue for each converter worker. \ No newline at end of file +2. **Max number of workers**
+How many workers run at the same time. More workers use more CPU cores but can cause contention if too high. +Start near your CPU core count and tweak based on backlog and CPU. \ No newline at end of file diff --git a/_includes/templates/iot-gateway/opcua-connector/examples/shared-attributes-rpc/shared-attributes-with-absolute-path.md b/_includes/templates/iot-gateway/opcua-connector/examples/shared-attributes-rpc/shared-attributes-with-absolute-path.md index 25070b82ba..e5bbc87756 100644 --- a/_includes/templates/iot-gateway/opcua-connector/examples/shared-attributes-rpc/shared-attributes-with-absolute-path.md +++ b/_includes/templates/iot-gateway/opcua-connector/examples/shared-attributes-rpc/shared-attributes-with-absolute-path.md @@ -18,7 +18,7 @@ Let's add an attribute update to our configuration. For this purpose, follow the {% assign attributeUpdatesAbsolutePath = ' === image: /images/gateway/opc-ua-connector/examples/device-name-and-profile-absolute-path-1.png, - title: Go to "**Entities**" → "**Gateways**" in the right sidebar and select your gateway. + title: Go to "**Entities**" → "**Gateways**" in the left sidebar and select your gateway. === image: /images/gateway/opc-ua-connector/examples/device-name-and-profile-absolute-path-2.png, title: Click on the "**Connectors configuration**" button on the right side menu. diff --git a/docs/iot-gateway/config/mqtt.md b/docs/iot-gateway/config/mqtt.md index 87ac34ef46..880391c90a 100644 --- a/docs/iot-gateway/config/mqtt.md +++ b/docs/iot-gateway/config/mqtt.md @@ -11,585 +11,969 @@ redirect_from: * TOC {:toc} -This guide will help you to get familiar with MQTT Connector configuration for ThingsBoard IoT Gateway. -Use [general configuration](/docs/iot-gateway/configuration/) to enable this Connector. -The purpose of this Connector is to connect to an external MQTT broker and subscribe to data feed from devices. -The connector is also able to push data to MQTT brokers based on the updates/commands from ThingsBoard. +## Overview -This connector is useful when you have local MQTT broker in your facility or corporate network, and you would like to push data from this broker to ThingsBoard. +This documentation will help you set up the MQTT connector for the ThingsBoard IoT Gateway. We'll explain the configuration +parameters in simple terms to make it easy for you to understand and follow. The MQTT(Message Queuing Telemetry Transport) +is a lightweight publish-subscribe, machine-to-machine network protocol that is widely used for connections with remote +locations with devices that have resource constraints or network transfer rate. +Use [general configuration](/docs/iot-gateway/configuration/){:target="_blank"} to enable this connector. -We will describe connector configuration file below. +Also, if you are new to ThingsBoard IoT Gateway, we recommend you to read the [Getting Started](/docs/iot-gateway/getting-started/?connectorsCreation=mqtt){:target="_blank"} +guide to understand the basic concepts of ThingsBoard IoT Gateway and how it works with MQTT protocol. + +The connector can be configured via the user interface form, which helps you set up a connection to an MQTT broker and +read/write data by subscribing/publishing to MQTT topics, that can be defined statically or generated on the fly. +Let's look at all the available settings and explain each one clearly. +This will help you understand how everything works. {% capture difference %} **Please note:** -If you are new to IoT Gateway, use the "Basic" configuration mode. If you are familiar with configuring IoT Gateway, you can use the "Advanced" configuration mode. +To access the actual UI for the gateway - you need to a have connected gateway before adding a connector. Otherwise, you will see the old UI. {% endcapture %} {% include templates/info-banner.md content=difference %} -## Connector configuration +## Configuration modes + +The MQTT connector can be configured in two modes: **Basic** and **Advanced**. +- **Basic** mode is designed for users who are new to ThingsBoard IoT Gateway and want to quickly set up the connector with minimal configuration. It provides a simplified interface with essential settings. +- **Advanced** mode is intended for experienced users who need more control over the configuration. It offers additional options and flexibility for advanced use cases. + +{% capture difference %} +**Please note:** +If you are new to IoT Gateway, use the "Basic" configuration mode. If you are familiar with configuring IoT Gateway, +you can use the "Advanced" configuration mode. +{% endcapture %} +{% include templates/info-banner.md content=difference %} -Connector configuration is a UI form that contains information about how to connect to external MQTT broker, what topics to use when subscribing to data feed and how to process the data. -Let's take a comprehensive look at all the possible settings. We will go through each option in detail to ensure that we thoroughly understand their functions and implications. -By doing so, we can make well-informed decisions about which settings will best suit our needs and preferences. +You can switch between these modes using the toggle button at the top of the configuration page: -## Section "General" +![image.png](/images/gateway/mqtt-connector/mqtt-modes-toggle.png) -This configuration section contains general connector settings, such as: +## General settings -- Name - connector name for logs and saving to persistent devices; -- Logs configuration: - - Enable remote logging - enabling remote logging for connector; - - Logging level - logging level for local and remote logs: INFO, DEBUG, WARNING, ERROR, CRITICAL, NONE; -- Send data only on change - sending only if data changed from last check, if not – data will be sent after every check. +{% include /templates/iot-gateway/connector-commons/general-settings.md %} ![image](/images/gateway/mqtt-connector/general-basic-section-1-ce.png) {% capture difference %} -The settings are the same for both the basic and advanced configurations. +The General tab in settings is the same for both the basic and advanced configurations. {% endcapture %} {% include templates/info-banner.md content=difference %} -## Section "Connection to broker" +## Connection settings -Section "Connection to broker" offers detailed connection configuration options and contains several important fields, including host, port, MQTT version, client ID, and security settings. -The host field specifies the address of the broker, while the port field indicates the communication port. -The MQTT version field ensures compatibility with the protocol version being used. -The client ID uniquely identifies the client, and the security settings provides configuration for client authorization at MQTT Broker. +Connection settings how the MQTT connector establishes and maintains communication with the MQTT broker. +These settings configure the basic connection parameters, the MQTT protocol version used, and the corresponding security and authentication modes. -{% capture mqttconnectiontobrokersection %} -Basic%,%basic%,%templates/iot-gateway/mqtt-connector/connection-to-broker-basic-section.md%br% -Advanced%,%advanced%,%templates/iot-gateway/mqtt-connector/connection-to-broker-advanced-section.md{% endcapture %} +### Connection to broker -{% include content-toggle.liquid content-toggle-id="mqttconnectiontobrokersection" toggle-spec=mqttconnectiontobrokersection %} +This subsection specifies the target MQTT broker and how the gateway interacts with it. It includes the broker's host, +port, mqtt version protocol and client id. -### Subsection "Security" +{% include /templates/iot-gateway/mqtt-connector/mqtt-basic-section.md %} -Subsection "Security" provides configuration for client authorization at MQTT Broker. +### Security -Firstly, select basic or advanced MQTT configuration: +MQTT broker connections offer three distinct security types: Anonymous, Basic, Certificates. -{% capture mqttsecuritysubsection %} -Basic%,%basic%,%templates/iot-gateway/mqtt-connector/security-subsection-basic.md%br% -Advanced%,%advanced%,%templates/iot-gateway/mqtt-connector/security-subsection-advanced.md{% endcapture %} +{% capture mqtt-security-examples %} +Anonymous %,%anonymous%,%templates/iot-gateway/mqtt-connector/security-subsection-anonymous.md%br% +Basic %,%basic%,%templates/iot-gateway/mqtt-connector/security-subsection-basic.md%br% +Certificates %,%certificates%,%templates/iot-gateway/mqtt-connector/security-subsection-certificates.md{% endcapture %} +{% include content-toggle.liquid content-toggle-id="mqtt-security-examples" toggle-spec=mqtt-security-examples %} -{% include content-toggle.liquid content-toggle-id="mqttsecuritysubsection" toggle-spec=mqttsecuritysubsection %} +{% capture difference %} +All configuration parameters list for each authentication mode, and their detailed description can be found in the +[Advanced configuration](/docs/iot-gateway/config/mqtt/#advanced-configuration) section. +{% endcapture %} +{% include templates/info-banner.md content=difference %} -## Section "Data mapping" +## Data mapping + +**Data Mapping** lets you configure the topic/topics the gateway subscribes to for device creation and incoming data handling. +You can generate topic/topics and device names on the fly, and choose what data is sent +as device attributes or telemetry. This section provides the essential settings for flexible device and data management. + +The following parameters configure the topic(s) the gateway subscribes to for data feed, device creation (name and profile), +and the reporting strategy: +- **Topic filter** - The topic/topics the gateway will subscribe to that is used for data feed .The **Topic filter** supports special symbols: ‘#’ and ‘+’ +*wildcards* (more information how you may use them for matching topic patterns [Additional information](/docs/iot-gateway/config/mqtt/#wildcard-usage) section). +- Also MQTT connector supports shared subscriptions to create one you need to add `$share/` as a prefix for **Topic filter** and shared subscription group name (more information how you may use it [Additional information](/docs/iot-gateway/config/mqtt/#shared-subscriptions) section) and problems. +that may appear while using them [Shared subscriptions limitations](/docs/iot-gateway/config/mqtt/#shared-subscriptions-limitations). +- **QoS** - *MQTT Quality of Service* is an agreement between the message sender and receiver that defines the level of delivery guarantee for a specific message. (0-At most once, 1-At least once, 2-Exactly once) +- **Report strategy** - strategy for sending data to ThingsBoard: + - **Report period** - period for sending data to ThingsBoard in milliseconds; + - **Type** - type of the report strategy: + - **On report period** - sends data to ThingsBoard after the report period; + - **On value change** - sends data to ThingsBoard when the value changes; + - **On value change or report period** - sends data to ThingsBoard when the value changes or after the report period; + - **On received** - sends data to ThingsBoard after receiving data from the device (default strategy). + +### Data conversion + +- **Payload type** - The incoming data type that will be processed as `JSON`, `Bytes`, `Custom` (more information about supported Payload types see in the [Additional information](/docs/iot-gateway/config/mqtt/#convertor-types) *Convertor types section* ). +- **Device Name** - The name of the device in ThingsBoard. It can be parsed from `Message`, `Topic`, `Constant` (more information about sources with screenshot examples can be found in the [Usage examples](/docs/iot-gateway/config/mqtt/#usage-examples) section). +- **Device Profile name** - The device profile in ThingsBoard. It can be parsed from `Message`, `Topic`, `Constant` (more information about sources with screenshot examples can be found in the [Usage examples](/docs/iot-gateway/config/mqtt/#usage-examples) section). + +To add a new device, use the following steps: + +{% assign dataMapping = ' + === + image: /images/gateway/mqtt-connector/data-mapping-1.png, + title: Click the **+ Add mapping** button. + === + image: /images/gateway/mqtt-connector/data-mapping-2.png, + title: Provide the following fields for the Data mapping section in the opened modal window: Topic filter, QoS, Payload type (can be `JSON`, `Bytes` or `Custom`). + === + image: /images/gateway/mqtt-connector/data-mapping-3.png, + title: Provide the following fields in the Data conversion subsection of the opened modal window: Name and Profile name (can be sourced from `Message`, `Topic` or `Constant`). + ' +%} + +{% include images-gallery.liquid showListImageTitles="true" imageCollection=dataMapping %} -This configuration section contains an array of topics that the gateway will subscribe to after connecting to the broker, along with settings about processing incoming messages (converter). +{% capture difference %} +Additional information about the report strategy can be found [here](/docs/iot-gateway/features-overview/report-strategy){:target="_blank"}. -Select basic or advanced MQTT configuration: +All configuration parameters list, and their detailed description can be found in the +[Advanced configuration](/docs/iot-gateway/config/mqtt/#device-mapping) section. -{% capture mqttdatamappingsubsection %} -Basic%,%basic%,%templates/iot-gateway/mqtt-connector/data-mapping-subsection-basic.md%br% -Advanced%,%advanced%,%templates/iot-gateway/mqtt-connector/data-mapping-subsection-advanced.md{% endcapture %} +More usage examples can be found in the [Usage examples](/docs/iot-gateway/config/mqtt/#usage-examples) section. +{% endcapture %} +{% include templates/info-banner.md content=difference %} -{% include content-toggle.liquid content-toggle-id="mqttdatamappingsubsection" toggle-spec=mqttdatamappingsubsection %} -Let's assume we would like to subscribe and process the following data from Thermometer device: +### Attributes and Time series - - - - - - - - - - - - - - - - - - - - - - -
Example NameTopicTopic FilterPayloadComments
Example 1sensor/datasensor/data{"serialNumber": "SN-001", "sensorType": "Thermometer", "sensorModel": "T1000", "temp": 42, "hum": 58}Device Name is part of the payload
Example 2sensor/SN-001/datasensor/+/data{"sensorType": "Thermometer", "sensorModel": "T1000", "temp": 42, "hum": 58}Device Name is part of the topic
+The configuration in this subsection provides settings for processing data from MQTT topic/topics. These settings will be +interpreted in ThingsBoard platform instance as attributes/time series of the device. -In this case the following messages are valid: +The following parameters are used to configure device attributes and time series: +- **Key** - the key of the attribute/time series in ThingsBoard. It can be specified as a static value. +- **Type** - the type of attribute/time series field (It could be one of the following `string`, `boolean`, `integer`, `double` or `Raw` if the **Payload type** `Bytes`.): +- **Value** - the value of the attribute/time series that will be sent to the platform device. It should be specified depending on the selected **Payload type** (`Bytes`, `JSON`, `CUSTOM`). -Example 1: +{% capture difference %} +All configuration parameters list, and their detailed description can be found in the +[Advanced configuration](/docs/iot-gateway/config/mqtt/#device-attributes-and-timeseries) section. -```bash -mosquitto_pub -h YOUR_MQTT_BROKER_HOST -p YOUR_MQTT_BROKER_PORT -t "sensor/data" -m '{"serialNumber": "SN-001", "sensorType": "Thermometer", "sensorModel": "T1000", "temp": 42, "hum": 58}' -``` -{: .copy-code} +More usage examples can be found in the [Usage examples](/docs/iot-gateway/config/mqtt/#usage-examples) section. +{% endcapture %} +{% include templates/info-banner.md content=difference %} -Example 2: +![image](/images/gateway/mqtt-connector/mqtt-attributes-timeseries-overview.png) -```bash -mosquitto_pub -h YOUR_MQTT_BROKER_HOST -p YOUR_MQTT_BROKER_PORT -t "sensor/SN-001/data" -m '{"sensorType": "Thermometer", "sensorModel": "T1000", "temp": 42, "hum": 58}' -``` -{: .copy-code} +{% include /templates/iot-gateway/mqtt-connector/mqtt-attr-and-time-series-basic-section.md %} -Now let's review how we can configure JSON converter to parse this data. +### Usage examples -### Subsection "Data conversion" +{% capture difference %} +Note: If you are running the gateway in Docker and using our MQTT Demo broker from [Getting Started](/docs/iot-gateway/getting-started/?connectorsCreation=mqtt){:target="_blank"} +, you must use `host.docker.internal` as the host. +{% endcapture %} +{% include templates/info-banner.md content=difference %} -This subsection contains configurations for processing incoming messages. +{% capture mqtt-attributes-timeseries-examples %} +Device name/profile from message and JSON payload%,%devicenameandprofilemessageandjson%,%templates/iot-gateway/mqtt-connector/examples/time-series-and-attributes/device-name-and-profile-message-json.md%br% +Device name/profile from topic and JSON payload%,%devicenameandprofiletopiconstantandjson%,%templates/iot-gateway/mqtt-connector/examples/time-series-and-attributes/device-name-and-profile-topic-and-constant-json.md%br% +Device name/profile from message and BYTES payload%,%devicenameandprofilemessageconstantantbytes%,%templates/iot-gateway/mqtt-connector/examples/time-series-and-attributes/device-name-and-profile-message-and-constant-bytes.md%br% +Attributes/Time series with JSON Path%,%attributestimeseriesjsonpath%,%templates/iot-gateway/mqtt-connector/examples/time-series-and-attributes/attributes-time-series-json-path.md%br% +Attributes/Time series with Slices%,%attributestimeseriesslices%,%templates/iot-gateway/mqtt-connector/examples/time-series-and-attributes/attributes-time-series-bytes.md{% endcapture %} +{% include content-toggle.liquid content-toggle-id="mqtt-attributes-timeseries-examples" toggle-spec=mqtt-attributes-timeseries-examples %} -The types of MQTT converters are as follows: -- JSON – Default converter; -- Bytes – Raw default converter; -- Custom – Custom converter (You can write it yourself, and it will be used to convert incoming data from the broker). +## Requests mapping -Select the MQTT configuration you are using: +The **Requests mapping** section allows you to configure how the ThingsBoard platform instance will interact with the +devices. That is, how the platform will request data from the devices, how it will update/request device attributes, and how +it will send RPC commands to the devices. -{% capture mqttdataconversionsubsection %} -Basic%,%basic%,%templates/iot-gateway/mqtt-connector/data-conversion-subsection-basic.md%br% -Advanced%,%advanced%,%templates/iot-gateway/mqtt-connector/data-conversion-subsection-advanced.md{% endcapture %} +MQTT connector supports the following requests mapping: +- **Connect requests** - tell the ThingsBoard platform that a device is online on the MQTT broker by publishing a “connect” message the Gateway listens for. +- **Disconnect requests** - inform ThingsBoard (via the Gateway) that a device is offline by publishing a disconnect message to the configured topic. +- **Attribute updates** - push shared attributes from ThingsBoard to the device by publishing an update message to the configured topic via the Gateway. +- **Attribute requests** - the device asks ThingsBoard for attributes by publishing a request to a specific topic; the Gateway replies on the response topic with the values. +- **RPC methods** - allows sending RPC commands to devices. + MQTT connector supports different types of RPC methods, such as: -{% include content-toggle.liquid content-toggle-id="mqttdataconversionsubsection" toggle-spec=mqttdataconversionsubsection %} + - **Reserved GET/SET methods** - these methods are automatically created for each attribute and time series parameter. + You can use them to get or set values of the device. For every configured attribute or timeseries key, the connector exposes built-in RPCs: -**Now let's review an example of sending data from "SN-001" thermometer device.** + - `get` - reads the current value (as the connector can provide/resolve it) + - `set` - sets/updates the value (the connector applies or forwards it) -Let’s assume MQTT broker is installed locally on your server. + These do not require extra mapping, because they are managed by the connector and the result is returned to ThingsBoard. + The command will be processed by the connector, and the result will be sent back to the ThingsBoard platform instance. -Use terminal to simulate sending message from the device to the MQTT broker: -```bash -mosquitto_pub -h 127.0.0.1 -p 1883 -t "sensor/data" -m '{"serialNumber": "SN-001", "sensorType": "Thermometer", "sensorModel": "T1000", "temp": 42, "hum": 58}' -``` -{: .copy-code} + - **Configurable RPC methods to device** - These methods allow you to configure custom RPC commands in connector configuration that can be sent to the devices. -{:refdef: style="text-align: center;"} -![image](/images/gateway/mqtt-message-1.png) -{: refdef} + - **One Way and Two Way RPC methods** - All RPC's can be two types: -To use a configurable format for a timeseries entry, include a datetime string in the field defined by the *tsField* parameter. For example: -```bash -mosquitto_pub -h 127.0.0.1 -p 1883 -t "sensor/data" -m '{"serialNumber": "SN-001", "sensorType": "Thermometer", "sensorModel": "T1000", "temp": 42, "hum": 58, "timestampField":"10.11.24 10:10:10.252"}' -``` -{: .copy-code} + - `One Way` - if you do not want to get a response back from a device + - `Two Way` - if you do want to get a response back from a device -{:refdef: style="text-align: center;"} -![image](/images/gateway/mqtt-message-with-timestampField.png) -{: refdef} +### Connect request -The device will be created and displayed in ThingsBoard based on the passed parameters. -{:refdef: style="text-align: center;"} -![image](/images/gateway/mqtt-created-device-1.png) -{: refdef} +Connect request is used for sending a message to the Gateway indicating that a device has connected, so the device can be marked as online on the platform. -{:refdef: style="text-align: center;"} -![image](/images/gateway/mqtt-created-device-2.png) -{: refdef} +Suppose we have a scenario where the device connects to the MQTT broker but doesn't send any telemetry data. By default, after 10 minutes of inactivity, the device becomes offline for the ThingsBoard platform instance. +However, we may want to be able to send RPC/attribute updates to this device even if it does not send any telemetry data. +In this case, the platform needs to know if the target device is connected and what gateway or session is used to connect the device at the moment. +If your device is constantly sending telemetry data, you may skip this section - ThingsBoard already knows how to push notifications. -## Requests mapping +The following parameters are used to configure connect requests: +- **Request type** - the type of the request sent to ThingsBoard (set to "Connect request"). +- **Topic filter** - the topic/topics the gateway will subscribe to and wait for device to publish the connect request. The **Topic filter** supports special symbols: ‘#’ and ‘+’ +*wildcards* (more information how you may use them for matching topic patterns [Additional information](/docs/iot-gateway/config/mqtt/#wildcard-usage) section). +- **Name** - the name of the device in ThingsBoard to which the request will be sent to. It can be parsed from `Message`, `Topic`, `Constant`, (more information about sources with screenshot examples can be found in the [Usage examples](/docs/iot-gateway/config/mqtt/#usage-examples-1) section). +- **Profile name** - the name of the device in ThingsBoard to which the request will be sent to. It can be parsed from `Message`, `Topic`, `Constant` (more information about sources with screenshot examples can be found in the [Usage examples](/docs/iot-gateway/config/mqtt/#usage-examples-1) section). -This section of the configuration outlines an array that includes all the supported requests for both the gateway and ThingsBoard: +{% capture difference %} +All configuration parameters list, and their detailed description can be found in the +[Advanced configuration](/docs/iot-gateway/config/mqtt/#device-connect-requests) section. -- connect requests; -- disconnect requests; -- attribute requests; -- attribute updates; -- RPC commands. +More usage examples can be found in the [Usage examples](/docs/iot-gateway/config/mqtt/#usage-examples-1) section. +{% endcapture %} +{% include templates/info-banner.md content=difference %} -Firstly, select basic or advanced MQTT configuration: +![image](/images/gateway/mqtt-connector/mqtt-connect-request-overview.png) -{% capture mqttrequestsmappingsection %} -Basic%,%basic%,%templates/iot-gateway/mqtt-connector/requests-mapping-section-basic.md%br% -Advanced%,%advanced%,%templates/iot-gateway/mqtt-connector/requests-mapping-section-advanced.md{% endcapture %} +{% include /templates/iot-gateway/mqtt-connector/device-connect-request-basic-section.md %} -{% include content-toggle.liquid content-toggle-id="mqttrequestsmappingsection" toggle-spec=mqttrequestsmappingsection %} +### Disconnect request -Below we go through all the supported requests for both Gateway and ThingsBoard. +Disconnect request is used for sending a message to the Gateway indicating that a device has disconnected, so the device can be marked as offline on the platform. -### Subsection "Connect request" +When a device disconnects from the MQTT broker, ThingsBoard needs to be notified to update the device's status and last disconnect time. +The disconnect request allows the gateway to inform ThingsBoard when a device disconnects from the MQTT broker. This information is stored as server attributes and can be used for monitoring device connectivity patterns, troubleshooting connection issues, or triggering workflows based on disconnect events. +If your device uses a clean disconnect process (rather than just timing out), configuring disconnect requests provides more immediate and accurate status updates in ThingsBoard. -ThingsBoard allows sending RPC commands and notifications about device attribute updates to the device. -But in order to send them, the platform needs to know if the target device is connected and what gateway or session is used to connect the device at the moment. If your device is constantly sending telemetry data - ThingsBoard already knows how to push notifications. -If your device just connects to MQTT broker and waits for commands/updates, you need to send a message to the Gateway and inform that device is connected to the broker. +The following parameters are used to configure disconnect requests: +- **Request type** - the type of the request sent to ThingsBoard (set to "Disconnect request"). +- **Topic filter** - the topic/topics the gateway will subscribe to and wait for device to publish the disconnect notification. The **Topic filter** supports special symbols: '#' and '+' +*wildcards* (more information how you may use them for matching topic patterns in the [Additional information](/docs/iot-gateway/config/mqtt/#wildcard-usage) section). +- **Name** - the name of the device in ThingsBoard to which the disconnect status will be applied. It can be parsed from `Message`, `Topic`, or `Constant` (more information about sources with screenshot examples can be found in the [Usage examples](/docs/iot-gateway/config/mqtt/#usage-examples-1) section). -Also, it is possible to configure where to get the device name: from the topic or from the message body. +{% capture difference %} +All configuration parameters list, and their detailed description can be found in the +[Advanced configuration](/docs/iot-gateway/config/mqtt/#device-disconnect-requests) section. -Select basic or advanced MQTT configuration: +More usage examples can be found in the [Usage examples](/docs/iot-gateway/config/mqtt/#usage-examples-1) section. +{% endcapture %} +{% include templates/info-banner.md content=difference %} -{% capture mqttconnectrequestsubsection %} -Basic%,%basic%,%templates/iot-gateway/mqtt-connector/connect-request-subsection-basic.md%br% -Advanced%,%advanced%,%templates/iot-gateway/mqtt-connector/connect-request-subsection-advanced.md{% endcapture %} +![image](/images/gateway/mqtt-connector/mqtt-message-disconnect.png) -{% include content-toggle.liquid content-toggle-id="mqttconnectrequestsubsection" toggle-spec=mqttconnectrequestsubsection %} +{% include /templates/iot-gateway/mqtt-connector/disconnect-request-subsection-basic.md %} -**Now let's review an example.** +### Attribute requests -Use a terminal to simulate sending a message from the device to the MQTT broker: +Attribute requests are used for requesting the values of its client-side or shared attributes from ThingsBoard via the Gateway. -```bash -mosquitto_pub -h 127.0.0.1 -p 1883 -t "sensor/connect" -m '{"serialNumber": "SN-001"}' -``` -{: .copy-code} +When a device needs to retrieve attribute values from ThingsBoard, it can send an attribute request. This allows devices to request shared or client attributes stored on the ThingsBoard platform. +When a device publishes a request to a specific topic, the gateway fetches the requested shared/client attributes from ThingsBoard and publishes a response to a response topic. -{:refdef: style="text-align: center;"} -![image](/images/gateway/mqtt-message-connect.png) -{: refdef} +The following parameters are used to configure attribute requests: +- **Request type** - the type of the request sent to ThingsBoard (set to "Attribute request"). +- **Topic filter** - the topic/topics that the gateway subscribes to for incoming requests. The **Topic filter** supports special symbols: `#` and `+` +*wildcards* (more information how you may use them for matching topic patterns in the [Additional information](/docs/iot-gateway/config/mqtt/#wildcard-usage) section). +- **Device name expression** - the name of the device in ThingsBoard from which to request the attributes. It can be parsed from `Message`, `Topic`, or `Constant` (more information about sources with screenshot examples can be found in the [Usage examples](/docs/iot-gateway/config/mqtt/#usage-examples-1) section). +- **Attribute name expression** - the name of the attribute in ThingsBoard to be requested. It can be parsed from `Message`, `Topic`, or `Constant` (more information about sources with screenshot examples can be found in the [Usage examples](/docs/iot-gateway/config/mqtt/#usage-examples-1) section). +- **Response value expression** - the format of the attribute value in the response message. It can be parsed from `Message`, `Topic`, or `Constant` (more information about sources with screenshot examples can be found in the [Usage examples](/docs/iot-gateway/config/mqtt/#usage-examples-1) section). +- **Response topic expression** - the topic/topics the gateway will publish the attribute response message to. It can be parsed from `Message`, `Topic`, or `Constant` (more information about sources with screenshot examples can be found in the [Usage examples](/docs/iot-gateway/config/mqtt/#usage-examples-1) section). +- **Retain** - whether the attribute response message should be retained by the MQTT broker. -Your ThingsBoard instance will get information from the broker about last connecting time of the device. You can see this information under the "Server attributes" scope in the "Attributes" tab. +{% capture difference %} -{:refdef: style="text-align: center;"} -![image](/images/gateway/mqtt-connect-device.png) -{: refdef} +All configuration parameters list, and their detailed description can be found in the +[Advanced configuration](/docs/iot-gateway/config/mqtt/#device-attribute-requests) section. -### Subsection "Disconnect request" +More usage examples can be found in the [Usage examples](/docs/iot-gateway/config/mqtt/#usage-examples-1) section. +{% endcapture %} +{% include templates/info-banner.md content=difference %} -This configuration section is optional. -Configuration, provided in this section will be used to get information from the broker about disconnecting device. -If your device just disconnects from MQTT broker and waits for commands/updates, you need to send a message to the Gateway and inform it that device is disconnected from the broker. +![image](/images/gateway/mqtt-connector/mqtt-message-attribute-requests-1.png) -Select basic or advanced MQTT configuration: +![image](/images/gateway/mqtt-connector/mqtt-message-attribute-requests-2.png) -{% capture mqttdisconnectrequestsubsection %} -Basic%,%basic%,%templates/iot-gateway/mqtt-connector/disconnect-request-subsection-basic.md%br% -Advanced%,%advanced%,%templates/iot-gateway/mqtt-connector/disconnect-request-subsection-advanced.md{% endcapture %} +{% include /templates/iot-gateway/mqtt-connector/attribute-request-subsection-basic.md %} -{% include content-toggle.liquid content-toggle-id="mqttdisconnectrequestsubsection" toggle-spec=mqttdisconnectrequestsubsection %} +### Attribute updates -**Now let's review an example.** +Attribute updates are used for provisioning or updating its client-side or shared attributes on ThingsBoard through the Gateway. -Use a terminal to simulate sending a message from the device to MQTT broker: +You can treat this as a remote configuration for devices, enabling them to request +shared attributes from ThingsBoard. See [user guide](/docs/user-guide/attributes/){:target="_blank"} for more details. -```bash -mosquitto_pub -h 127.0.0.1 -p 1883 -t "sensor/disconnect" -m '{"serialNumber": "SN-001"}' -``` -{: .copy-code} +The following parameters are used to configure attribute updates: +- **Request type** - the type of the request sent to ThingsBoard (set to "Attribute updates"). +- **Device name filter** - regular expression device name filter, used to determine which devices should receive attribute updates see [regex](#regular-expressions) (more information with screenshot examples can be found in the [Usage examples](/docs/iot-gateway/config/mqtt/#usage-examples-1) section. +- **Attribute filter** - regular expression attribute name filter, used to determine which attributes should be updated see [regex](#regular-expressions) (more information with screenshot examples can be found in the [Usage examples](/docs/iot-gateway/config/mqtt/#usage-examples-1) section). +- **Response value expression** - the format of the attribute value in the response message. It can be parsed from [json-path](#json-path) (more information with screenshot examples can be found in the [Usage examples](/docs/iot-gateway/config/mqtt/#usage-examples-1) section). +- **Response topic expression** - the topic/topics the gateway will publish the attribute response message to. It can be parsed from [json-path](#json-path) (more information with screenshot examples can be found in the [Usage examples](/docs/iot-gateway/config/mqtt/#usage-examples-1) section). +- **Retain** - whether the attribute response message should be retained by the MQTT broker. -{:refdef: style="text-align: center;"} -![image](/images/gateway/mqtt-message-disconnect.png) -{: refdef} +{% capture difference %} -Your ThingsBoard instance will get information from the broker about last disconnecting time of the device. You can see this information under the "Server attributes" scope in the "Attributes" tab. +All configuration parameters list, and their detailed description can be found in the +[Advanced configuration](/docs/iot-gateway/config/mqtt/#device-attribute-updates) section. -{:refdef: style="text-align: center;"} -![image](/images/gateway/mqtt-disconnect-device.png) -{: refdef} +More usage examples can be found in the [Usage examples](/docs/iot-gateway/config/mqtt/#usage-examples-1) section. +{% endcapture %} +{% include templates/info-banner.md content=difference %} -### Subsection "Attribute requests" +![image](/images/gateway/mqtt-connector/mqtt-message-attributes-update.png) -This configuration section is optional. +{% include /templates/iot-gateway/mqtt-connector/attribute-updates-subsection-basic.md %} -In order to request client-side or shared device attributes to ThingsBoard server node, Gateway allows sending -attribute requests. +### Server side RPC commands -Select basic or advanced MQTT configuration: +Server side RPC commands are used for delivering remote procedure call (RPC) commands from ThingsBoard to a device connected via the Gateway. -{% capture mqttattributerequestsubsection %} -Basic%,%basic%,%templates/iot-gateway/mqtt-connector/attribute-request-subsection-basic.md%br% -Advanced%,%advanced%,%templates/iot-gateway/mqtt-connector/attribute-request-subsection-advanced.md{% endcapture %} +ThingsBoard allows sending [RPC commands](https://thingsboard.io/docs/user-guide/rpc/) to devices connected directly to ThingsBoard or via Gateway. +The following parameters are used to configure RPC methods: +- **Request type** - set to RPC command. Can be with response (`Two Way`) or without response (`One Way`). +- **Device name filter** - regular expression device name filter, used to determine which devices should receive RPC commands. +- **Method filter** - regular expression method name filter, used to determine which RPC methods should be processed. +- **Request topic expression** - JSON-path expression used for creating topic address to send RPC request. +- **Value expression** - JSON-path expression used for creating data for sending to broker. +- **Response topic expression** (only for `Two Way`) - JSON-path expression used for creating topic address to subscribe for response message. +- **Response topic QoS** (only for `Two Way`) - quality of Service level for the response topic subscription. +- **Response timeout** (only for `Two Way`) - timeout in milliseconds. If there is no response within this period after sending the request, gateway will unsubscribe from the response topic. -{% include content-toggle.liquid content-toggle-id="mqttattributerequestsubsection" toggle-spec=mqttattributerequestsubsection %} +{% capture difference %} +All configuration parameters list, and their detailed description can be found in the +[Advanced configuration](/docs/iot-gateway/config/mqtt/#device-rpc-methods) section. -### Subsection "Attribute updates" +More usage examples can be found in the [Usage examples](/docs/iot-gateway/config/mqtt/#usage-examples-1) section. +{% endcapture %} +{% include templates/info-banner.md content=difference %} + +One way and Two way RPC overview: + +{% assign OneWayTwoWayRPC = ' + === + image: /images/gateway/mqtt-connector/mqtt-rpc-overview-1.png, + title: Two way RPC expects response from a topic. + === + image: /images/gateway/mqtt-connector/mqtt-rpc-overview-2.png, + title: Since Two way RPC expects response from a topic, we also need to specify **Response topic expression**, **Response topic Qos**, **Response timeout**. + === + image: /images/gateway/mqtt-connector/mqtt-rpc-overview-3.png, + title: One way RPC does not expect response from a topic. +' +%} + +{% include images-gallery.liquid showListImageTitles="true" imageCollection=OneWayTwoWayRPC %} -This configuration section is optional. -ThingsBoard allows to provision device attributes and fetch some of them from the device application. -You can treat this as a remote configuration for devices. Your devices are able to request shared attributes from ThingsBoard. -See [user guide](/docs/user-guide/attributes/) for more details. +{% include /templates/iot-gateway/mqtt-connector/device-rpc-basic-section.md %} -The "**attributeUpdates**" configuration allows configuring the format of the corresponding attribute request and response messages. +{% capture methodFilterOptions %} +Also, every telemetry and attribute parameter has built-in GET and SET RPC methods out of the box, so you don’t need to configure +it manually. See [the guide](/docs/iot-gateway/guides/how-to-use-get-set-rpc-methods). +{% endcapture %} +{% include templates/info-banner.md content=methodFilterOptions %} -Select basic or advanced MQTT configuration: -{% capture mqttattributerequestsubsection %} -Basic%,%basic%,%templates/iot-gateway/mqtt-connector/attribute-updates-subsection-basic.md%br% -Advanced%,%advanced%,%templates/iot-gateway/mqtt-connector/attribute-updates-subsection-advanced.md{% endcapture %} +### Usage examples -{% include content-toggle.liquid content-toggle-id="mqttattributerequestsubsection" toggle-spec=mqttattributerequestsubsection %} +{% capture difference %} +Note: If you are running the gateway in Docker and using our MQTT Demo broker from [Getting Started](/docs/iot-gateway/getting-started/?connectorsCreation=mqtt){:target="_blank"} +, you must use `host.docker.internal` as the host. +{% endcapture %} +{% include templates/info-banner.md content=difference %} -**Let's look at an example.** +{% capture mqtt-request-mapping-examples %} +Connect request %,%connectrequest%,%templates/iot-gateway/mqtt-connector/examples/request-mapping/connect-request.md%br% +Disconnect request %,%sharedabsolute%,%templates/iot-gateway/mqtt-connector/examples/request-mapping/disconnect-request.md%br% +Attribute request %,%sharedidentifier%,%templates/iot-gateway/mqtt-connector/examples/request-mapping/attribute-request.md%br% +Attribute update %,%rpctodevice%,%templates/iot-gateway/mqtt-connector/examples/request-mapping/attribute-update.md%br% +Reserved RPCs %,%reservedrpc%,%templates/iot-gateway/mqtt-connector/examples/request-mapping/reserved-rpc.md%br% +RPC to Device %,%rpctoconnector%,%templates/iot-gateway/mqtt-connector/examples/request-mapping/configurable-rpc.md{% endcapture %} +{% include content-toggle.liquid content-toggle-id="mqtt-request-mapping-examples" toggle-spec=mqtt-request-mapping-examples %} -Run the command below to start the *mosquitto_sub* client, subscribing to the topic "sensor/SN-001/firmwareVersion" of the local broker. Start waiting for new messages from ThingsBoard server to broker. +## Advanced configuration -```bash -mosquitto_sub -h 127.0.0.1 -p 1883 -t sensor/SN-001/firmwareVersion +The advanced configuration section provides a detailed overview of all available parameters for the MQTT connector. + +### Connection to broker + +The broker section defines the target MQTT broker and how the gateway interacts with it. + + +| **Parameter** | **Default value** | **Description** | +|:------------------------------------------|:------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| broker | | The broker object specifies the target mqtt broker and how the gateway interacts with it. | +| broker.host | | Hostname or ip address that will be used for establishing connection to MQTT broker. | +| broker.port | **1883** | Listening MQTT port on the broker that will accept connection from a client. | +| broker.version | **5** | MQTT protocol version (there are three versions currently supported by gateway - **3.1**, **3.11**, **5**). | +| broker.clientId ** | **ThingsBoard_gateway** | Unique identifier for each client’s session on the broker. | +| broker.maxMessageNumberPerWorker | **10** | (Optional) Maximum number of MQTT messages a single worker (a background helper that processes queued messages)
handles in one pass before letting other workers run. You may read more about this in the [Workers settings](/docs/iot-gateway/config/mqtt/#workers-settings). | +| broker.maxNumberOfWorkers | **100** | (Optional) Maximum number of workers (background helpers that process queued messages)
the gateway can run in parallel to handle MQTT traffic. You may read more about this in the [Workers settings](/docs/iot-gateway/config/mqtt/#workers-settings). | +| broker.keepAlive (in seconds) | **60** | (Optional) Seconds between pings; e.g., default is 60s, the broker expects traffic within the given interval * 1.5 or it closes the connection. | +| broker.cleanSession | **true** | (Optional) Tells the broker whether to start fresh or keep your previous session, Use `false`, if you want offline message queueing; use `true` if you always reconnect cleanly and don’t need persistence(Only for 3.1, 3.11 see details here - [MQTT Parameter Version Differences](/docs/iot-gateway/config/mqtt/#mqtt-parameter-version-differences). | +| broker.cleanStart | **true** | (Optional) Simular to **broker.cleanSession**, but unlike it, only decides what happens **at the start** of a connection; use `true`, if you want discard an old session; use `false` if you want to try to resume it (For MQTT 5.0 only see details here - [MQTT Parameter Version Differences](/docs/iot-gateway/config/mqtt/#mqtt-parameter-version-differences). | +| broker.sessionExpiryInterval (in seconds) | **0** | (Optional) How long the broker should keep your session after you disconnect (For MQTT 5.0 only see details here - [MQTT Parameter Version Differences](/docs/iot-gateway/config/mqtt/#mqtt-parameter-version-differences). | +| --- | | | + +{% capture difference %} +**Please note:** +\** -- The broker (or broker cluster) does not allow two simultaneous sessions with the same **broker.clientId**. If a second connection uses that ID, +the broker closes the existing session and accepts the new one (session takeover). The Client ID can be any valid UTF-8 string; +if you don’t have a descriptive one, you can generate it in the MQTT connector configuration UI—see the last screenshots under [Connection to broker](/docs/iot-gateway/config/mqtt/#connection-to-broker) subsection. +{% endcapture %} +{% include templates/info-banner.md content=difference %} + +Example of the server configuration: + +```json +"broker": { + "host": "127.0.0.1", + "port": 1883, + "version": 5, + "clientId": "ThingsBoard_gateway", + "maxMessageNumberPerWorker": 10, + "maxNumberOfWorkers": 100, + "keepAlive": 60, + "cleanSession": true, + "cleanStart": true, + "sessionExpiryInterval": 0, + "security": { + "type": "anonymous" + } +} ``` {: .copy-code} -{:refdef: style="text-align: center;"} -![image](/images/gateway/mqtt-mosquitto-sub-wait-1.png) -{: refdef} +### Security -Update device attribute value on the ThingsBoard server following these steps: -- Open the "Devices" page; -- Click on your device and navigate to the "Attributes" tab; -- Choose "Shared attributes" scope and click on the "pencil" icon next to *"firmwareVersion"* attribute. +MQTT broker connections offer three distinct security types: [Anonymous](/docs/iot-gateway/config/mqtt/#anonymous-1), +[Basic](/docs/iot-gateway/config/mqtt/#basic-1), [Certificates](/docs/iot-gateway/config/mqtt/#certificates-1). -{:refdef: style="text-align: center;"} -![image](/images/gateway/mqtt-update-attribute-1.png) -{: refdef} +#### Anonymous -- Change firmware version value from "1.1" to "1.2". Then click "Update" button. +**Anonymous** is the simplest option: no credentials are required to publish/subscribe on the MQTT broker. +*not recommended for production*, because it allows unattended access. -{:refdef: style="text-align: center;"} -![image](/images/gateway/mqtt-update-attribute-2.png) -{: refdef} -The firmware version has been updated to "1.2". +| **Parameter** | **Default value** | **Description** | +|:---------------------|:------------------------|------------------------------------------------------------------------------------------------------| +| broker.security | | The broker security object specifies authentication type for establishing connection to MQTT broker. | +| broker.security.type | **anonymous** | Type of authentication. | +| --- | | | -{:refdef: style="text-align: center;"} -![image](/images/gateway/mqtt-update-attribute-3.png) -{: refdef} -Broker received new message from the ThingsBoard server about updating attribute "FirmwareVersion" to "1.2". +Example of the security configuration for **anonymous** authentication option. -{:refdef: style="text-align: center;"} -![image](/images/gateway/mqtt-mosquitto-sub-get-1.png) -{: refdef} +```json +"security": { + "type": "anonymous" +} +``` +{: .copy-code} -### Server side RPC commands +#### Basic -ThingsBoard allows sending [RPC commands](/docs/user-guide/rpc/) to the device that is connected to ThingsBoard directly or via Gateway. -Configuration, provided in this section is used for sending RPC requests from ThingsBoard to device. +**Basic** authentication option uses a **username** and **password** configured on the MQTT broker. +It’s a good default for most setups - just use strong, unique credentials. -Select basic or advanced MQTT configuration: -{% capture mqttattributerequestsubsection %} -Basic%,%basic%,%templates/iot-gateway/mqtt-connector/server-side-rpc-commands-subsection-basic.md%br% -Advanced%,%advanced%,%templates/iot-gateway/mqtt-connector/server-side-rpc-commands-subsection-advanced.md{% endcapture %} +| **Parameter** | **Default value** | **Description** | +|:--------------------------------|:------------------|---------------------------------------------------------------------------------------------------| +| broker.security | | The broker security object specifies authentication type for establishing connection to MQTT broker.| +| broker.security.type | **basic** | Type of authentication. | +| broker.security.username | **username** | Username that will be used for establishing connection with MQTT broker. | +| broker.security.password | **password** | Password that will be used for establishing connection with MQTT broker. | +| --- | | | -{% include content-toggle.liquid content-toggle-id="mqttattributerequestsubsection" toggle-spec=mqttattributerequestsubsection %} -## Workers settings +Example of the security configuration for **basic** authentication option: -This configuration settings provides fields for configuring connector performance and message reading/formatting speed: +```json +"security": { + "type": "basic", + "username": "username", + "password": "password" +} +``` +{: .copy-code} -Select basic or advanced MQTT configuration: +#### Certificates -{% capture mqttattributerequestsubsection %} -Basic%,%basic%,%templates/iot-gateway/mqtt-connector/workers-settings-section-basic.md%br% -Advanced%,%advanced%,%templates/iot-gateway/mqtt-connector/workers-settings-section-advanced.md{% endcapture %} +**Certificate-based authentication** uses TLS certificates so the gateway and broker verify each other. +The safest authentication mode, setting up use the broker’s TLS port (typically 8883) for encrypted, production-grade security. -{% include content-toggle.liquid content-toggle-id="mqttattributerequestsubsection" toggle-spec=mqttattributerequestsubsection %} -## Configuration file +| **Parameter** | **Default value** | **Description** | +|:---------------------------------|:---------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| broker.security | | The broker security object specifies authentication type for establishing connection to MQTT broker. | +| broker.security.type | **certificates** | Type of authentication. | +| broker.security.pathToCACert | **/etc/thingsboard-gateway/ca.pem** | Path to the **pathToCACert** your CA certificate your MQTT client uses it to check the broker’s certificate during TLS, ensuring you’re connecting to a trusted server. | +| broker.security.pathToPrivateKey | **/etc/thingsboard-gateway/privateKey.pem** | Path to the **pathToPrivateKey** the key that proves the client’s identity and enables secure TLS handshakes. | +| broker.security.pathToClientCert | **/etc/thingsboard-gateway/certificate.pem** | Path to the **pathToClientCert** your certificate that identifies the gateway to the MQTT broker during TLS handshake. It’s paired with the gateway’s private key and is usually signed by a trusted CA. | -Example of MQTT Connector configuration file: + +Example of the security configuration for **certificates** authentication option: ```json -{ - "broker": { - "host": "127.0.0.1", - "port": 1883, - "clientId": "ThingsBoard_gateway", - "version": 5, - "maxMessageNumberPerWorker": 10, - "maxNumberOfWorkers": 100, - "sendDataOnlyOnChange": false, - "security": { - "type": "anonymous" +"security": { + "type": "certificates", + "pathToCACert": "/etc/thingsboard-gateway/ca.pem", + "pathToPrivateKey": "/etc/thingsboard-gateway/privateKey.pem", + "pathToClientCert": "/etc/thingsboard-gateway/certificate.pem" +} +``` +{: .copy-code} + +### Mapping + +Mapping lets you configure the topic/topics the gateway subscribes to for device creation and incoming data handling. +You can generate topic/topics and device names on the fly, and choose what data is sent +as device attributes or telemetry. This section provides the essential settings for flexible device and data management. + +#### Device mapping + +| **Parameter** | **Description** | +|:----------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| mapping[].topicFilter | The topic/topics the gateway will subscribe to that is used for data feed .[Wildcards](#wildcard-usage) can be used for topic creation. | +| mapping[].subscriptionQos | An agreement between the message sender and receiver that defines the level of delivery guarantee for a specific message. (0-At most once, 1-At least once, 2-Exactly once). | +| mapping[].convertor.type | Explains how the connector parses MQTT payloads and extracts device information can be [json](#json), [bytes](#bytes), [custom](#custom). | +| mapping[].deviceInfo.convertor.deviceNameExpressionSource | Source of the device name (can be `message`, `topic` or `constant`). | +| mapping[].deviceInfo.convertor.deviceNameExpression | Expression used to extract the device name from the selected source (Message/Topic/Constant). Supports JSON path, regular expression, byte slice, or literal - see [expression](#expression-types). | +| mapping[].deviceInfo.convertor.deviceProfileSource | Source of the device profile (can be `message`, `topic` or `constant`). | +| mapping[].deviceInfo.convertor.deviceProfileExpression | Expression used to extract the device profile from the selected source (Message/Topic/Constant). Supports JSON path, regular expression, byte slice, or literal - see [expression](#expression-types). | +| mapping[].reportStrategy | (Optional) Report strategy object using for configuring report strategy for device. | +| mapping[].timeout | (Optional) Timeout for triggering “Device Disconnected” event by default - `60000`(in milliseconds). | +| --- | | + +Example of the device mapping configuration: + +```json +"mapping": [ + { + "topicFilter": "sensor/data", + "subscriptionQos": 1, + "converter": { + "type": "json", + "deviceInfo": { + "deviceNameExpressionSource": "message", + "deviceNameExpression": "${serialNumber}", + "deviceProfileExpressionSource": "message", + "deviceProfileExpression": "${sensorType}" + }, + "attributes": [], + "timeseries": [] } + } +] +``` +{: .copy-code} + +#### Device attributes and timeseries + +| **Parameter** | **Description** | +|:--------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| mapping[].attributes[] | List of attributes that will be sent to the ThingsBoard platform instance. | +| mapping[].attributes[].key | Key name of the attribute in ThingsBoard. It can be specified as a static value. | +| mapping[].attributes[].type | The type of attribute field (It could be one of the following `string`, `boolean`, `integer`, `double` or `Raw` if the **Payload type** `Bytes`). | +| mapping[].attributes[].value | The value of the attribute that will be sent to the platform device. It should be specified depending on the selected **Payload type** (`Bytes`, `JSON`, `CUSTOM`). | +| mapping[].attributes[].reportStrategy | (Optional) Report strategy for the attributes data. If not specified, the device report strategy will be used. | +| mapping[].timeseries[] | List of telemetry data that will be sent to the ThingsBoard platform instance. | +| mapping[].timeseries[].key | Key name of the telemetry data in ThingsBoard. It can be specified as a static value. | +| mapping[].timeseries[].type | The type of telemetry field (It could be one of the following `string`, `boolean`, `integer`, `double` or `Raw` if the **Payload type** `Bytes`). | +| mapping[].timeseries[].value | Value of the telemetry data that will be sent to the platform. It should be specified depending on the selected type (`json path`, `regular expressions` or `slices`). | +| mapping[].timeseries[].tsField | (Optional) [json-path](/docs/iot-gateway/config/mqtt/#json-path) expression for field that carries a datetime string. If not present, the `ts` or `timestamp` properties from incoming message will be used as timestamp for data entry. | +| mapping[].timeseries[].dayfirst | (Optional) Points out that the first number is the day (`DD.MM.YY HH:mm:ss.SSS`).• `false` → `10.11.24 10:10:10.252` → 11 Oct 2024 10:10:10.252• `true` → `10.11.24 10:10:10.252` → 10 Nov 2024 10:10:10.252. | +| mapping[].timeseries[].yearfirst | (Optional) Points out that the first number is the year `(DD.MM.YY HH:mm:ss.SSS)`. • `false` → follows dayfirst rule• `true` → `10.11.24 10:10:10.252` → 24 Nov 2010 10:10:10.252. | +| mapping[].timeseries[].reportStrategy | (Optional) Report strategy for the time series data. If not specified, the device report strategy will be used. | +| --- | | + +Example of the attributes and telemetry configuration: + +```json +"attributes": [ + { + "type": "string", + "key": "model", + "value": "${sensorModel}" + }, + { + "type": "string", + "key": "${sensorModel}", + "value": "on" + } +], +"timeseries": [ + { + "type": "double", + "key": "temperature", + "value": "${temp}" + }, + { + "type": "double", + "key": "humidity", + "value": "${hum}", + "tsField": "${timestampField}", + "dayfirst": true }, - "mapping": [ + { + "type": "string", + "key": "combine", + "value": "${hum}:${temp}" + } +], +``` +{: .copy-code} + + +### Request mapping + +#### Device connect requests + + +| **Parameter** | **Description** | +|:-------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| requestsMapping.connectRequests[].topicFilter | The topic/topics the gateway will subscribe to and wait for device to publish the connect request.[Wildcards](#wildcard-usage) can be used for topic creation. | +| requestsMapping.connectRequests[].deviceInfo.deviceNameExpressionSource | Source of the device name to which the request will be sent to (can be `message`, `topic` or `constant`). | +| requestsMapping.connectRequests[].deviceInfo.deviceNameExpression | Expression used to extract the device name from the selected source (Message/Topic/Constant). Supports JSON path, regular expression, byte slice, or literal - see [expression](#expression-types). | +| requestsMapping.connectRequests[].deviceInfo.deviceProfileExpressionSource | Source of the device profile to which the request will be sent to (can be `message`, `topic` or `constant`). | +| requestsMapping.connectRequests[].deviceInfo.deviceProfileExpression | Expression used to extract the device name from the selected source (Message/Topic/Constant). Supports JSON path, regular expression, byte slice, or literal - see [expression](#expression-types). | +| --- | | + +Example of the connect request configuration: + +```json +"requestsMapping": { + "connectRequests": [ { - "topicFilter": "sensor/data", - "subscriptionQos": 1, - "converter": { - "type": "json", - "deviceInfo": { - "deviceNameExpressionSource": "message", - "deviceNameExpression": "${serialNumber}", - "deviceProfileExpressionSource": "message", - "deviceProfileExpression": "${sensorType}" - }, - "sendDataOnlyOnChange": false, - "timeout": 60000, - "attributes": [ - { - "type": "string", - "key": "model", - "value": "${sensorModel}" - }, - { - "type": "string", - "key": "${sensorModel}", - "value": "on" - } - ], - "timeseries": [ - { - "type": "string", - "key": "temperature", - "value": "${temp}" - }, - { - "type": "double", - "key": "humidity", - "value": "${hum}" - }, - { - "type": "string", - "key": "combine", - "value": "${hum}:${temp}" - } - ] + "topicFilter": "sensor/connect", + "deviceInfo": { + "deviceNameExpressionSource": "message", + "deviceNameExpression": "${serialNumber}", + "deviceProfileExpressionSource": "constant", + "deviceProfileExpression": "Thermometer" } - }, + } + ] +} +``` +{: .copy-code} + +#### Device disconnect requests + + +| **Parameter** | **Description** | +|:--------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| requestsMapping.disconnectRequests[].topicFilter | The topic/topics the gateway will subscribe to and wait for device to publish the disconnect request.[Wildcards](#wildcard-usage) can be used for topic creation. | +| requestsMapping.disconnectRequests[].deviceInfo.deviceNameExpressionSource | Source of the device name to which the request will be sent to (can be `message`, `topic` or `constant`). | +| requestsMapping.disconnectRequests[].deviceInfo.deviceNameExpression | Expression used to extract the device name from the selected source (Message/Topic/Constant). Supports JSON path, regular expression, byte slice, or literal - see [expression](#expression-types). | +| --- | | + +Example of the disconnect request configuration: + +```json +"requestsMapping": { + "disconnectRequests": [ { - "topicFilter": "sensor/+/data", - "subscriptionQos": 1, - "converter": { - "type": "json", - "deviceInfo": { - "deviceNameExpressionSource": "topic", - "deviceNameExpression": "(?<=sensor/)(.*?)(?=/data)", - "deviceProfileExpressionSource": "constant", - "deviceProfileExpression": "Thermometer" - }, - "sendDataOnlyOnChange": false, - "timeout": 60000, - "attributes": [ - { - "type": "string", - "key": "model", - "value": "${sensorModel}" - } - ], - "timeseries": [ - { - "type": "double", - "key": "temperature", - "value": "${temp}" - }, - { - "type": "string", - "key": "humidity", - "value": "${hum}" - } - ] + "topicFilter": "sensor/disconnect", + "deviceInfo": { + "deviceNameExpression": "${serialNumber}", + "deviceNameExpressionSource": "message" } - }, + } + ] +} +``` +{: .copy-code} + +#### Device attribute requests + + +| **Parameter** | **Description** | +|:--------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| requestsMapping.attributeRequests[].scope | (Optional) Determines the scope from where the attributes are taken use `client` if want to request client attributes | +| requestsMapping.attributeRequests[].retain | Whether the attribute response message should be retained by the MQTT broker can be `true` or `false`. | +| requestsMapping.attributeRequests[].topicFilter | The topic/topics that the gateway subscribes to for incoming requests. The **Topic filter** supports special symbols: `#` and `+` | +| requestsMapping.attributeRequests[].deviceInfo.deviceNameExpressionSource | Source of the device name to which the request will be sent to (can be `message`, `topic` or `constant`). | +| requestsMapping.attributeRequests[].deviceInfo.deviceNameExpression | Expression used to extract the device name from the selected source (Message/Topic/Constant). Supports JSON path, regular expression, byte slice, or literal - see [expression](#expression-types). | +| requestsMapping.attributeRequests[].attributeNameExpressionSource | Source of the attribute name to which the request will be sent to (can be `message`, `topic` or `constant`). | +| requestsMapping.attributeRequests[].attributeNameExpression | Expression used to extract the attribute name from the selected source (Message/Topic/Constant). Supports JSON path, regular expression, byte slice, or literal - see [expression](#expression-types). | +| requestsMapping.attributeRequests[].topicExpression | Expression used to format the response topic. It can be parsed from `message`, `topic`, or `constant`. | +| requestsMapping.attributeRequests[].valueExpression | Expression used to format the response value. It can be parsed from `message`, `topic`, or `constant`. | +| --- | | + + +Example of the attribute requests configuration: + +```json +"requestsMapping": { + "attributeRequests": [ { - "topicFilter": "sensor/raw_data", - "subscriptionQos": 1, - "converter": { - "type": "bytes", - "deviceInfo": { - "deviceNameExpressionSource": "message", - "deviceNameExpression": "[0:4]", - "deviceProfileExpressionSource": "constant", - "deviceProfileExpression": "default" - }, - "sendDataOnlyOnChange": false, - "timeout": 60000, - "attributes": [ - { - "type": "raw", - "key": "rawData", - "value": "[:]" - } - ], - "timeseries": [ - { - "type": "raw", - "key": "temp", - "value": "[4:]" - } - ] - } + "retain": false, + "topicFilter": "v1/devices/me/attributes/request", + "deviceInfo": { + "deviceNameExpressionSource": "message", + "deviceNameExpression": "${serialNumber}" + }, + "attributeNameExpressionSource": "message", + "attributeNameExpression": "${versionAttribute}", + "topicExpression": "devices/${deviceName}/attrs", + "valueExpression": "${attributeKey}: ${attributeValue}" + } + ] +} +``` +{: .copy-code} + +#### Device attribute updates + + +| **Parameter** | **Description** | +|:-----------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| requestsMapping.attributeUpdates[].retain | Whether the attribute response message should be retained by the MQTT broker. | +| requestsMapping.attributeUpdates[].deviceNameFilter | Regular expression device name filter, used to determine which devices should receive attribute updates see [expression](#expression-types) | +| requestsMapping.attributeUpdates[].attributeFilter | Regular expression attribute name filter, used to determine which attributes should be updated see [expression](#expression-types) | +| requestsMapping.attributeUpdates[].topicExpression | JSON-path expression used for creating topic address to send a message. Supports variables like `${deviceName}` and `${attributeKey}` see [expression](#expression-types). | +| requestsMapping.attributeUpdates[].valueExpression | JSON-path expression used for creating the message data that will be sent to the topic. Supports variables like `${attributeKey}` and `${attributeValue}` see [expression](#expression-types) . | +| --- | | + + +Example of the attribute updates configuration: + +```json +"requestsMapping": { + "attributeUpdates": [ + { + "retain": true, + "deviceNameFilter": ".*", + "attributeFilter": "firmwareVersion", + "topicExpression": "sensor/${deviceName}/${attributeKey}", + "valueExpression": "{\"${attributeKey}\":\"${attributeValue}\"}" + } + ] +} +``` +{: .copy-code} + +#### Device RPC methods + +Device RPC (Remote Procedure Call) methods allow you to send commands from ThingsBoard to your devices through the MQTT connector. The gateway acts as an intermediary, translating ThingsBoard RPC calls into MQTT messages that your devices can understand. + +There are two types of RPC requests supported by the MQTT connector: + +1. **Two-way (with response)** - The gateway sends a request to the device and waits for a response. This is useful when you need to get data back from the device. +2. **One-way (without response)** - The gateway sends a request to the device without expecting a response. This is useful for simple commands that don't require confirmation. + + +| **Parameter** | **Description** | +|:--------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| requestsMapping.serverSideRpc[].deviceNameFilter | Regular expression device name filter, is used to determine which devices this RPC configuration applies to. See [expression](#expression-types) | +| requestsMapping.serverSideRpc[].methodFilter | Regular expression method name filter, is used to determine which RPC methods this configuration applies to. See [expression](#expression-types) | +| requestsMapping.serverSideRpc[].requestTopicExpression | JSON-path expression, is used for creating topic address to send RPC request. Supports variables like `${deviceName}` and `${attributeKey}` applies to. See [expression](#expression-types) | +| requestsMapping.serverSideRpc[].responseTopicExpression | JSON-path expression, is used for creating topic address to subscribe for response message. Supports variables like `${deviceName}` and `${attributeKey}` applies to. See [expression](#expression-types) | +| requestsMapping.serverSideRpc[].responseTopicQoS | Quality of Service level for the response topic subscription. | +| requestsMapping.serverSideRpc[].responseTimeout | Value in milliseconds. If there is no response within this period after sending the request, gateway will unsubscribe from the response topic. | +| requestsMapping.serverSideRpc[].valueExpression | JSON-path expression, is used for creating data for sending to broker. Supports variables like `${deviceName}` and `${attributeKey}` applies to. See [expression](#expression-types) | +| --- | | + +The configuration for Device RPC methods is defined in the "serverSideRpc" section of the MQTT connector configuration: + +```json +"requestsMapping": { + "serverSideRpc": [ + { + "type": "twoWay", + "deviceNameFilter": ".*", + "methodFilter": "echo", + "requestTopicExpression": "sensor/${deviceName}/request/${methodName}/${requestId}", + "responseTopicExpression": "sensor/${deviceName}/response/${methodName}/${requestId}", + "responseTopicQoS": 1, + "responseTimeout": 10000, + "valueExpression": "${params}" }, { - "topicFilter": "custom/sensors/+", - "subscriptionQos": 1, - "converter": { - "type": "custom", - "extension": "CustomMqttUplinkConverter", - "cached": true, - "extensionConfig": { - "temperature": 2, - "humidity": 2, - "batteryLevel": 1 - } - } + "type": "oneWay", + "deviceNameFilter": ".*", + "methodFilter": "no-reply", + "requestTopicExpression": "sensor/${deviceName}/request/${methodName}/${requestId}", + "valueExpression": "${params}" } - ], - "requestsMapping": { - "connectRequests": [ - { - "topicFilter": "sensor/connect", - "deviceInfo": { - "deviceNameExpressionSource": "message", - "deviceNameExpression": "${serialNumber}", - "deviceProfileExpressionSource": "constant", - "deviceProfileExpression": "Thermometer" - } - }, - { - "topicFilter": "sensor/+/connect", - "deviceInfo": { - "deviceNameExpressionSource": "topic", - "deviceNameExpression": "(?<=sensor/)(.*?)(?=/connect)", - "deviceProfileExpressionSource": "constant", - "deviceProfileExpression": "Thermometer" - } - } - ], - "disconnectRequests": [ - { - "topicFilter": "sensor/disconnect", - "deviceInfo": { - "deviceNameExpressionSource": "message", - "deviceNameExpression": "${serialNumber}" - } - }, - { - "topicFilter": "sensor/+/disconnect", - "deviceInfo": { - "deviceNameExpressionSource": "topic", - "deviceNameExpression": "(?<=sensor/)(.*?)(?=/connect)" - } - } - ], - "attributeRequests": [ - { - "retain": false, - "topicFilter": "v1/devices/me/attributes/request", - "deviceInfo": { - "deviceNameExpressionSource": "message", - "deviceNameExpression": "${serialNumber}" - }, - "attributeNameExpressionSource": "message", - "attributeNameExpression": "${versionAttribute}, ${pduAttribute}", - "topicExpression": "devices/${deviceName}/attrs", - "valueExpression": "${attributeKey}: ${attributeValue}" - } - ], - "attributeUpdates": [ - { - "retain": true, - "deviceNameFilter": ".*", - "attributeFilter": "firmwareVersion", - "topicExpression": "sensor/${deviceName}/${attributeKey}", - "valueExpression": "{\"${attributeKey}\":\"${attributeValue}\"}" - } - ], - "serverSideRpc": [ - { - "type": "twoWay", - "deviceNameFilter": ".*", - "methodFilter": "echo", - "requestTopicExpression": "sensor/${deviceName}/request/${methodName}/${requestId}", - "responseTopicExpression": "sensor/${deviceName}/response/${methodName}/${requestId}", - "responseTopicQoS": 1, - "responseTimeout": 10000, - "valueExpression": "${params}" - }, - { - "type": "oneWay", - "deviceNameFilter": ".*", - "methodFilter": "no-reply", - "requestTopicExpression": "sensor/${deviceName}/request/${methodName}/${requestId}", - "valueExpression": "${params}" - } - ] - } + ] } ``` -{:.copy-code.expandable-15} +{: .copy-code} + +Additionally, every telemetry and attribute parameter has built-in GET and SET RPC methods available out of the box, so you don't need to configure them manually. + +For more information on using the built-in GET and SET RPC methods, see [the guide](/docs/iot-gateway/guides/how-to-use-get-set-rpc-methods). + + +## Workers settings + +This configuration settings provides fields for configuring connector performance and message reading/formatting speed: + +{% include /templates/iot-gateway/mqtt-connector/workers-settings-section-basic.md %} + +## Additional information + +### Wildcard usage + +**Wildcards** let the gateway subscribe to many topics with one pattern, or to topics whose exact names you don’t know, +but whose structure you do. + +- **(`#`) - wildcard** + + A **(`#`) - wildcard** matches *this level and all following levels*. Put it only at the *end*. + + _Expression:_ + + `sensor/data/#` + + _Matching examples:_ + + `sensor/data/room1` + + `sensor/data/room1/temp` + + `sensor/data/` + + +- **(`+`) - wildcard** + + A **(`+`) - wildcard** *uses exactly one level* may be used *anywhere* at the topic level. + + _Expression:_ + + `sensor/+/data` + + _Matching examples:_ + + `sensor/A/data` + + `sensor/B/data` + + _Non-Matching examples:_ + + `sensor/A/lab/data` + +### Shared subscriptions + +**Shared subscription** is a special type of subscription that let multiple MQTT clients “share” a single subscription +so the broker load-balances messages among them. +Instead of every subscriber getting every message (fan-out), only one member of the group receives each matching +publish. +For example to subscribe to the `sensor/+/data` in group `workers` you can set the topic filter to. + +**Example:** + +`$share/workers/sensor/+/data` + +### Convertor types + +The **Convertor types** section explains how the connector parses MQTT payloads +and extracts device information (Name, Profile) and data (attributes/telemetry); +choose a convertor based on your payload format and preferred extraction method. + +#### JSON + +Use this type of conversion if incoming data is `json`. + +**Example:** + +`{"serialNumber": "SN-001", "sensorType": "Thermometer", "sensorModel": "T1000", "temp": 42, "hum": 58}` + +#### BYTES + +Use this type of conversion if incoming data are sequence of `bytes`. + +**Example:** + +`b'AM-120'` + +#### CUSTOM + +Use the `CUSTOM` converter when incoming data is neither `BYTES` nor `JSON`. Implement your custom converter and configure it in the MQTT connector (see +[Usage examples](/docs/iot-gateway/config/mqtt/#usage-examples) for examples with screenshots). + +### Expression types + +The **Expression types** section explains how to extract device information (Name, Profile) from different sources—Message, +Topic, or Constant—using JSON paths, regular expressions, or byte slices. + +#### Json path + +Use **Json path** when the **Name** and/or **Profile Name** must be extracted from the **Message** source and the +**Payload type** is **JSON**. +In other words, these values are read directly from fields in the incoming JSON payload. + +_Expressions:_ + +`${serialNumber}` +`${sensorType}` + +_Payload example:_ +`{"serialNumber": "SN-001", "sensorType": "Thermometer", "sensorModel": "T1000", "temp": 42, "hum": 58}` + +_Converted data:_ +`SN-001` +`Thermometer` + +#### Regular expressions + +**Regular expression** +Use **regular expression** when the **Name** and/or **Profile Name** must be extracted from the **Topic**. +In other words, these values will be extracted from your topic depending on the regular expression you write. + +_Expression:_ + +`(?<=sensor/)(.*?)(?=/data)` + +_Matching example:_ +`sensor/Thermo-A/data` + +_Converted data:_ +`Thermo-A` + +#### Slices + +**Slices** (**Bytes** source) + +Use **Slices** when the **Name** and/or **Profile Name** must be extracted from the bytes sequence and the +*Payload type* is **BYTES**.Slices use Python-style indexing over the raw byte sequence. Example rule: device name = first 4 bytes; +temperature = the rest. + +_Expressions:_ + +`[0:4]` +`[4:]` + +_Payload example:_ +`b'AM-120'` + +_Converted data:_ +`AM-1` +`20` + + +## Troubleshooting + +### MQTT Parameter Version Differences + +1. **broker.cleanSession** +*MQTT 3.1, 3.11 only*; in *MQTT 5.0* it’s replaced by **broker.cleanStart** (on connect behavior) plus **broker.sessionExpiryInterval** (how long the session is kept after disconnect). + +2. **broker.sessionExpiryInterval** +*MQTT 5.0 only*; if it is `0` drop session on disconnect, if it is bigger than `0` keep it for that many seconds. + +3. **broker.cleanStart** +*MQTT 5.0 only*; controls what happens at connect: `true` discards any previous session, `false` tries to resume it. + +### Shared subscriptions limitations + +1. Don’t subscribe to both `sensor/+/data` and `$share/workers/sensor/+/data` in the same connector you will risk double handling. + +2. Make sure your broker supports shared subscriptions, because some **don't**. ## Next steps @@ -599,4 +983,4 @@ Explore guides related to main ThingsBoard features: - [Device attributes](/docs/user-guide/attributes/) - how to use device attributes. - [Telemetry data collection](/docs/user-guide/telemetry/) - how to collect telemetry data. - [Using RPC capabilities](/docs/user-guide/rpc/) - how to send commands to/from devices. - - [Rule Engine](/docs/user-guide/rule-engine/) - how to use rule engine to analyze data from devices. \ No newline at end of file + - [Rule Engine](/docs/user-guide/rule-engine/) - how to use rule engine to analyze data from devices. diff --git a/images/gateway/dashboard/requests-mapping-1-ce-preview.png b/images/gateway/dashboard/requests-mapping-1-ce-preview.png deleted file mode 100644 index f8f054311b..0000000000 Binary files a/images/gateway/dashboard/requests-mapping-1-ce-preview.png and /dev/null differ diff --git a/images/gateway/dashboard/requests-mapping-1-ce.png b/images/gateway/dashboard/requests-mapping-1-ce.png deleted file mode 100644 index f0d3d5ce6f..0000000000 Binary files a/images/gateway/dashboard/requests-mapping-1-ce.png and /dev/null differ diff --git a/images/gateway/dashboard/requests-mapping-2-ce-preview.png b/images/gateway/dashboard/requests-mapping-2-ce-preview.png deleted file mode 100644 index d47a11b1d3..0000000000 Binary files a/images/gateway/dashboard/requests-mapping-2-ce-preview.png and /dev/null differ diff --git a/images/gateway/dashboard/requests-mapping-2-ce.png b/images/gateway/dashboard/requests-mapping-2-ce.png deleted file mode 100644 index 0b137b1f36..0000000000 Binary files a/images/gateway/dashboard/requests-mapping-2-ce.png and /dev/null differ diff --git a/images/gateway/get-set-connector-rpc/mqtt-get-set-rpc-1.png b/images/gateway/get-set-connector-rpc/mqtt-get-set-rpc-1.png index a77b8ab7db..0b294aea0a 100644 Binary files a/images/gateway/get-set-connector-rpc/mqtt-get-set-rpc-1.png and b/images/gateway/get-set-connector-rpc/mqtt-get-set-rpc-1.png differ diff --git a/images/gateway/get-set-connector-rpc/mqtt-get-set-rpc-2.png b/images/gateway/get-set-connector-rpc/mqtt-get-set-rpc-2.png index 9eb8b7f694..6a3a92ede5 100644 Binary files a/images/gateway/get-set-connector-rpc/mqtt-get-set-rpc-2.png and b/images/gateway/get-set-connector-rpc/mqtt-get-set-rpc-2.png differ diff --git a/images/gateway/get-set-connector-rpc/mqtt-get-set-rpc-3.jpeg b/images/gateway/get-set-connector-rpc/mqtt-get-set-rpc-3.jpeg deleted file mode 100644 index 9db7618f25..0000000000 Binary files a/images/gateway/get-set-connector-rpc/mqtt-get-set-rpc-3.jpeg and /dev/null differ diff --git a/images/gateway/get-set-connector-rpc/mqtt-get-set-rpc-3.png b/images/gateway/get-set-connector-rpc/mqtt-get-set-rpc-3.png new file mode 100644 index 0000000000..f6d2d0e14f Binary files /dev/null and b/images/gateway/get-set-connector-rpc/mqtt-get-set-rpc-3.png differ diff --git a/images/gateway/get-set-connector-rpc/mqtt-get-set-rpc-4.jpeg b/images/gateway/get-set-connector-rpc/mqtt-get-set-rpc-4.jpeg deleted file mode 100644 index c06c0b5468..0000000000 Binary files a/images/gateway/get-set-connector-rpc/mqtt-get-set-rpc-4.jpeg and /dev/null differ diff --git a/images/gateway/mqtt-connect-device.png b/images/gateway/mqtt-connect-device.png deleted file mode 100755 index cefe7763d2..0000000000 Binary files a/images/gateway/mqtt-connect-device.png and /dev/null differ diff --git a/images/gateway/mqtt-connector/attribute-request-1-ce.png b/images/gateway/mqtt-connector/attribute-request-1-ce.png deleted file mode 100755 index 92c8f11eb0..0000000000 Binary files a/images/gateway/mqtt-connector/attribute-request-1-ce.png and /dev/null differ diff --git a/images/gateway/mqtt-connector/attribute-requests-example-advanced-1-ce.png b/images/gateway/mqtt-connector/attribute-requests-example-advanced-1-ce.png deleted file mode 100755 index f69388e60d..0000000000 Binary files a/images/gateway/mqtt-connector/attribute-requests-example-advanced-1-ce.png and /dev/null differ diff --git a/images/gateway/mqtt-connector/attribute-updates-example-advanced-1-ce.png b/images/gateway/mqtt-connector/attribute-updates-example-advanced-1-ce.png deleted file mode 100755 index 4387511cfb..0000000000 Binary files a/images/gateway/mqtt-connector/attribute-updates-example-advanced-1-ce.png and /dev/null differ diff --git a/images/gateway/mqtt-connector/attribute-updates-example-basic-1-ce.png b/images/gateway/mqtt-connector/attribute-updates-example-basic-1-ce.png deleted file mode 100755 index 2aadd1f52b..0000000000 Binary files a/images/gateway/mqtt-connector/attribute-updates-example-basic-1-ce.png and /dev/null differ diff --git a/images/gateway/mqtt-connector/connect-request-1-ce.png b/images/gateway/mqtt-connector/connect-request-1-ce.png deleted file mode 100755 index bb9f0da3b5..0000000000 Binary files a/images/gateway/mqtt-connector/connect-request-1-ce.png and /dev/null differ diff --git a/images/gateway/mqtt-connector/connect-request-device-name-from-the-topic-1-ce.png b/images/gateway/mqtt-connector/connect-request-device-name-from-the-topic-1-ce.png deleted file mode 100755 index ba62391e16..0000000000 Binary files a/images/gateway/mqtt-connector/connect-request-device-name-from-the-topic-1-ce.png and /dev/null differ diff --git a/images/gateway/mqtt-connector/connect-request-example-1-ce.png b/images/gateway/mqtt-connector/connect-request-example-1-ce.png deleted file mode 100755 index 2eda6d7a81..0000000000 Binary files a/images/gateway/mqtt-connector/connect-request-example-1-ce.png and /dev/null differ diff --git a/images/gateway/mqtt-connector/connection-to-broker-advanced-section-1-ce.png b/images/gateway/mqtt-connector/connection-to-broker-advanced-section-1-ce.png deleted file mode 100644 index 6adcba2659..0000000000 Binary files a/images/gateway/mqtt-connector/connection-to-broker-advanced-section-1-ce.png and /dev/null differ diff --git a/images/gateway/mqtt-connector/connection-to-broker-basic-section-1-ce.png b/images/gateway/mqtt-connector/connection-to-broker-basic-section-1-ce.png old mode 100755 new mode 100644 index 16a700f29a..521f2c6090 Binary files a/images/gateway/mqtt-connector/connection-to-broker-basic-section-1-ce.png and b/images/gateway/mqtt-connector/connection-to-broker-basic-section-1-ce.png differ diff --git a/images/gateway/mqtt-connector/data-conversion-advanced-bytes-1-ce.png b/images/gateway/mqtt-connector/data-conversion-advanced-bytes-1-ce.png deleted file mode 100755 index e1b5b51eb8..0000000000 Binary files a/images/gateway/mqtt-connector/data-conversion-advanced-bytes-1-ce.png and /dev/null differ diff --git a/images/gateway/mqtt-connector/data-conversion-advanced-custom-1-ce.png b/images/gateway/mqtt-connector/data-conversion-advanced-custom-1-ce.png deleted file mode 100755 index 36e2627bfb..0000000000 Binary files a/images/gateway/mqtt-connector/data-conversion-advanced-custom-1-ce.png and /dev/null differ diff --git a/images/gateway/mqtt-connector/data-conversion-advanced-json-1-ce.png b/images/gateway/mqtt-connector/data-conversion-advanced-json-1-ce.png deleted file mode 100755 index 5994981efd..0000000000 Binary files a/images/gateway/mqtt-connector/data-conversion-advanced-json-1-ce.png and /dev/null differ diff --git a/images/gateway/mqtt-connector/data-conversion-advanced-json-2-ce.png b/images/gateway/mqtt-connector/data-conversion-advanced-json-2-ce.png deleted file mode 100755 index 9902910d87..0000000000 Binary files a/images/gateway/mqtt-connector/data-conversion-advanced-json-2-ce.png and /dev/null differ diff --git a/images/gateway/mqtt-connector/data-conversion-basic-bytes-subsection-1-ce-preview.png b/images/gateway/mqtt-connector/data-conversion-basic-bytes-subsection-1-ce-preview.png deleted file mode 100644 index 674dd286c2..0000000000 Binary files a/images/gateway/mqtt-connector/data-conversion-basic-bytes-subsection-1-ce-preview.png and /dev/null differ diff --git a/images/gateway/mqtt-connector/data-conversion-basic-bytes-subsection-1-ce.png b/images/gateway/mqtt-connector/data-conversion-basic-bytes-subsection-1-ce.png deleted file mode 100755 index f5dd089fb4..0000000000 Binary files a/images/gateway/mqtt-connector/data-conversion-basic-bytes-subsection-1-ce.png and /dev/null differ diff --git a/images/gateway/mqtt-connector/data-conversion-basic-bytes-subsection-2-ce-preview.png b/images/gateway/mqtt-connector/data-conversion-basic-bytes-subsection-2-ce-preview.png deleted file mode 100644 index 9a953760c5..0000000000 Binary files a/images/gateway/mqtt-connector/data-conversion-basic-bytes-subsection-2-ce-preview.png and /dev/null differ diff --git a/images/gateway/mqtt-connector/data-conversion-basic-bytes-subsection-2-ce.png b/images/gateway/mqtt-connector/data-conversion-basic-bytes-subsection-2-ce.png deleted file mode 100755 index 550dc7e5f9..0000000000 Binary files a/images/gateway/mqtt-connector/data-conversion-basic-bytes-subsection-2-ce.png and /dev/null differ diff --git a/images/gateway/mqtt-connector/data-conversion-basic-bytes-subsection-3-ce-preview.png b/images/gateway/mqtt-connector/data-conversion-basic-bytes-subsection-3-ce-preview.png deleted file mode 100644 index e195b988c0..0000000000 Binary files a/images/gateway/mqtt-connector/data-conversion-basic-bytes-subsection-3-ce-preview.png and /dev/null differ diff --git a/images/gateway/mqtt-connector/data-conversion-basic-bytes-subsection-3-ce.png b/images/gateway/mqtt-connector/data-conversion-basic-bytes-subsection-3-ce.png deleted file mode 100755 index 680b8cb22a..0000000000 Binary files a/images/gateway/mqtt-connector/data-conversion-basic-bytes-subsection-3-ce.png and /dev/null differ diff --git a/images/gateway/mqtt-connector/data-conversion-basic-bytes-subsection-4-ce-preview.png b/images/gateway/mqtt-connector/data-conversion-basic-bytes-subsection-4-ce-preview.png deleted file mode 100644 index eb715d25e7..0000000000 Binary files a/images/gateway/mqtt-connector/data-conversion-basic-bytes-subsection-4-ce-preview.png and /dev/null differ diff --git a/images/gateway/mqtt-connector/data-conversion-basic-bytes-subsection-4-ce.png b/images/gateway/mqtt-connector/data-conversion-basic-bytes-subsection-4-ce.png deleted file mode 100755 index e193d8714e..0000000000 Binary files a/images/gateway/mqtt-connector/data-conversion-basic-bytes-subsection-4-ce.png and /dev/null differ diff --git a/images/gateway/mqtt-connector/data-conversion-basic-bytes-subsection-5-ce-preview.png b/images/gateway/mqtt-connector/data-conversion-basic-bytes-subsection-5-ce-preview.png deleted file mode 100644 index 6b459430d7..0000000000 Binary files a/images/gateway/mqtt-connector/data-conversion-basic-bytes-subsection-5-ce-preview.png and /dev/null differ diff --git a/images/gateway/mqtt-connector/data-conversion-basic-bytes-subsection-5-ce.png b/images/gateway/mqtt-connector/data-conversion-basic-bytes-subsection-5-ce.png deleted file mode 100755 index 5081b02050..0000000000 Binary files a/images/gateway/mqtt-connector/data-conversion-basic-bytes-subsection-5-ce.png and /dev/null differ diff --git a/images/gateway/mqtt-connector/data-conversion-basic-custom-subsection-1-ce-preview.png b/images/gateway/mqtt-connector/data-conversion-basic-custom-subsection-1-ce-preview.png deleted file mode 100644 index 1d5fa16b94..0000000000 Binary files a/images/gateway/mqtt-connector/data-conversion-basic-custom-subsection-1-ce-preview.png and /dev/null differ diff --git a/images/gateway/mqtt-connector/data-conversion-basic-custom-subsection-1-ce.png b/images/gateway/mqtt-connector/data-conversion-basic-custom-subsection-1-ce.png deleted file mode 100755 index a7d29e8b58..0000000000 Binary files a/images/gateway/mqtt-connector/data-conversion-basic-custom-subsection-1-ce.png and /dev/null differ diff --git a/images/gateway/mqtt-connector/data-conversion-basic-custom-subsection-1-ce.png.png b/images/gateway/mqtt-connector/data-conversion-basic-custom-subsection-1-ce.png.png deleted file mode 100644 index 587a59df43..0000000000 Binary files a/images/gateway/mqtt-connector/data-conversion-basic-custom-subsection-1-ce.png.png and /dev/null differ diff --git a/images/gateway/mqtt-connector/data-conversion-basic-custom-subsection-2-ce-preview.png b/images/gateway/mqtt-connector/data-conversion-basic-custom-subsection-2-ce-preview.png deleted file mode 100644 index fe122d1ff6..0000000000 Binary files a/images/gateway/mqtt-connector/data-conversion-basic-custom-subsection-2-ce-preview.png and /dev/null differ diff --git a/images/gateway/mqtt-connector/data-conversion-basic-custom-subsection-2-ce.png b/images/gateway/mqtt-connector/data-conversion-basic-custom-subsection-2-ce.png deleted file mode 100755 index c307ccefa1..0000000000 Binary files a/images/gateway/mqtt-connector/data-conversion-basic-custom-subsection-2-ce.png and /dev/null differ diff --git a/images/gateway/mqtt-connector/data-conversion-basic-custom-subsection-3-ce-preview.png b/images/gateway/mqtt-connector/data-conversion-basic-custom-subsection-3-ce-preview.png deleted file mode 100644 index 8e12c0da40..0000000000 Binary files a/images/gateway/mqtt-connector/data-conversion-basic-custom-subsection-3-ce-preview.png and /dev/null differ diff --git a/images/gateway/mqtt-connector/data-conversion-basic-custom-subsection-3-ce.png b/images/gateway/mqtt-connector/data-conversion-basic-custom-subsection-3-ce.png deleted file mode 100755 index f50eef9fd9..0000000000 Binary files a/images/gateway/mqtt-connector/data-conversion-basic-custom-subsection-3-ce.png and /dev/null differ diff --git a/images/gateway/mqtt-connector/data-conversion-basic-json-subsection-1-ce-preview.png b/images/gateway/mqtt-connector/data-conversion-basic-json-subsection-1-ce-preview.png deleted file mode 100644 index aa0c185872..0000000000 Binary files a/images/gateway/mqtt-connector/data-conversion-basic-json-subsection-1-ce-preview.png and /dev/null differ diff --git a/images/gateway/mqtt-connector/data-conversion-basic-json-subsection-1-ce.png b/images/gateway/mqtt-connector/data-conversion-basic-json-subsection-1-ce.png deleted file mode 100755 index 8644fd76ac..0000000000 Binary files a/images/gateway/mqtt-connector/data-conversion-basic-json-subsection-1-ce.png and /dev/null differ diff --git a/images/gateway/mqtt-connector/data-conversion-basic-json-subsection-2-ce-preview.png b/images/gateway/mqtt-connector/data-conversion-basic-json-subsection-2-ce-preview.png deleted file mode 100644 index 9b4074a3fa..0000000000 Binary files a/images/gateway/mqtt-connector/data-conversion-basic-json-subsection-2-ce-preview.png and /dev/null differ diff --git a/images/gateway/mqtt-connector/data-conversion-basic-json-subsection-2-ce.png b/images/gateway/mqtt-connector/data-conversion-basic-json-subsection-2-ce.png deleted file mode 100755 index 56179b7040..0000000000 Binary files a/images/gateway/mqtt-connector/data-conversion-basic-json-subsection-2-ce.png and /dev/null differ diff --git a/images/gateway/mqtt-connector/data-conversion-basic-json-subsection-3-ce-preview.png b/images/gateway/mqtt-connector/data-conversion-basic-json-subsection-3-ce-preview.png deleted file mode 100644 index a1289ac176..0000000000 Binary files a/images/gateway/mqtt-connector/data-conversion-basic-json-subsection-3-ce-preview.png and /dev/null differ diff --git a/images/gateway/mqtt-connector/data-conversion-basic-json-subsection-3-ce.png b/images/gateway/mqtt-connector/data-conversion-basic-json-subsection-3-ce.png deleted file mode 100755 index 13a36196ee..0000000000 Binary files a/images/gateway/mqtt-connector/data-conversion-basic-json-subsection-3-ce.png and /dev/null differ diff --git a/images/gateway/mqtt-connector/data-conversion-basic-json-subsection-4-ce-preview.png b/images/gateway/mqtt-connector/data-conversion-basic-json-subsection-4-ce-preview.png deleted file mode 100644 index fdc9356a19..0000000000 Binary files a/images/gateway/mqtt-connector/data-conversion-basic-json-subsection-4-ce-preview.png and /dev/null differ diff --git a/images/gateway/mqtt-connector/data-conversion-basic-json-subsection-4-ce.png b/images/gateway/mqtt-connector/data-conversion-basic-json-subsection-4-ce.png deleted file mode 100755 index 46777ea2e0..0000000000 Binary files a/images/gateway/mqtt-connector/data-conversion-basic-json-subsection-4-ce.png and /dev/null differ diff --git a/images/gateway/mqtt-connector/data-conversion-basic-json-subsection-5-ce-preview.png b/images/gateway/mqtt-connector/data-conversion-basic-json-subsection-5-ce-preview.png deleted file mode 100644 index a455a1198a..0000000000 Binary files a/images/gateway/mqtt-connector/data-conversion-basic-json-subsection-5-ce-preview.png and /dev/null differ diff --git a/images/gateway/mqtt-connector/data-conversion-basic-json-subsection-5-ce.png b/images/gateway/mqtt-connector/data-conversion-basic-json-subsection-5-ce.png deleted file mode 100755 index 7c4bb0a407..0000000000 Binary files a/images/gateway/mqtt-connector/data-conversion-basic-json-subsection-5-ce.png and /dev/null differ diff --git a/images/gateway/mqtt-connector/data-mapping-1-preview.png b/images/gateway/mqtt-connector/data-mapping-1-preview.png new file mode 100644 index 0000000000..e0829d3d77 Binary files /dev/null and b/images/gateway/mqtt-connector/data-mapping-1-preview.png differ diff --git a/images/gateway/mqtt-connector/data-mapping-1.png b/images/gateway/mqtt-connector/data-mapping-1.png new file mode 100644 index 0000000000..e0829d3d77 Binary files /dev/null and b/images/gateway/mqtt-connector/data-mapping-1.png differ diff --git a/images/gateway/mqtt-connector/data-mapping-2-preview.png b/images/gateway/mqtt-connector/data-mapping-2-preview.png new file mode 100644 index 0000000000..0391097e3c Binary files /dev/null and b/images/gateway/mqtt-connector/data-mapping-2-preview.png differ diff --git a/images/gateway/mqtt-connector/data-mapping-2.png b/images/gateway/mqtt-connector/data-mapping-2.png new file mode 100644 index 0000000000..0391097e3c Binary files /dev/null and b/images/gateway/mqtt-connector/data-mapping-2.png differ diff --git a/images/gateway/mqtt-connector/data-mapping-3-preview.png b/images/gateway/mqtt-connector/data-mapping-3-preview.png new file mode 100644 index 0000000000..1bb2317b28 Binary files /dev/null and b/images/gateway/mqtt-connector/data-mapping-3-preview.png differ diff --git a/images/gateway/mqtt-connector/data-mapping-3.png b/images/gateway/mqtt-connector/data-mapping-3.png new file mode 100644 index 0000000000..1bb2317b28 Binary files /dev/null and b/images/gateway/mqtt-connector/data-mapping-3.png differ diff --git a/images/gateway/mqtt-connector/data-mapping-advanced-section-1-ce.png b/images/gateway/mqtt-connector/data-mapping-advanced-section-1-ce.png deleted file mode 100644 index ab27d49de8..0000000000 Binary files a/images/gateway/mqtt-connector/data-mapping-advanced-section-1-ce.png and /dev/null differ diff --git a/images/gateway/mqtt-connector/data-mapping-basic-section-1-ce.png b/images/gateway/mqtt-connector/data-mapping-basic-section-1-ce.png deleted file mode 100644 index 3df93c3d08..0000000000 Binary files a/images/gateway/mqtt-connector/data-mapping-basic-section-1-ce.png and /dev/null differ diff --git a/images/gateway/mqtt-connector/data-mapping-basic-section-2-ce.png b/images/gateway/mqtt-connector/data-mapping-basic-section-2-ce.png deleted file mode 100644 index 5b197cda39..0000000000 Binary files a/images/gateway/mqtt-connector/data-mapping-basic-section-2-ce.png and /dev/null differ diff --git a/images/gateway/mqtt-connector/disconnect-request-1-ce.png b/images/gateway/mqtt-connector/disconnect-request-1-ce.png deleted file mode 100755 index 4a99130114..0000000000 Binary files a/images/gateway/mqtt-connector/disconnect-request-1-ce.png and /dev/null differ diff --git a/images/gateway/mqtt-connector/disconnect-request-2-ce.png b/images/gateway/mqtt-connector/disconnect-request-2-ce.png deleted file mode 100755 index a924d54076..0000000000 Binary files a/images/gateway/mqtt-connector/disconnect-request-2-ce.png and /dev/null differ diff --git a/images/gateway/mqtt-connector/disconnect-request-example-1-ce.png b/images/gateway/mqtt-connector/disconnect-request-example-1-ce.png deleted file mode 100755 index bc45e213f8..0000000000 Binary files a/images/gateway/mqtt-connector/disconnect-request-example-1-ce.png and /dev/null differ diff --git a/images/gateway/mqtt-connector/examples/attribute-request-1-preview.png b/images/gateway/mqtt-connector/examples/attribute-request-1-preview.png new file mode 100644 index 0000000000..6e87cd1dac Binary files /dev/null and b/images/gateway/mqtt-connector/examples/attribute-request-1-preview.png differ diff --git a/images/gateway/mqtt-connector/examples/attribute-request-1.png b/images/gateway/mqtt-connector/examples/attribute-request-1.png new file mode 100644 index 0000000000..6e87cd1dac Binary files /dev/null and b/images/gateway/mqtt-connector/examples/attribute-request-1.png differ diff --git a/images/gateway/mqtt-connector/examples/attribute-request-2-preview.png b/images/gateway/mqtt-connector/examples/attribute-request-2-preview.png new file mode 100644 index 0000000000..554b3af473 Binary files /dev/null and b/images/gateway/mqtt-connector/examples/attribute-request-2-preview.png differ diff --git a/images/gateway/mqtt-connector/examples/attribute-request-2.png b/images/gateway/mqtt-connector/examples/attribute-request-2.png new file mode 100644 index 0000000000..554b3af473 Binary files /dev/null and b/images/gateway/mqtt-connector/examples/attribute-request-2.png differ diff --git a/images/gateway/mqtt-connector/examples/attribute-request-3-preview.png b/images/gateway/mqtt-connector/examples/attribute-request-3-preview.png new file mode 100644 index 0000000000..2425698371 Binary files /dev/null and b/images/gateway/mqtt-connector/examples/attribute-request-3-preview.png differ diff --git a/images/gateway/mqtt-connector/examples/attribute-request-3.png b/images/gateway/mqtt-connector/examples/attribute-request-3.png new file mode 100644 index 0000000000..2425698371 Binary files /dev/null and b/images/gateway/mqtt-connector/examples/attribute-request-3.png differ diff --git a/images/gateway/mqtt-connector/examples/attribute-request-4-preview.png b/images/gateway/mqtt-connector/examples/attribute-request-4-preview.png new file mode 100644 index 0000000000..43a3cf1bea Binary files /dev/null and b/images/gateway/mqtt-connector/examples/attribute-request-4-preview.png differ diff --git a/images/gateway/mqtt-connector/examples/attribute-request-4.png b/images/gateway/mqtt-connector/examples/attribute-request-4.png new file mode 100644 index 0000000000..43a3cf1bea Binary files /dev/null and b/images/gateway/mqtt-connector/examples/attribute-request-4.png differ diff --git a/images/gateway/mqtt-connector/examples/attribute-updates-1-preview.png b/images/gateway/mqtt-connector/examples/attribute-updates-1-preview.png new file mode 100644 index 0000000000..9b3c39bd4e Binary files /dev/null and b/images/gateway/mqtt-connector/examples/attribute-updates-1-preview.png differ diff --git a/images/gateway/mqtt-connector/examples/attribute-updates-1.png b/images/gateway/mqtt-connector/examples/attribute-updates-1.png new file mode 100644 index 0000000000..9b3c39bd4e Binary files /dev/null and b/images/gateway/mqtt-connector/examples/attribute-updates-1.png differ diff --git a/images/gateway/mqtt-connector/examples/attribute-updates-2-preview.png b/images/gateway/mqtt-connector/examples/attribute-updates-2-preview.png new file mode 100644 index 0000000000..222b0a826b Binary files /dev/null and b/images/gateway/mqtt-connector/examples/attribute-updates-2-preview.png differ diff --git a/images/gateway/mqtt-connector/examples/attribute-updates-2.png b/images/gateway/mqtt-connector/examples/attribute-updates-2.png new file mode 100644 index 0000000000..222b0a826b Binary files /dev/null and b/images/gateway/mqtt-connector/examples/attribute-updates-2.png differ diff --git a/images/gateway/mqtt-connector/examples/attribute-updates-3-preview.png b/images/gateway/mqtt-connector/examples/attribute-updates-3-preview.png new file mode 100644 index 0000000000..d366b22884 Binary files /dev/null and b/images/gateway/mqtt-connector/examples/attribute-updates-3-preview.png differ diff --git a/images/gateway/mqtt-connector/examples/attribute-updates-3.png b/images/gateway/mqtt-connector/examples/attribute-updates-3.png new file mode 100644 index 0000000000..d366b22884 Binary files /dev/null and b/images/gateway/mqtt-connector/examples/attribute-updates-3.png differ diff --git a/images/gateway/mqtt-connector/examples/attributes-time-series-bytes-2-preview.png b/images/gateway/mqtt-connector/examples/attributes-time-series-bytes-2-preview.png new file mode 100644 index 0000000000..2fabd54d54 Binary files /dev/null and b/images/gateway/mqtt-connector/examples/attributes-time-series-bytes-2-preview.png differ diff --git a/images/gateway/mqtt-connector/examples/attributes-time-series-bytes-2.png b/images/gateway/mqtt-connector/examples/attributes-time-series-bytes-2.png new file mode 100644 index 0000000000..2fabd54d54 Binary files /dev/null and b/images/gateway/mqtt-connector/examples/attributes-time-series-bytes-2.png differ diff --git a/images/gateway/mqtt-connector/examples/attributes-time-series-bytes-3-preview.png b/images/gateway/mqtt-connector/examples/attributes-time-series-bytes-3-preview.png new file mode 100644 index 0000000000..aef0b78020 Binary files /dev/null and b/images/gateway/mqtt-connector/examples/attributes-time-series-bytes-3-preview.png differ diff --git a/images/gateway/mqtt-connector/examples/attributes-time-series-bytes-3.png b/images/gateway/mqtt-connector/examples/attributes-time-series-bytes-3.png new file mode 100644 index 0000000000..aef0b78020 Binary files /dev/null and b/images/gateway/mqtt-connector/examples/attributes-time-series-bytes-3.png differ diff --git a/images/gateway/mqtt-connector/examples/attributes-time-series-bytes-4-preview.png b/images/gateway/mqtt-connector/examples/attributes-time-series-bytes-4-preview.png new file mode 100644 index 0000000000..bdb893c23c Binary files /dev/null and b/images/gateway/mqtt-connector/examples/attributes-time-series-bytes-4-preview.png differ diff --git a/images/gateway/mqtt-connector/examples/attributes-time-series-bytes-4.png b/images/gateway/mqtt-connector/examples/attributes-time-series-bytes-4.png new file mode 100644 index 0000000000..bdb893c23c Binary files /dev/null and b/images/gateway/mqtt-connector/examples/attributes-time-series-bytes-4.png differ diff --git a/images/gateway/mqtt-connector/examples/attributes-time-series-bytes-5-preview.png b/images/gateway/mqtt-connector/examples/attributes-time-series-bytes-5-preview.png new file mode 100644 index 0000000000..bb59ee4e51 Binary files /dev/null and b/images/gateway/mqtt-connector/examples/attributes-time-series-bytes-5-preview.png differ diff --git a/images/gateway/mqtt-connector/examples/attributes-time-series-bytes-5.png b/images/gateway/mqtt-connector/examples/attributes-time-series-bytes-5.png new file mode 100644 index 0000000000..bb59ee4e51 Binary files /dev/null and b/images/gateway/mqtt-connector/examples/attributes-time-series-bytes-5.png differ diff --git a/images/gateway/mqtt-connector/examples/attributes-time-series-bytes-6-preview.png b/images/gateway/mqtt-connector/examples/attributes-time-series-bytes-6-preview.png new file mode 100644 index 0000000000..ccba6668bd Binary files /dev/null and b/images/gateway/mqtt-connector/examples/attributes-time-series-bytes-6-preview.png differ diff --git a/images/gateway/mqtt-connector/examples/attributes-time-series-bytes-6.png b/images/gateway/mqtt-connector/examples/attributes-time-series-bytes-6.png new file mode 100644 index 0000000000..ccba6668bd Binary files /dev/null and b/images/gateway/mqtt-connector/examples/attributes-time-series-bytes-6.png differ diff --git a/images/gateway/mqtt-connector/examples/attributes-time-series-bytes-7-preview.png b/images/gateway/mqtt-connector/examples/attributes-time-series-bytes-7-preview.png new file mode 100644 index 0000000000..62f41caf6a Binary files /dev/null and b/images/gateway/mqtt-connector/examples/attributes-time-series-bytes-7-preview.png differ diff --git a/images/gateway/mqtt-connector/examples/attributes-time-series-bytes-7.png b/images/gateway/mqtt-connector/examples/attributes-time-series-bytes-7.png new file mode 100644 index 0000000000..62f41caf6a Binary files /dev/null and b/images/gateway/mqtt-connector/examples/attributes-time-series-bytes-7.png differ diff --git a/images/gateway/mqtt-connector/examples/attributes-time-series-json-path-2-preview.png b/images/gateway/mqtt-connector/examples/attributes-time-series-json-path-2-preview.png new file mode 100644 index 0000000000..3501a9a7ee Binary files /dev/null and b/images/gateway/mqtt-connector/examples/attributes-time-series-json-path-2-preview.png differ diff --git a/images/gateway/mqtt-connector/examples/attributes-time-series-json-path-2.png b/images/gateway/mqtt-connector/examples/attributes-time-series-json-path-2.png new file mode 100644 index 0000000000..3501a9a7ee Binary files /dev/null and b/images/gateway/mqtt-connector/examples/attributes-time-series-json-path-2.png differ diff --git a/images/gateway/mqtt-connector/examples/attributes-time-series-json-path-3-preview.png b/images/gateway/mqtt-connector/examples/attributes-time-series-json-path-3-preview.png new file mode 100644 index 0000000000..b6afba452c Binary files /dev/null and b/images/gateway/mqtt-connector/examples/attributes-time-series-json-path-3-preview.png differ diff --git a/images/gateway/mqtt-connector/examples/attributes-time-series-json-path-3.png b/images/gateway/mqtt-connector/examples/attributes-time-series-json-path-3.png new file mode 100644 index 0000000000..b6afba452c Binary files /dev/null and b/images/gateway/mqtt-connector/examples/attributes-time-series-json-path-3.png differ diff --git a/images/gateway/mqtt-connector/examples/attributes-time-series-json-path-4-preview.png b/images/gateway/mqtt-connector/examples/attributes-time-series-json-path-4-preview.png new file mode 100644 index 0000000000..3a5f286139 Binary files /dev/null and b/images/gateway/mqtt-connector/examples/attributes-time-series-json-path-4-preview.png differ diff --git a/images/gateway/mqtt-connector/examples/attributes-time-series-json-path-4.png b/images/gateway/mqtt-connector/examples/attributes-time-series-json-path-4.png new file mode 100644 index 0000000000..3a5f286139 Binary files /dev/null and b/images/gateway/mqtt-connector/examples/attributes-time-series-json-path-4.png differ diff --git a/images/gateway/mqtt-connector/examples/attributes-time-series-json-path-5-preview.png b/images/gateway/mqtt-connector/examples/attributes-time-series-json-path-5-preview.png new file mode 100644 index 0000000000..b976afbd25 Binary files /dev/null and b/images/gateway/mqtt-connector/examples/attributes-time-series-json-path-5-preview.png differ diff --git a/images/gateway/mqtt-connector/examples/attributes-time-series-json-path-5.png b/images/gateway/mqtt-connector/examples/attributes-time-series-json-path-5.png new file mode 100644 index 0000000000..b976afbd25 Binary files /dev/null and b/images/gateway/mqtt-connector/examples/attributes-time-series-json-path-5.png differ diff --git a/images/gateway/mqtt-connector/examples/attributes-time-series-json-path-6-preview.png b/images/gateway/mqtt-connector/examples/attributes-time-series-json-path-6-preview.png new file mode 100644 index 0000000000..07939d03a7 Binary files /dev/null and b/images/gateway/mqtt-connector/examples/attributes-time-series-json-path-6-preview.png differ diff --git a/images/gateway/mqtt-connector/examples/attributes-time-series-json-path-6.png b/images/gateway/mqtt-connector/examples/attributes-time-series-json-path-6.png new file mode 100644 index 0000000000..07939d03a7 Binary files /dev/null and b/images/gateway/mqtt-connector/examples/attributes-time-series-json-path-6.png differ diff --git a/images/gateway/mqtt-connector/examples/attributes-time-series-json-path-7-preview.png b/images/gateway/mqtt-connector/examples/attributes-time-series-json-path-7-preview.png new file mode 100644 index 0000000000..e6eecb2bcf Binary files /dev/null and b/images/gateway/mqtt-connector/examples/attributes-time-series-json-path-7-preview.png differ diff --git a/images/gateway/mqtt-connector/examples/attributes-time-series-json-path-7.png b/images/gateway/mqtt-connector/examples/attributes-time-series-json-path-7.png new file mode 100644 index 0000000000..e6eecb2bcf Binary files /dev/null and b/images/gateway/mqtt-connector/examples/attributes-time-series-json-path-7.png differ diff --git a/images/gateway/mqtt-connector/examples/connect-request-1-preview.png b/images/gateway/mqtt-connector/examples/connect-request-1-preview.png new file mode 100644 index 0000000000..cb89cfe43a Binary files /dev/null and b/images/gateway/mqtt-connector/examples/connect-request-1-preview.png differ diff --git a/images/gateway/mqtt-connector/examples/connect-request-1.png b/images/gateway/mqtt-connector/examples/connect-request-1.png new file mode 100644 index 0000000000..cb89cfe43a Binary files /dev/null and b/images/gateway/mqtt-connector/examples/connect-request-1.png differ diff --git a/images/gateway/mqtt-connector/examples/connect-request-2-preview.png b/images/gateway/mqtt-connector/examples/connect-request-2-preview.png new file mode 100644 index 0000000000..f1e2b6b905 Binary files /dev/null and b/images/gateway/mqtt-connector/examples/connect-request-2-preview.png differ diff --git a/images/gateway/mqtt-connector/examples/connect-request-2.png b/images/gateway/mqtt-connector/examples/connect-request-2.png new file mode 100644 index 0000000000..f1e2b6b905 Binary files /dev/null and b/images/gateway/mqtt-connector/examples/connect-request-2.png differ diff --git a/images/gateway/mqtt-connector/examples/connect-request-3-preview.png b/images/gateway/mqtt-connector/examples/connect-request-3-preview.png new file mode 100644 index 0000000000..a25287e35f Binary files /dev/null and b/images/gateway/mqtt-connector/examples/connect-request-3-preview.png differ diff --git a/images/gateway/mqtt-connector/examples/connect-request-3.png b/images/gateway/mqtt-connector/examples/connect-request-3.png new file mode 100644 index 0000000000..a25287e35f Binary files /dev/null and b/images/gateway/mqtt-connector/examples/connect-request-3.png differ diff --git a/images/gateway/mqtt-connector/examples/connect-request-4-preview.png b/images/gateway/mqtt-connector/examples/connect-request-4-preview.png new file mode 100644 index 0000000000..0c2435af0e Binary files /dev/null and b/images/gateway/mqtt-connector/examples/connect-request-4-preview.png differ diff --git a/images/gateway/mqtt-connector/examples/connect-request-4.png b/images/gateway/mqtt-connector/examples/connect-request-4.png new file mode 100644 index 0000000000..0c2435af0e Binary files /dev/null and b/images/gateway/mqtt-connector/examples/connect-request-4.png differ diff --git a/images/gateway/mqtt-connector/examples/connect-request-5-preview.png b/images/gateway/mqtt-connector/examples/connect-request-5-preview.png new file mode 100644 index 0000000000..819a3556f3 Binary files /dev/null and b/images/gateway/mqtt-connector/examples/connect-request-5-preview.png differ diff --git a/images/gateway/mqtt-connector/examples/connect-request-5.png b/images/gateway/mqtt-connector/examples/connect-request-5.png new file mode 100644 index 0000000000..819a3556f3 Binary files /dev/null and b/images/gateway/mqtt-connector/examples/connect-request-5.png differ diff --git a/images/gateway/mqtt-connector/examples/connect-request-6-preview.png b/images/gateway/mqtt-connector/examples/connect-request-6-preview.png new file mode 100644 index 0000000000..c792142f41 Binary files /dev/null and b/images/gateway/mqtt-connector/examples/connect-request-6-preview.png differ diff --git a/images/gateway/mqtt-connector/examples/connect-request-6.png b/images/gateway/mqtt-connector/examples/connect-request-6.png new file mode 100644 index 0000000000..c792142f41 Binary files /dev/null and b/images/gateway/mqtt-connector/examples/connect-request-6.png differ diff --git a/images/gateway/mqtt-connector/examples/connect-request-gateway-preview.png b/images/gateway/mqtt-connector/examples/connect-request-gateway-preview.png new file mode 100644 index 0000000000..982db57aee Binary files /dev/null and b/images/gateway/mqtt-connector/examples/connect-request-gateway-preview.png differ diff --git a/images/gateway/mqtt-connector/examples/connect-request-gateway.png b/images/gateway/mqtt-connector/examples/connect-request-gateway.png new file mode 100644 index 0000000000..982db57aee Binary files /dev/null and b/images/gateway/mqtt-connector/examples/connect-request-gateway.png differ diff --git a/images/gateway/mqtt-connector/examples/device-name-and-profile-message-and-constant-bytes-4-preview.png b/images/gateway/mqtt-connector/examples/device-name-and-profile-message-and-constant-bytes-4-preview.png new file mode 100644 index 0000000000..ab0fe37ca8 Binary files /dev/null and b/images/gateway/mqtt-connector/examples/device-name-and-profile-message-and-constant-bytes-4-preview.png differ diff --git a/images/gateway/mqtt-connector/examples/device-name-and-profile-message-and-constant-bytes-4.png b/images/gateway/mqtt-connector/examples/device-name-and-profile-message-and-constant-bytes-4.png new file mode 100644 index 0000000000..ab0fe37ca8 Binary files /dev/null and b/images/gateway/mqtt-connector/examples/device-name-and-profile-message-and-constant-bytes-4.png differ diff --git a/images/gateway/mqtt-connector/examples/device-name-and-profile-message-and-constant-bytes-5-preview.png b/images/gateway/mqtt-connector/examples/device-name-and-profile-message-and-constant-bytes-5-preview.png new file mode 100644 index 0000000000..8f133fd753 Binary files /dev/null and b/images/gateway/mqtt-connector/examples/device-name-and-profile-message-and-constant-bytes-5-preview.png differ diff --git a/images/gateway/mqtt-connector/examples/device-name-and-profile-message-and-constant-bytes-5.png b/images/gateway/mqtt-connector/examples/device-name-and-profile-message-and-constant-bytes-5.png new file mode 100644 index 0000000000..8f133fd753 Binary files /dev/null and b/images/gateway/mqtt-connector/examples/device-name-and-profile-message-and-constant-bytes-5.png differ diff --git a/images/gateway/mqtt-connector/examples/device-name-and-profile-message-and-constant-bytes-6-preview.png b/images/gateway/mqtt-connector/examples/device-name-and-profile-message-and-constant-bytes-6-preview.png new file mode 100644 index 0000000000..3cd667b075 Binary files /dev/null and b/images/gateway/mqtt-connector/examples/device-name-and-profile-message-and-constant-bytes-6-preview.png differ diff --git a/images/gateway/mqtt-connector/examples/device-name-and-profile-message-and-constant-bytes-6.png b/images/gateway/mqtt-connector/examples/device-name-and-profile-message-and-constant-bytes-6.png new file mode 100644 index 0000000000..3cd667b075 Binary files /dev/null and b/images/gateway/mqtt-connector/examples/device-name-and-profile-message-and-constant-bytes-6.png differ diff --git a/images/gateway/mqtt-connector/examples/device-name-and-profile-message-and-constant-bytes-7-preview.png b/images/gateway/mqtt-connector/examples/device-name-and-profile-message-and-constant-bytes-7-preview.png new file mode 100644 index 0000000000..bdb4d8d980 Binary files /dev/null and b/images/gateway/mqtt-connector/examples/device-name-and-profile-message-and-constant-bytes-7-preview.png differ diff --git a/images/gateway/mqtt-connector/examples/device-name-and-profile-message-and-constant-bytes-7.png b/images/gateway/mqtt-connector/examples/device-name-and-profile-message-and-constant-bytes-7.png new file mode 100644 index 0000000000..bdb4d8d980 Binary files /dev/null and b/images/gateway/mqtt-connector/examples/device-name-and-profile-message-and-constant-bytes-7.png differ diff --git a/images/gateway/mqtt-connector/examples/device-name-and-profile-message-and-constant-bytes-8-preview.png b/images/gateway/mqtt-connector/examples/device-name-and-profile-message-and-constant-bytes-8-preview.png new file mode 100644 index 0000000000..8abae5bc5e Binary files /dev/null and b/images/gateway/mqtt-connector/examples/device-name-and-profile-message-and-constant-bytes-8-preview.png differ diff --git a/images/gateway/mqtt-connector/examples/device-name-and-profile-message-and-constant-bytes-8.png b/images/gateway/mqtt-connector/examples/device-name-and-profile-message-and-constant-bytes-8.png new file mode 100644 index 0000000000..8abae5bc5e Binary files /dev/null and b/images/gateway/mqtt-connector/examples/device-name-and-profile-message-and-constant-bytes-8.png differ diff --git a/images/gateway/mqtt-connector/examples/device-name-and-profile-message-and-constant-bytes-9-preview.png b/images/gateway/mqtt-connector/examples/device-name-and-profile-message-and-constant-bytes-9-preview.png new file mode 100644 index 0000000000..4324fd3d91 Binary files /dev/null and b/images/gateway/mqtt-connector/examples/device-name-and-profile-message-and-constant-bytes-9-preview.png differ diff --git a/images/gateway/mqtt-connector/examples/device-name-and-profile-message-and-constant-bytes-9.png b/images/gateway/mqtt-connector/examples/device-name-and-profile-message-and-constant-bytes-9.png new file mode 100644 index 0000000000..4324fd3d91 Binary files /dev/null and b/images/gateway/mqtt-connector/examples/device-name-and-profile-message-and-constant-bytes-9.png differ diff --git a/images/gateway/mqtt-connector/examples/device-name-and-profile-message-json-1-preview.png b/images/gateway/mqtt-connector/examples/device-name-and-profile-message-json-1-preview.png new file mode 100644 index 0000000000..9b878abd6c Binary files /dev/null and b/images/gateway/mqtt-connector/examples/device-name-and-profile-message-json-1-preview.png differ diff --git a/images/gateway/mqtt-connector/examples/device-name-and-profile-message-json-1.png b/images/gateway/mqtt-connector/examples/device-name-and-profile-message-json-1.png new file mode 100644 index 0000000000..9b878abd6c Binary files /dev/null and b/images/gateway/mqtt-connector/examples/device-name-and-profile-message-json-1.png differ diff --git a/images/gateway/mqtt-connector/examples/device-name-and-profile-message-json-2-preview.png b/images/gateway/mqtt-connector/examples/device-name-and-profile-message-json-2-preview.png new file mode 100644 index 0000000000..7d7f30ad6f Binary files /dev/null and b/images/gateway/mqtt-connector/examples/device-name-and-profile-message-json-2-preview.png differ diff --git a/images/gateway/mqtt-connector/examples/device-name-and-profile-message-json-2.png b/images/gateway/mqtt-connector/examples/device-name-and-profile-message-json-2.png new file mode 100644 index 0000000000..7d7f30ad6f Binary files /dev/null and b/images/gateway/mqtt-connector/examples/device-name-and-profile-message-json-2.png differ diff --git a/images/gateway/mqtt-connector/examples/device-name-and-profile-message-json-3-preview.png b/images/gateway/mqtt-connector/examples/device-name-and-profile-message-json-3-preview.png new file mode 100644 index 0000000000..31155a8424 Binary files /dev/null and b/images/gateway/mqtt-connector/examples/device-name-and-profile-message-json-3-preview.png differ diff --git a/images/gateway/mqtt-connector/examples/device-name-and-profile-message-json-3.png b/images/gateway/mqtt-connector/examples/device-name-and-profile-message-json-3.png new file mode 100644 index 0000000000..31155a8424 Binary files /dev/null and b/images/gateway/mqtt-connector/examples/device-name-and-profile-message-json-3.png differ diff --git a/images/gateway/mqtt-connector/examples/device-name-and-profile-message-json-4-preview.png b/images/gateway/mqtt-connector/examples/device-name-and-profile-message-json-4-preview.png new file mode 100644 index 0000000000..6d8bad44d3 Binary files /dev/null and b/images/gateway/mqtt-connector/examples/device-name-and-profile-message-json-4-preview.png differ diff --git a/images/gateway/mqtt-connector/examples/device-name-and-profile-message-json-4.png b/images/gateway/mqtt-connector/examples/device-name-and-profile-message-json-4.png new file mode 100644 index 0000000000..6d8bad44d3 Binary files /dev/null and b/images/gateway/mqtt-connector/examples/device-name-and-profile-message-json-4.png differ diff --git a/images/gateway/mqtt-connector/examples/device-name-and-profile-message-json-5-preview.png b/images/gateway/mqtt-connector/examples/device-name-and-profile-message-json-5-preview.png new file mode 100644 index 0000000000..2a2e549e7e Binary files /dev/null and b/images/gateway/mqtt-connector/examples/device-name-and-profile-message-json-5-preview.png differ diff --git a/images/gateway/mqtt-connector/examples/device-name-and-profile-message-json-5.png b/images/gateway/mqtt-connector/examples/device-name-and-profile-message-json-5.png new file mode 100644 index 0000000000..2a2e549e7e Binary files /dev/null and b/images/gateway/mqtt-connector/examples/device-name-and-profile-message-json-5.png differ diff --git a/images/gateway/mqtt-connector/examples/device-name-and-profile-message-json-6-preview.png b/images/gateway/mqtt-connector/examples/device-name-and-profile-message-json-6-preview.png new file mode 100644 index 0000000000..04286a9489 Binary files /dev/null and b/images/gateway/mqtt-connector/examples/device-name-and-profile-message-json-6-preview.png differ diff --git a/images/gateway/mqtt-connector/examples/device-name-and-profile-message-json-6.png b/images/gateway/mqtt-connector/examples/device-name-and-profile-message-json-6.png new file mode 100644 index 0000000000..04286a9489 Binary files /dev/null and b/images/gateway/mqtt-connector/examples/device-name-and-profile-message-json-6.png differ diff --git a/images/gateway/mqtt-connector/examples/device-name-and-profile-message-json-7-preview.png b/images/gateway/mqtt-connector/examples/device-name-and-profile-message-json-7-preview.png new file mode 100644 index 0000000000..48972441e1 Binary files /dev/null and b/images/gateway/mqtt-connector/examples/device-name-and-profile-message-json-7-preview.png differ diff --git a/images/gateway/mqtt-connector/examples/device-name-and-profile-message-json-7.png b/images/gateway/mqtt-connector/examples/device-name-and-profile-message-json-7.png new file mode 100644 index 0000000000..48972441e1 Binary files /dev/null and b/images/gateway/mqtt-connector/examples/device-name-and-profile-message-json-7.png differ diff --git a/images/gateway/mqtt-connector/examples/device-name-and-profile-message-json-8-preview.png b/images/gateway/mqtt-connector/examples/device-name-and-profile-message-json-8-preview.png new file mode 100644 index 0000000000..ff89602539 Binary files /dev/null and b/images/gateway/mqtt-connector/examples/device-name-and-profile-message-json-8-preview.png differ diff --git a/images/gateway/mqtt-connector/examples/device-name-and-profile-message-json-8.png b/images/gateway/mqtt-connector/examples/device-name-and-profile-message-json-8.png new file mode 100644 index 0000000000..ff89602539 Binary files /dev/null and b/images/gateway/mqtt-connector/examples/device-name-and-profile-message-json-8.png differ diff --git a/images/gateway/mqtt-connector/examples/device-name-and-profile-message-json-9-preview.png b/images/gateway/mqtt-connector/examples/device-name-and-profile-message-json-9-preview.png new file mode 100644 index 0000000000..47b9448082 Binary files /dev/null and b/images/gateway/mqtt-connector/examples/device-name-and-profile-message-json-9-preview.png differ diff --git a/images/gateway/mqtt-connector/examples/device-name-and-profile-message-json-9.png b/images/gateway/mqtt-connector/examples/device-name-and-profile-message-json-9.png new file mode 100644 index 0000000000..47b9448082 Binary files /dev/null and b/images/gateway/mqtt-connector/examples/device-name-and-profile-message-json-9.png differ diff --git a/images/gateway/mqtt-connector/examples/device-name-and-profile-topic-constant-json-4-preview.png b/images/gateway/mqtt-connector/examples/device-name-and-profile-topic-constant-json-4-preview.png new file mode 100644 index 0000000000..491e469795 Binary files /dev/null and b/images/gateway/mqtt-connector/examples/device-name-and-profile-topic-constant-json-4-preview.png differ diff --git a/images/gateway/mqtt-connector/examples/device-name-and-profile-topic-constant-json-4.png b/images/gateway/mqtt-connector/examples/device-name-and-profile-topic-constant-json-4.png new file mode 100644 index 0000000000..607bf45e24 Binary files /dev/null and b/images/gateway/mqtt-connector/examples/device-name-and-profile-topic-constant-json-4.png differ diff --git a/images/gateway/mqtt-connector/examples/device-name-and-profile-topic-constant-json-5-preview.png b/images/gateway/mqtt-connector/examples/device-name-and-profile-topic-constant-json-5-preview.png new file mode 100644 index 0000000000..6f60952166 Binary files /dev/null and b/images/gateway/mqtt-connector/examples/device-name-and-profile-topic-constant-json-5-preview.png differ diff --git a/images/gateway/mqtt-connector/examples/device-name-and-profile-topic-constant-json-5.png b/images/gateway/mqtt-connector/examples/device-name-and-profile-topic-constant-json-5.png new file mode 100644 index 0000000000..6f60952166 Binary files /dev/null and b/images/gateway/mqtt-connector/examples/device-name-and-profile-topic-constant-json-5.png differ diff --git a/images/gateway/mqtt-connector/examples/device-name-and-profile-topic-constant-json-6-preview.png b/images/gateway/mqtt-connector/examples/device-name-and-profile-topic-constant-json-6-preview.png new file mode 100644 index 0000000000..0e099f2be3 Binary files /dev/null and b/images/gateway/mqtt-connector/examples/device-name-and-profile-topic-constant-json-6-preview.png differ diff --git a/images/gateway/mqtt-connector/examples/device-name-and-profile-topic-constant-json-6.png b/images/gateway/mqtt-connector/examples/device-name-and-profile-topic-constant-json-6.png new file mode 100644 index 0000000000..0e099f2be3 Binary files /dev/null and b/images/gateway/mqtt-connector/examples/device-name-and-profile-topic-constant-json-6.png differ diff --git a/images/gateway/mqtt-connector/examples/device-name-and-profile-topic-constant-json-7-preview.png b/images/gateway/mqtt-connector/examples/device-name-and-profile-topic-constant-json-7-preview.png new file mode 100644 index 0000000000..23598e9c06 Binary files /dev/null and b/images/gateway/mqtt-connector/examples/device-name-and-profile-topic-constant-json-7-preview.png differ diff --git a/images/gateway/mqtt-connector/examples/device-name-and-profile-topic-constant-json-7.png b/images/gateway/mqtt-connector/examples/device-name-and-profile-topic-constant-json-7.png new file mode 100644 index 0000000000..23598e9c06 Binary files /dev/null and b/images/gateway/mqtt-connector/examples/device-name-and-profile-topic-constant-json-7.png differ diff --git a/images/gateway/mqtt-connector/examples/device-name-and-profile-topic-constant-json-9-preview.png b/images/gateway/mqtt-connector/examples/device-name-and-profile-topic-constant-json-9-preview.png new file mode 100644 index 0000000000..611859521d Binary files /dev/null and b/images/gateway/mqtt-connector/examples/device-name-and-profile-topic-constant-json-9-preview.png differ diff --git a/images/gateway/mqtt-connector/examples/device-name-and-profile-topic-constant-json-9.png b/images/gateway/mqtt-connector/examples/device-name-and-profile-topic-constant-json-9.png new file mode 100644 index 0000000000..611859521d Binary files /dev/null and b/images/gateway/mqtt-connector/examples/device-name-and-profile-topic-constant-json-9.png differ diff --git a/images/gateway/mqtt-connector/examples/disconnect-request-1-preview.png b/images/gateway/mqtt-connector/examples/disconnect-request-1-preview.png new file mode 100644 index 0000000000..da7cb6f58c Binary files /dev/null and b/images/gateway/mqtt-connector/examples/disconnect-request-1-preview.png differ diff --git a/images/gateway/mqtt-connector/examples/disconnect-request-1.png b/images/gateway/mqtt-connector/examples/disconnect-request-1.png new file mode 100644 index 0000000000..da7cb6f58c Binary files /dev/null and b/images/gateway/mqtt-connector/examples/disconnect-request-1.png differ diff --git a/images/gateway/mqtt-connector/examples/disconnect-request-2-preview.png b/images/gateway/mqtt-connector/examples/disconnect-request-2-preview.png new file mode 100644 index 0000000000..8b02cf5b81 Binary files /dev/null and b/images/gateway/mqtt-connector/examples/disconnect-request-2-preview.png differ diff --git a/images/gateway/mqtt-connector/examples/disconnect-request-2.png b/images/gateway/mqtt-connector/examples/disconnect-request-2.png new file mode 100644 index 0000000000..8b02cf5b81 Binary files /dev/null and b/images/gateway/mqtt-connector/examples/disconnect-request-2.png differ diff --git a/images/gateway/mqtt-connector/examples/disconnect-request-3-preview.png b/images/gateway/mqtt-connector/examples/disconnect-request-3-preview.png new file mode 100644 index 0000000000..adff39e1c0 Binary files /dev/null and b/images/gateway/mqtt-connector/examples/disconnect-request-3-preview.png differ diff --git a/images/gateway/mqtt-connector/examples/disconnect-request-3.png b/images/gateway/mqtt-connector/examples/disconnect-request-3.png new file mode 100644 index 0000000000..adff39e1c0 Binary files /dev/null and b/images/gateway/mqtt-connector/examples/disconnect-request-3.png differ diff --git a/images/gateway/mqtt-connector/examples/disconnect-request-4-preview.png b/images/gateway/mqtt-connector/examples/disconnect-request-4-preview.png new file mode 100644 index 0000000000..371b305894 Binary files /dev/null and b/images/gateway/mqtt-connector/examples/disconnect-request-4-preview.png differ diff --git a/images/gateway/mqtt-connector/examples/disconnect-request-4.png b/images/gateway/mqtt-connector/examples/disconnect-request-4.png new file mode 100644 index 0000000000..371b305894 Binary files /dev/null and b/images/gateway/mqtt-connector/examples/disconnect-request-4.png differ diff --git a/images/gateway/mqtt-connector/examples/disconnect-request-5-preview.png b/images/gateway/mqtt-connector/examples/disconnect-request-5-preview.png new file mode 100644 index 0000000000..0c6f7b7561 Binary files /dev/null and b/images/gateway/mqtt-connector/examples/disconnect-request-5-preview.png differ diff --git a/images/gateway/mqtt-connector/examples/disconnect-request-5.png b/images/gateway/mqtt-connector/examples/disconnect-request-5.png new file mode 100644 index 0000000000..0c6f7b7561 Binary files /dev/null and b/images/gateway/mqtt-connector/examples/disconnect-request-5.png differ diff --git a/images/gateway/mqtt-connector/examples/disconnect-request-6-preview.png b/images/gateway/mqtt-connector/examples/disconnect-request-6-preview.png new file mode 100644 index 0000000000..e06de36b51 Binary files /dev/null and b/images/gateway/mqtt-connector/examples/disconnect-request-6-preview.png differ diff --git a/images/gateway/mqtt-connector/examples/disconnect-request-6.png b/images/gateway/mqtt-connector/examples/disconnect-request-6.png new file mode 100644 index 0000000000..e06de36b51 Binary files /dev/null and b/images/gateway/mqtt-connector/examples/disconnect-request-6.png differ diff --git a/images/gateway/mqtt-connector/examples/disconnect-request-gateway-preview.png b/images/gateway/mqtt-connector/examples/disconnect-request-gateway-preview.png new file mode 100644 index 0000000000..444ae4f40c Binary files /dev/null and b/images/gateway/mqtt-connector/examples/disconnect-request-gateway-preview.png differ diff --git a/images/gateway/mqtt-connector/examples/disconnect-request-gateway.png b/images/gateway/mqtt-connector/examples/disconnect-request-gateway.png new file mode 100644 index 0000000000..444ae4f40c Binary files /dev/null and b/images/gateway/mqtt-connector/examples/disconnect-request-gateway.png differ diff --git a/images/gateway/mqtt-connector/examples/mqtt-gateway-configuring-11-ce-preview.png b/images/gateway/mqtt-connector/examples/mqtt-gateway-configuring-11-ce-preview.png new file mode 100644 index 0000000000..858c2b7054 Binary files /dev/null and b/images/gateway/mqtt-connector/examples/mqtt-gateway-configuring-11-ce-preview.png differ diff --git a/images/gateway/mqtt-connector/examples/mqtt-gateway-configuring-11-ce.png b/images/gateway/mqtt-connector/examples/mqtt-gateway-configuring-11-ce.png new file mode 100644 index 0000000000..858c2b7054 Binary files /dev/null and b/images/gateway/mqtt-connector/examples/mqtt-gateway-configuring-11-ce.png differ diff --git a/images/gateway/mqtt-connector/examples/result-device-overview-1-connect.png b/images/gateway/mqtt-connector/examples/result-device-overview-1-connect.png new file mode 100644 index 0000000000..50813343ef Binary files /dev/null and b/images/gateway/mqtt-connector/examples/result-device-overview-1-connect.png differ diff --git a/images/gateway/mqtt-connector/examples/result-device-overview-1-disconnect.png b/images/gateway/mqtt-connector/examples/result-device-overview-1-disconnect.png new file mode 100644 index 0000000000..44b9650b69 Binary files /dev/null and b/images/gateway/mqtt-connector/examples/result-device-overview-1-disconnect.png differ diff --git a/images/gateway/mqtt-connector/examples/result-device-overview-1-preview.png b/images/gateway/mqtt-connector/examples/result-device-overview-1-preview.png new file mode 100644 index 0000000000..98456ebe05 Binary files /dev/null and b/images/gateway/mqtt-connector/examples/result-device-overview-1-preview.png differ diff --git a/images/gateway/mqtt-connector/examples/result-device-overview-1.png b/images/gateway/mqtt-connector/examples/result-device-overview-1.png new file mode 100644 index 0000000000..98456ebe05 Binary files /dev/null and b/images/gateway/mqtt-connector/examples/result-device-overview-1.png differ diff --git a/images/gateway/mqtt-connector/examples/result-device-overview-2-disconnect.png b/images/gateway/mqtt-connector/examples/result-device-overview-2-disconnect.png new file mode 100644 index 0000000000..05f3b3b046 Binary files /dev/null and b/images/gateway/mqtt-connector/examples/result-device-overview-2-disconnect.png differ diff --git a/images/gateway/mqtt-connector/examples/result-device-overview-2-preview.png b/images/gateway/mqtt-connector/examples/result-device-overview-2-preview.png new file mode 100644 index 0000000000..a93095b89b Binary files /dev/null and b/images/gateway/mqtt-connector/examples/result-device-overview-2-preview.png differ diff --git a/images/gateway/mqtt-connector/examples/result-device-overview-2.png b/images/gateway/mqtt-connector/examples/result-device-overview-2.png new file mode 100644 index 0000000000..a93095b89b Binary files /dev/null and b/images/gateway/mqtt-connector/examples/result-device-overview-2.png differ diff --git a/images/gateway/mqtt-connector/examples/result-device-overview-3-preview.png b/images/gateway/mqtt-connector/examples/result-device-overview-3-preview.png new file mode 100644 index 0000000000..c8e1a6e6b6 Binary files /dev/null and b/images/gateway/mqtt-connector/examples/result-device-overview-3-preview.png differ diff --git a/images/gateway/mqtt-connector/examples/result-device-overview-3.png b/images/gateway/mqtt-connector/examples/result-device-overview-3.png new file mode 100644 index 0000000000..c8e1a6e6b6 Binary files /dev/null and b/images/gateway/mqtt-connector/examples/result-device-overview-3.png differ diff --git a/images/gateway/mqtt-connector/examples/result-device-overview-4-preview.png b/images/gateway/mqtt-connector/examples/result-device-overview-4-preview.png new file mode 100644 index 0000000000..c76bda65a1 Binary files /dev/null and b/images/gateway/mqtt-connector/examples/result-device-overview-4-preview.png differ diff --git a/images/gateway/mqtt-connector/examples/result-device-overview-4.png b/images/gateway/mqtt-connector/examples/result-device-overview-4.png new file mode 100644 index 0000000000..c76bda65a1 Binary files /dev/null and b/images/gateway/mqtt-connector/examples/result-device-overview-4.png differ diff --git a/images/gateway/mqtt-connector/examples/result-device-overview-attribute-requests-1.png b/images/gateway/mqtt-connector/examples/result-device-overview-attribute-requests-1.png new file mode 100644 index 0000000000..15ceb700f0 Binary files /dev/null and b/images/gateway/mqtt-connector/examples/result-device-overview-attribute-requests-1.png differ diff --git a/images/gateway/mqtt-connector/examples/result-device-overview-attribute-requests-2.png b/images/gateway/mqtt-connector/examples/result-device-overview-attribute-requests-2.png new file mode 100644 index 0000000000..97fe1782b0 Binary files /dev/null and b/images/gateway/mqtt-connector/examples/result-device-overview-attribute-requests-2.png differ diff --git a/images/gateway/mqtt-connector/examples/result-device-overview-attribute-requests-3.png b/images/gateway/mqtt-connector/examples/result-device-overview-attribute-requests-3.png new file mode 100644 index 0000000000..205cc49819 Binary files /dev/null and b/images/gateway/mqtt-connector/examples/result-device-overview-attribute-requests-3.png differ diff --git a/images/gateway/mqtt-connector/examples/result-device-overview-attribute-updates-1-preview.png b/images/gateway/mqtt-connector/examples/result-device-overview-attribute-updates-1-preview.png new file mode 100644 index 0000000000..93419b1f13 Binary files /dev/null and b/images/gateway/mqtt-connector/examples/result-device-overview-attribute-updates-1-preview.png differ diff --git a/images/gateway/mqtt-connector/examples/result-device-overview-attribute-updates-1.png b/images/gateway/mqtt-connector/examples/result-device-overview-attribute-updates-1.png new file mode 100644 index 0000000000..93419b1f13 Binary files /dev/null and b/images/gateway/mqtt-connector/examples/result-device-overview-attribute-updates-1.png differ diff --git a/images/gateway/mqtt-connector/examples/result-device-overview-attribute-updates-2-preview.png b/images/gateway/mqtt-connector/examples/result-device-overview-attribute-updates-2-preview.png new file mode 100644 index 0000000000..00564a7759 Binary files /dev/null and b/images/gateway/mqtt-connector/examples/result-device-overview-attribute-updates-2-preview.png differ diff --git a/images/gateway/mqtt-connector/examples/result-device-overview-attribute-updates-2.png b/images/gateway/mqtt-connector/examples/result-device-overview-attribute-updates-2.png new file mode 100644 index 0000000000..00564a7759 Binary files /dev/null and b/images/gateway/mqtt-connector/examples/result-device-overview-attribute-updates-2.png differ diff --git a/images/gateway/mqtt-connector/examples/result-device-overview-attribute-updates-3-preview.png b/images/gateway/mqtt-connector/examples/result-device-overview-attribute-updates-3-preview.png new file mode 100644 index 0000000000..81c730d157 Binary files /dev/null and b/images/gateway/mqtt-connector/examples/result-device-overview-attribute-updates-3-preview.png differ diff --git a/images/gateway/mqtt-connector/examples/result-device-overview-attribute-updates-3.png b/images/gateway/mqtt-connector/examples/result-device-overview-attribute-updates-3.png new file mode 100644 index 0000000000..81c730d157 Binary files /dev/null and b/images/gateway/mqtt-connector/examples/result-device-overview-attribute-updates-3.png differ diff --git a/images/gateway/mqtt-connector/examples/result-device-overview-attribute-updates-4.png b/images/gateway/mqtt-connector/examples/result-device-overview-attribute-updates-4.png new file mode 100644 index 0000000000..cd71b159c5 Binary files /dev/null and b/images/gateway/mqtt-connector/examples/result-device-overview-attribute-updates-4.png differ diff --git a/images/gateway/mqtt-connector/examples/result-device-overview-attribute-updates-5.png b/images/gateway/mqtt-connector/examples/result-device-overview-attribute-updates-5.png new file mode 100644 index 0000000000..5064f55d01 Binary files /dev/null and b/images/gateway/mqtt-connector/examples/result-device-overview-attribute-updates-5.png differ diff --git a/images/gateway/mqtt-connector/examples/result-device-overview-connect-2.png b/images/gateway/mqtt-connector/examples/result-device-overview-connect-2.png new file mode 100644 index 0000000000..4178cfbd00 Binary files /dev/null and b/images/gateway/mqtt-connector/examples/result-device-overview-connect-2.png differ diff --git a/images/gateway/mqtt-connector/examples/result-device-overview-connect-3.png b/images/gateway/mqtt-connector/examples/result-device-overview-connect-3.png new file mode 100644 index 0000000000..ae524ca3c4 Binary files /dev/null and b/images/gateway/mqtt-connector/examples/result-device-overview-connect-3.png differ diff --git a/images/gateway/mqtt-connector/examples/result-device-overview-reserved-rpc-1.png b/images/gateway/mqtt-connector/examples/result-device-overview-reserved-rpc-1.png new file mode 100644 index 0000000000..8a1bf0c123 Binary files /dev/null and b/images/gateway/mqtt-connector/examples/result-device-overview-reserved-rpc-1.png differ diff --git a/images/gateway/mqtt-connector/examples/result-device-overview-reserved-rpc-2.png b/images/gateway/mqtt-connector/examples/result-device-overview-reserved-rpc-2.png new file mode 100644 index 0000000000..fb1e8816da Binary files /dev/null and b/images/gateway/mqtt-connector/examples/result-device-overview-reserved-rpc-2.png differ diff --git a/images/gateway/mqtt-connector/examples/result-device-overview-reserved-rpc-3.png b/images/gateway/mqtt-connector/examples/result-device-overview-reserved-rpc-3.png new file mode 100644 index 0000000000..e57feafb4a Binary files /dev/null and b/images/gateway/mqtt-connector/examples/result-device-overview-reserved-rpc-3.png differ diff --git a/images/gateway/mqtt-connector/examples/result-device-overview-reserved-rpc-4.png b/images/gateway/mqtt-connector/examples/result-device-overview-reserved-rpc-4.png new file mode 100644 index 0000000000..7b7fd1c49f Binary files /dev/null and b/images/gateway/mqtt-connector/examples/result-device-overview-reserved-rpc-4.png differ diff --git a/images/gateway/mqtt-connector/examples/result-device-overview-rpc-1.png b/images/gateway/mqtt-connector/examples/result-device-overview-rpc-1.png new file mode 100644 index 0000000000..9c85298cc3 Binary files /dev/null and b/images/gateway/mqtt-connector/examples/result-device-overview-rpc-1.png differ diff --git a/images/gateway/mqtt-connector/examples/result-device-overview-rpc-2.png b/images/gateway/mqtt-connector/examples/result-device-overview-rpc-2.png new file mode 100644 index 0000000000..e5efd1a3e9 Binary files /dev/null and b/images/gateway/mqtt-connector/examples/result-device-overview-rpc-2.png differ diff --git a/images/gateway/mqtt-connector/examples/server-side-rpc-commands-1-preview.png b/images/gateway/mqtt-connector/examples/server-side-rpc-commands-1-preview.png new file mode 100644 index 0000000000..40f7900b2d Binary files /dev/null and b/images/gateway/mqtt-connector/examples/server-side-rpc-commands-1-preview.png differ diff --git a/images/gateway/mqtt-connector/examples/server-side-rpc-commands-1.png b/images/gateway/mqtt-connector/examples/server-side-rpc-commands-1.png new file mode 100644 index 0000000000..40f7900b2d Binary files /dev/null and b/images/gateway/mqtt-connector/examples/server-side-rpc-commands-1.png differ diff --git a/images/gateway/mqtt-connector/examples/server-side-rpc-commands-2-preview.png b/images/gateway/mqtt-connector/examples/server-side-rpc-commands-2-preview.png new file mode 100644 index 0000000000..677c731108 Binary files /dev/null and b/images/gateway/mqtt-connector/examples/server-side-rpc-commands-2-preview.png differ diff --git a/images/gateway/mqtt-connector/examples/server-side-rpc-commands-2.png b/images/gateway/mqtt-connector/examples/server-side-rpc-commands-2.png new file mode 100644 index 0000000000..677c731108 Binary files /dev/null and b/images/gateway/mqtt-connector/examples/server-side-rpc-commands-2.png differ diff --git a/images/gateway/mqtt-connector/examples/server-side-rpc-commands-3-preview.png b/images/gateway/mqtt-connector/examples/server-side-rpc-commands-3-preview.png new file mode 100644 index 0000000000..40d63ed551 Binary files /dev/null and b/images/gateway/mqtt-connector/examples/server-side-rpc-commands-3-preview.png differ diff --git a/images/gateway/mqtt-connector/examples/server-side-rpc-commands-3.png b/images/gateway/mqtt-connector/examples/server-side-rpc-commands-3.png new file mode 100644 index 0000000000..40d63ed551 Binary files /dev/null and b/images/gateway/mqtt-connector/examples/server-side-rpc-commands-3.png differ diff --git a/images/gateway/mqtt-connector/examples/server-side-rpc-commands-4-preview.png b/images/gateway/mqtt-connector/examples/server-side-rpc-commands-4-preview.png new file mode 100644 index 0000000000..7542362231 Binary files /dev/null and b/images/gateway/mqtt-connector/examples/server-side-rpc-commands-4-preview.png differ diff --git a/images/gateway/mqtt-connector/examples/server-side-rpc-commands-4.png b/images/gateway/mqtt-connector/examples/server-side-rpc-commands-4.png new file mode 100644 index 0000000000..7542362231 Binary files /dev/null and b/images/gateway/mqtt-connector/examples/server-side-rpc-commands-4.png differ diff --git a/images/gateway/mqtt-connector/examples/server-side-rpc-commands-5-preview.png b/images/gateway/mqtt-connector/examples/server-side-rpc-commands-5-preview.png new file mode 100644 index 0000000000..e077c51c0c Binary files /dev/null and b/images/gateway/mqtt-connector/examples/server-side-rpc-commands-5-preview.png differ diff --git a/images/gateway/mqtt-connector/examples/server-side-rpc-commands-5.png b/images/gateway/mqtt-connector/examples/server-side-rpc-commands-5.png new file mode 100644 index 0000000000..e077c51c0c Binary files /dev/null and b/images/gateway/mqtt-connector/examples/server-side-rpc-commands-5.png differ diff --git a/images/gateway/mqtt-connector/general-basic-section-1-ce.png b/images/gateway/mqtt-connector/general-basic-section-1-ce.png old mode 100755 new mode 100644 index a6f9781b68..3adb9500d7 Binary files a/images/gateway/mqtt-connector/general-basic-section-1-ce.png and b/images/gateway/mqtt-connector/general-basic-section-1-ce.png differ diff --git a/images/gateway/mqtt-connector/generate-clientID-from-UI.png b/images/gateway/mqtt-connector/generate-clientID-from-UI.png new file mode 100644 index 0000000000..44cf3cda82 Binary files /dev/null and b/images/gateway/mqtt-connector/generate-clientID-from-UI.png differ diff --git a/images/gateway/mqtt-connector/generated-clientID-from-UI-preview.png b/images/gateway/mqtt-connector/generated-clientID-from-UI-preview.png new file mode 100644 index 0000000000..951ddcbdc7 Binary files /dev/null and b/images/gateway/mqtt-connector/generated-clientID-from-UI-preview.png differ diff --git a/images/gateway/mqtt-connector/generated-clientID-from-UI.png b/images/gateway/mqtt-connector/generated-clientID-from-UI.png new file mode 100644 index 0000000000..951ddcbdc7 Binary files /dev/null and b/images/gateway/mqtt-connector/generated-clientID-from-UI.png differ diff --git a/images/gateway/mqtt-connector/mqtt-attribute-requests-1-preview.png b/images/gateway/mqtt-connector/mqtt-attribute-requests-1-preview.png new file mode 100644 index 0000000000..add770574c Binary files /dev/null and b/images/gateway/mqtt-connector/mqtt-attribute-requests-1-preview.png differ diff --git a/images/gateway/mqtt-connector/mqtt-attribute-requests-1.png b/images/gateway/mqtt-connector/mqtt-attribute-requests-1.png new file mode 100644 index 0000000000..add770574c Binary files /dev/null and b/images/gateway/mqtt-connector/mqtt-attribute-requests-1.png differ diff --git a/images/gateway/mqtt-connector/mqtt-attribute-requests-2-preview.png b/images/gateway/mqtt-connector/mqtt-attribute-requests-2-preview.png new file mode 100644 index 0000000000..ab8266808a Binary files /dev/null and b/images/gateway/mqtt-connector/mqtt-attribute-requests-2-preview.png differ diff --git a/images/gateway/mqtt-connector/mqtt-attribute-requests-2.png b/images/gateway/mqtt-connector/mqtt-attribute-requests-2.png new file mode 100644 index 0000000000..ab8266808a Binary files /dev/null and b/images/gateway/mqtt-connector/mqtt-attribute-requests-2.png differ diff --git a/images/gateway/mqtt-connector/mqtt-attribute-updates-1-preview.png b/images/gateway/mqtt-connector/mqtt-attribute-updates-1-preview.png new file mode 100644 index 0000000000..e8781f6419 Binary files /dev/null and b/images/gateway/mqtt-connector/mqtt-attribute-updates-1-preview.png differ diff --git a/images/gateway/mqtt-connector/mqtt-attribute-updates-1.png b/images/gateway/mqtt-connector/mqtt-attribute-updates-1.png new file mode 100644 index 0000000000..e8781f6419 Binary files /dev/null and b/images/gateway/mqtt-connector/mqtt-attribute-updates-1.png differ diff --git a/images/gateway/mqtt-connector/mqtt-attribute-updates-2-preview.png b/images/gateway/mqtt-connector/mqtt-attribute-updates-2-preview.png new file mode 100644 index 0000000000..f8301351db Binary files /dev/null and b/images/gateway/mqtt-connector/mqtt-attribute-updates-2-preview.png differ diff --git a/images/gateway/mqtt-connector/mqtt-attribute-updates-2.png b/images/gateway/mqtt-connector/mqtt-attribute-updates-2.png new file mode 100644 index 0000000000..f8301351db Binary files /dev/null and b/images/gateway/mqtt-connector/mqtt-attribute-updates-2.png differ diff --git a/images/gateway/mqtt-connector/mqtt-attributes-timeseries-overview.png b/images/gateway/mqtt-connector/mqtt-attributes-timeseries-overview.png new file mode 100644 index 0000000000..deef32f435 Binary files /dev/null and b/images/gateway/mqtt-connector/mqtt-attributes-timeseries-overview.png differ diff --git a/images/gateway/mqtt-connector/mqtt-attributes-timeseries.png b/images/gateway/mqtt-connector/mqtt-attributes-timeseries.png new file mode 100644 index 0000000000..deef32f435 Binary files /dev/null and b/images/gateway/mqtt-connector/mqtt-attributes-timeseries.png differ diff --git a/images/gateway/mqtt-connector/mqtt-connect-request-overview.png b/images/gateway/mqtt-connector/mqtt-connect-request-overview.png new file mode 100644 index 0000000000..b14dfa59a3 Binary files /dev/null and b/images/gateway/mqtt-connector/mqtt-connect-request-overview.png differ diff --git a/images/gateway/mqtt-connector/mqtt-data-conversion-overview.png b/images/gateway/mqtt-connector/mqtt-data-conversion-overview.png new file mode 100644 index 0000000000..0974ba1c5f Binary files /dev/null and b/images/gateway/mqtt-connector/mqtt-data-conversion-overview.png differ diff --git a/images/gateway/mqtt-connector/mqtt-gateway-configuring-10-ce-preview.png b/images/gateway/mqtt-connector/mqtt-gateway-configuring-10-ce-preview.png new file mode 100644 index 0000000000..9534ed2223 Binary files /dev/null and b/images/gateway/mqtt-connector/mqtt-gateway-configuring-10-ce-preview.png differ diff --git a/images/gateway/mqtt-connector/mqtt-gateway-configuring-10-ce.png b/images/gateway/mqtt-connector/mqtt-gateway-configuring-10-ce.png new file mode 100644 index 0000000000..9534ed2223 Binary files /dev/null and b/images/gateway/mqtt-connector/mqtt-gateway-configuring-10-ce.png differ diff --git a/images/gateway/mqtt-connector/mqtt-gateway-configuring-11-ce-preview.png b/images/gateway/mqtt-connector/mqtt-gateway-configuring-11-ce-preview.png new file mode 100644 index 0000000000..858c2b7054 Binary files /dev/null and b/images/gateway/mqtt-connector/mqtt-gateway-configuring-11-ce-preview.png differ diff --git a/images/gateway/mqtt-connector/mqtt-gateway-configuring-11-ce.png b/images/gateway/mqtt-connector/mqtt-gateway-configuring-11-ce.png new file mode 100644 index 0000000000..858c2b7054 Binary files /dev/null and b/images/gateway/mqtt-connector/mqtt-gateway-configuring-11-ce.png differ diff --git a/images/gateway/mqtt-connector/mqtt-gateway-configuring-12-ce-preview.png b/images/gateway/mqtt-connector/mqtt-gateway-configuring-12-ce-preview.png new file mode 100644 index 0000000000..93d8d7fb1f Binary files /dev/null and b/images/gateway/mqtt-connector/mqtt-gateway-configuring-12-ce-preview.png differ diff --git a/images/gateway/mqtt-connector/mqtt-gateway-configuring-12-ce.png b/images/gateway/mqtt-connector/mqtt-gateway-configuring-12-ce.png new file mode 100644 index 0000000000..93d8d7fb1f Binary files /dev/null and b/images/gateway/mqtt-connector/mqtt-gateway-configuring-12-ce.png differ diff --git a/images/gateway/mqtt-connector/mqtt-gateway-configuring-3-ce-preview.png b/images/gateway/mqtt-connector/mqtt-gateway-configuring-3-ce-preview.png new file mode 100644 index 0000000000..c91262faa5 Binary files /dev/null and b/images/gateway/mqtt-connector/mqtt-gateway-configuring-3-ce-preview.png differ diff --git a/images/gateway/mqtt-connector/mqtt-gateway-configuring-3-ce.png b/images/gateway/mqtt-connector/mqtt-gateway-configuring-3-ce.png new file mode 100644 index 0000000000..c91262faa5 Binary files /dev/null and b/images/gateway/mqtt-connector/mqtt-gateway-configuring-3-ce.png differ diff --git a/images/gateway/mqtt-connector/mqtt-gateway-configuring-4-ce-preview.png b/images/gateway/mqtt-connector/mqtt-gateway-configuring-4-ce-preview.png new file mode 100644 index 0000000000..64db16e093 Binary files /dev/null and b/images/gateway/mqtt-connector/mqtt-gateway-configuring-4-ce-preview.png differ diff --git a/images/gateway/mqtt-connector/mqtt-gateway-configuring-4-ce.png b/images/gateway/mqtt-connector/mqtt-gateway-configuring-4-ce.png new file mode 100644 index 0000000000..64db16e093 Binary files /dev/null and b/images/gateway/mqtt-connector/mqtt-gateway-configuring-4-ce.png differ diff --git a/images/gateway/mqtt-connector/mqtt-gateway-configuring-5-ce-preview.png b/images/gateway/mqtt-connector/mqtt-gateway-configuring-5-ce-preview.png new file mode 100644 index 0000000000..88e9cf25a0 Binary files /dev/null and b/images/gateway/mqtt-connector/mqtt-gateway-configuring-5-ce-preview.png differ diff --git a/images/gateway/mqtt-connector/mqtt-gateway-configuring-5-ce.png b/images/gateway/mqtt-connector/mqtt-gateway-configuring-5-ce.png new file mode 100644 index 0000000000..88e9cf25a0 Binary files /dev/null and b/images/gateway/mqtt-connector/mqtt-gateway-configuring-5-ce.png differ diff --git a/images/gateway/mqtt-connector/mqtt-gateway-configuring-6-ce-preview.png b/images/gateway/mqtt-connector/mqtt-gateway-configuring-6-ce-preview.png new file mode 100644 index 0000000000..e9149a1d55 Binary files /dev/null and b/images/gateway/mqtt-connector/mqtt-gateway-configuring-6-ce-preview.png differ diff --git a/images/gateway/mqtt-connector/mqtt-gateway-configuring-6-ce.png b/images/gateway/mqtt-connector/mqtt-gateway-configuring-6-ce.png new file mode 100644 index 0000000000..e9149a1d55 Binary files /dev/null and b/images/gateway/mqtt-connector/mqtt-gateway-configuring-6-ce.png differ diff --git a/images/gateway/mqtt-connector/mqtt-gateway-configuring-7-ce-preview.png b/images/gateway/mqtt-connector/mqtt-gateway-configuring-7-ce-preview.png new file mode 100644 index 0000000000..e903271d9d Binary files /dev/null and b/images/gateway/mqtt-connector/mqtt-gateway-configuring-7-ce-preview.png differ diff --git a/images/gateway/mqtt-connector/mqtt-gateway-configuring-7-ce.png b/images/gateway/mqtt-connector/mqtt-gateway-configuring-7-ce.png new file mode 100644 index 0000000000..e903271d9d Binary files /dev/null and b/images/gateway/mqtt-connector/mqtt-gateway-configuring-7-ce.png differ diff --git a/images/gateway/mqtt-connector/mqtt-gateway-configuring-8-ce-preview.png b/images/gateway/mqtt-connector/mqtt-gateway-configuring-8-ce-preview.png new file mode 100644 index 0000000000..3c3000e3ac Binary files /dev/null and b/images/gateway/mqtt-connector/mqtt-gateway-configuring-8-ce-preview.png differ diff --git a/images/gateway/mqtt-connector/mqtt-gateway-configuring-8-ce.png b/images/gateway/mqtt-connector/mqtt-gateway-configuring-8-ce.png new file mode 100644 index 0000000000..3c3000e3ac Binary files /dev/null and b/images/gateway/mqtt-connector/mqtt-gateway-configuring-8-ce.png differ diff --git a/images/gateway/mqtt-connector/mqtt-gateway-disconnect-configuring-12-ce-preview.png b/images/gateway/mqtt-connector/mqtt-gateway-disconnect-configuring-12-ce-preview.png new file mode 100644 index 0000000000..06d3a7ddbb Binary files /dev/null and b/images/gateway/mqtt-connector/mqtt-gateway-disconnect-configuring-12-ce-preview.png differ diff --git a/images/gateway/mqtt-connector/mqtt-gateway-disconnect-configuring-12-ce.png b/images/gateway/mqtt-connector/mqtt-gateway-disconnect-configuring-12-ce.png new file mode 100644 index 0000000000..06d3a7ddbb Binary files /dev/null and b/images/gateway/mqtt-connector/mqtt-gateway-disconnect-configuring-12-ce.png differ diff --git a/images/gateway/mqtt-connector/mqtt-mapping-overview.png b/images/gateway/mqtt-connector/mqtt-mapping-overview.png new file mode 100644 index 0000000000..f7d6ff06af Binary files /dev/null and b/images/gateway/mqtt-connector/mqtt-mapping-overview.png differ diff --git a/images/gateway/mqtt-connector/mqtt-message-attribute-requests-1.png b/images/gateway/mqtt-connector/mqtt-message-attribute-requests-1.png new file mode 100644 index 0000000000..0df39a5f36 Binary files /dev/null and b/images/gateway/mqtt-connector/mqtt-message-attribute-requests-1.png differ diff --git a/images/gateway/mqtt-connector/mqtt-message-attribute-requests-2.png b/images/gateway/mqtt-connector/mqtt-message-attribute-requests-2.png new file mode 100644 index 0000000000..79a3bbab1d Binary files /dev/null and b/images/gateway/mqtt-connector/mqtt-message-attribute-requests-2.png differ diff --git a/images/gateway/mqtt-connector/mqtt-message-attributes-update.png b/images/gateway/mqtt-connector/mqtt-message-attributes-update.png new file mode 100644 index 0000000000..1f0310f80c Binary files /dev/null and b/images/gateway/mqtt-connector/mqtt-message-attributes-update.png differ diff --git a/images/gateway/mqtt-connector/mqtt-message-disconnect.png b/images/gateway/mqtt-connector/mqtt-message-disconnect.png new file mode 100644 index 0000000000..29684f5fe7 Binary files /dev/null and b/images/gateway/mqtt-connector/mqtt-message-disconnect.png differ diff --git a/images/gateway/mqtt-connector/mqtt-modes-toggle.png b/images/gateway/mqtt-connector/mqtt-modes-toggle.png new file mode 100644 index 0000000000..24f60df856 Binary files /dev/null and b/images/gateway/mqtt-connector/mqtt-modes-toggle.png differ diff --git a/images/gateway/mqtt-connector/mqtt-rpc-overview-1-preview.png b/images/gateway/mqtt-connector/mqtt-rpc-overview-1-preview.png new file mode 100644 index 0000000000..b025a23de8 Binary files /dev/null and b/images/gateway/mqtt-connector/mqtt-rpc-overview-1-preview.png differ diff --git a/images/gateway/mqtt-connector/mqtt-rpc-overview-1.png b/images/gateway/mqtt-connector/mqtt-rpc-overview-1.png new file mode 100644 index 0000000000..b025a23de8 Binary files /dev/null and b/images/gateway/mqtt-connector/mqtt-rpc-overview-1.png differ diff --git a/images/gateway/mqtt-connector/mqtt-rpc-overview-2-preview.png b/images/gateway/mqtt-connector/mqtt-rpc-overview-2-preview.png new file mode 100644 index 0000000000..16cd36811d Binary files /dev/null and b/images/gateway/mqtt-connector/mqtt-rpc-overview-2-preview.png differ diff --git a/images/gateway/mqtt-connector/mqtt-rpc-overview-2.png b/images/gateway/mqtt-connector/mqtt-rpc-overview-2.png new file mode 100644 index 0000000000..16cd36811d Binary files /dev/null and b/images/gateway/mqtt-connector/mqtt-rpc-overview-2.png differ diff --git a/images/gateway/mqtt-connector/mqtt-rpc-overview-3-preview.png b/images/gateway/mqtt-connector/mqtt-rpc-overview-3-preview.png new file mode 100644 index 0000000000..4baf107cae Binary files /dev/null and b/images/gateway/mqtt-connector/mqtt-rpc-overview-3-preview.png differ diff --git a/images/gateway/mqtt-connector/mqtt-rpc-overview-3.png b/images/gateway/mqtt-connector/mqtt-rpc-overview-3.png new file mode 100644 index 0000000000..4baf107cae Binary files /dev/null and b/images/gateway/mqtt-connector/mqtt-rpc-overview-3.png differ diff --git a/images/gateway/mqtt-connector/requests-mapping-1-ce.png b/images/gateway/mqtt-connector/requests-mapping-1-ce.png deleted file mode 100644 index 151a3112a3..0000000000 Binary files a/images/gateway/mqtt-connector/requests-mapping-1-ce.png and /dev/null differ diff --git a/images/gateway/mqtt-connector/requests-mapping-2-ce.png b/images/gateway/mqtt-connector/requests-mapping-2-ce.png deleted file mode 100644 index f3d3d02c8a..0000000000 Binary files a/images/gateway/mqtt-connector/requests-mapping-2-ce.png and /dev/null differ diff --git a/images/gateway/mqtt-connector/requests-mapping-advanced-1-ce.png b/images/gateway/mqtt-connector/requests-mapping-advanced-1-ce.png deleted file mode 100755 index 55e22063ab..0000000000 Binary files a/images/gateway/mqtt-connector/requests-mapping-advanced-1-ce.png and /dev/null differ diff --git a/images/gateway/mqtt-connector/requests-mapping-basic-section-1-ce.png b/images/gateway/mqtt-connector/requests-mapping-basic-section-1-ce.png deleted file mode 100755 index c20602824f..0000000000 Binary files a/images/gateway/mqtt-connector/requests-mapping-basic-section-1-ce.png and /dev/null differ diff --git a/images/gateway/mqtt-connector/security-advanced-anonymous-subsection-1-ce.png b/images/gateway/mqtt-connector/security-advanced-anonymous-subsection-1-ce.png deleted file mode 100755 index e57e676f4d..0000000000 Binary files a/images/gateway/mqtt-connector/security-advanced-anonymous-subsection-1-ce.png and /dev/null differ diff --git a/images/gateway/mqtt-connector/security-advanced-basic-subsection-1-ce.png b/images/gateway/mqtt-connector/security-advanced-basic-subsection-1-ce.png deleted file mode 100755 index e0f7628c40..0000000000 Binary files a/images/gateway/mqtt-connector/security-advanced-basic-subsection-1-ce.png and /dev/null differ diff --git a/images/gateway/mqtt-connector/security-advanced-certificates-subsection-1-ce.png b/images/gateway/mqtt-connector/security-advanced-certificates-subsection-1-ce.png deleted file mode 100755 index 3af38572f7..0000000000 Binary files a/images/gateway/mqtt-connector/security-advanced-certificates-subsection-1-ce.png and /dev/null differ diff --git a/images/gateway/mqtt-connector/security-basic-anonymous-subsection-1-ce-preview.png b/images/gateway/mqtt-connector/security-basic-anonymous-subsection-1-ce-preview.png new file mode 100644 index 0000000000..36d715b1c5 Binary files /dev/null and b/images/gateway/mqtt-connector/security-basic-anonymous-subsection-1-ce-preview.png differ diff --git a/images/gateway/mqtt-connector/security-basic-anonymous-subsection-1-ce.png b/images/gateway/mqtt-connector/security-basic-anonymous-subsection-1-ce.png old mode 100755 new mode 100644 index 5cda9d9279..36d715b1c5 Binary files a/images/gateway/mqtt-connector/security-basic-anonymous-subsection-1-ce.png and b/images/gateway/mqtt-connector/security-basic-anonymous-subsection-1-ce.png differ diff --git a/images/gateway/mqtt-connector/security-basic-basic-subsection-1-ce-preview.png b/images/gateway/mqtt-connector/security-basic-basic-subsection-1-ce-preview.png new file mode 100644 index 0000000000..838a03fafe Binary files /dev/null and b/images/gateway/mqtt-connector/security-basic-basic-subsection-1-ce-preview.png differ diff --git a/images/gateway/mqtt-connector/security-basic-basic-subsection-1-ce.png b/images/gateway/mqtt-connector/security-basic-basic-subsection-1-ce.png old mode 100755 new mode 100644 index c1cc59fbf1..838a03fafe Binary files a/images/gateway/mqtt-connector/security-basic-basic-subsection-1-ce.png and b/images/gateway/mqtt-connector/security-basic-basic-subsection-1-ce.png differ diff --git a/images/gateway/mqtt-connector/security-basic-certificates-subsection-1-ce-preview.png b/images/gateway/mqtt-connector/security-basic-certificates-subsection-1-ce-preview.png new file mode 100644 index 0000000000..7a5f8ce9d5 Binary files /dev/null and b/images/gateway/mqtt-connector/security-basic-certificates-subsection-1-ce-preview.png differ diff --git a/images/gateway/mqtt-connector/security-basic-certificates-subsection-1-ce.png b/images/gateway/mqtt-connector/security-basic-certificates-subsection-1-ce.png old mode 100755 new mode 100644 index 75c534694a..7a5f8ce9d5 Binary files a/images/gateway/mqtt-connector/security-basic-certificates-subsection-1-ce.png and b/images/gateway/mqtt-connector/security-basic-certificates-subsection-1-ce.png differ diff --git a/images/gateway/mqtt-connector/server-side-rpc-commands-advanced-1-ce.png b/images/gateway/mqtt-connector/server-side-rpc-commands-advanced-1-ce.png deleted file mode 100755 index 285aa9bf96..0000000000 Binary files a/images/gateway/mqtt-connector/server-side-rpc-commands-advanced-1-ce.png and /dev/null differ diff --git a/images/gateway/mqtt-connector/server-side-rpc-commands-basic-1-ce.png b/images/gateway/mqtt-connector/server-side-rpc-commands-basic-1-ce.png deleted file mode 100755 index 41fdbf5db6..0000000000 Binary files a/images/gateway/mqtt-connector/server-side-rpc-commands-basic-1-ce.png and /dev/null differ diff --git a/images/gateway/mqtt-connector/server-side-rpc-commands-basic-2-ce.png b/images/gateway/mqtt-connector/server-side-rpc-commands-basic-2-ce.png deleted file mode 100755 index 3d5651af58..0000000000 Binary files a/images/gateway/mqtt-connector/server-side-rpc-commands-basic-2-ce.png and /dev/null differ diff --git a/images/gateway/mqtt-connector/workers-settings-1-ce.png b/images/gateway/mqtt-connector/workers-settings-1-ce.png old mode 100755 new mode 100644 index 118b10973e..2634d0aa14 Binary files a/images/gateway/mqtt-connector/workers-settings-1-ce.png and b/images/gateway/mqtt-connector/workers-settings-1-ce.png differ diff --git a/images/gateway/mqtt-connector/workers-settings-advanced-1-ce.png b/images/gateway/mqtt-connector/workers-settings-advanced-1-ce.png deleted file mode 100755 index cfaffc8836..0000000000 Binary files a/images/gateway/mqtt-connector/workers-settings-advanced-1-ce.png and /dev/null differ diff --git a/images/gateway/mqtt-created-device-1.png b/images/gateway/mqtt-created-device-1.png deleted file mode 100644 index 1e652a0adf..0000000000 Binary files a/images/gateway/mqtt-created-device-1.png and /dev/null differ diff --git a/images/gateway/mqtt-created-device-2.png b/images/gateway/mqtt-created-device-2.png deleted file mode 100644 index ead1b4cc0e..0000000000 Binary files a/images/gateway/mqtt-created-device-2.png and /dev/null differ diff --git a/images/gateway/mqtt-disconnect-device.png b/images/gateway/mqtt-disconnect-device.png deleted file mode 100755 index 1209dc126f..0000000000 Binary files a/images/gateway/mqtt-disconnect-device.png and /dev/null differ diff --git a/images/gateway/mqtt-message-1.png b/images/gateway/mqtt-message-1.png deleted file mode 100644 index 36d44e8f23..0000000000 Binary files a/images/gateway/mqtt-message-1.png and /dev/null differ diff --git a/images/gateway/mqtt-message-connect.png b/images/gateway/mqtt-message-connect.png deleted file mode 100644 index c6ab5b0cfd..0000000000 Binary files a/images/gateway/mqtt-message-connect.png and /dev/null differ diff --git a/images/gateway/mqtt-message-disconnect.png b/images/gateway/mqtt-message-disconnect.png deleted file mode 100644 index b6333bf13b..0000000000 Binary files a/images/gateway/mqtt-message-disconnect.png and /dev/null differ diff --git a/images/gateway/mqtt-message-with-timestampField.png b/images/gateway/mqtt-message-with-timestampField.png deleted file mode 100644 index 1a80f41c51..0000000000 Binary files a/images/gateway/mqtt-message-with-timestampField.png and /dev/null differ diff --git a/images/gateway/mqtt-mosquitto-sub-get-1.png b/images/gateway/mqtt-mosquitto-sub-get-1.png deleted file mode 100644 index cbe0bb1870..0000000000 Binary files a/images/gateway/mqtt-mosquitto-sub-get-1.png and /dev/null differ diff --git a/images/gateway/mqtt-mosquitto-sub-wait-1.png b/images/gateway/mqtt-mosquitto-sub-wait-1.png deleted file mode 100644 index 8c1bc69550..0000000000 Binary files a/images/gateway/mqtt-mosquitto-sub-wait-1.png and /dev/null differ diff --git a/images/gateway/mqtt-update-attribute-1.png b/images/gateway/mqtt-update-attribute-1.png deleted file mode 100644 index f8fa260239..0000000000 Binary files a/images/gateway/mqtt-update-attribute-1.png and /dev/null differ diff --git a/images/gateway/mqtt-update-attribute-2.png b/images/gateway/mqtt-update-attribute-2.png deleted file mode 100644 index d9ca227358..0000000000 Binary files a/images/gateway/mqtt-update-attribute-2.png and /dev/null differ diff --git a/images/gateway/mqtt-update-attribute-3.png b/images/gateway/mqtt-update-attribute-3.png deleted file mode 100644 index 477636e0c9..0000000000 Binary files a/images/gateway/mqtt-update-attribute-3.png and /dev/null differ