From 36e4179f6c88d4b67247e022ffd476c47bacf516 Mon Sep 17 00:00:00 2001 From: MysticBoy Date: Wed, 15 Jun 2022 13:58:08 +0800 Subject: [PATCH] Update mqtt.md --- docs/docs/tutorial-extras/mqtt.md | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/docs/docs/tutorial-extras/mqtt.md b/docs/docs/tutorial-extras/mqtt.md index 4e546292..18012325 100644 --- a/docs/docs/tutorial-extras/mqtt.md +++ b/docs/docs/tutorial-extras/mqtt.md @@ -10,12 +10,25 @@ sidebar_position: 1 设备分直连设备和网关设备, 发送数据方式也有所不同。 telemetry 为 遥测, attributes表示属性,客户端上传的属性在服务器端永远为 ClientSide , 即客户端侧属性。 不推荐在服务端修改。 +### 连接直连设备或者网关 + +通过 mqtt客户端连接mqtt服务器,用户名填写 token, 密码可以为空。 + + ### 直连设备发送遥测数据 ``` devices/me/telemetry devices/me/attributes ``` + MQTT的负载为如下格式 + + ```json + { + "stringvalue":"here is strvalue", + "intvalue":234 + } + ``` ### 网关设备发送遥测数据 ``` @@ -162,4 +175,4 @@ curl -X 'POST' \ -H 'Content-Type: application/json' \ -d '"{参数, 可以是json}"' -``` \ No newline at end of file +``` -- GitLab