--- title: "How to Enable and Set Up the Edge Device MQTT Broker" slug: "how-to-enable-and-set-up-the-edge-device-mqtt-broker" updated: 2025-01-23T10:07:49Z published: 2025-01-23T10:07:49Z canonical: "support.tulip.co/how-to-enable-and-set-up-the-edge-device-mqtt-broker" --- > ## Documentation Index > Fetch the complete documentation index at: https://support.tulip.co/llms.txt > Use this file to discover all available pages before exploring further. # 如何启用和设置边缘设备 MQTT 代理 ## 目的 *了解如何在 Tulip Edge 设备上设置外部 MQTT 代理* 从操作系统 50.1 开始,Tulip Edge 设备有一个外部 MQTT 代理,客户端设备可以连接到该代理。 ## 操作说明 1. 登录边缘设备门户。 2. 在 "网络配置 "部分底部,选择 "MQTT 代理 "选项。 ![](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/How%20to%20Enable%20and%20Set%20Up%20the%20Edge%20Device%20MQTT%20Broker_566761938.png){height="" width="""} 1. 单击 "启用",输入所需的用户名和密码,然后点击 "保存"。 ![](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/How%20to%20Enable%20and%20Set%20Up%20the%20Edge%20Device%20MQTT%20Broker_566762340.png) ## 使用 Node-RED 的 MQTT 代理 要确认代理是否可用,我们可以使用 Node-RED MQTT IN 节点。 1. 如果 Node-RED 处于关闭状态,请将其打开并登录 Node-RED 编辑器。 2. 在流程中添加一个 MQTT 节点并编辑该节点。 ![](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/How%20to%20Enable%20and%20Set%20Up%20the%20Edge%20Device%20MQTT%20Broker_566761693.png) 1. 单击铅笔按钮打开代理配置,并将 "服务器 "设置为`localhost`。 ![](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/How%20to%20Enable%20and%20Set%20Up%20the%20Edge%20Device%20MQTT%20Broker_566761625.png) 1. 单击 "安全 "选项卡并输入为代理配置的用户名和密码。 ![](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/How%20to%20Enable%20and%20Set%20Up%20the%20Edge%20Device%20MQTT%20Broker_566761499.png) 1. 单击 "更新 "保存设置。 2. 单击 "部署 "检查节点是否可以连接到代理。 ![](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/How%20to%20Enable%20and%20Set%20Up%20the%20Edge%20Device%20MQTT%20Broker_566762121.png) ### Node-RED 流程示例 可以将下面的示例保存为 JSON 文件并导入 Node-RED,向 "hello "主题发送 "world "消息。 ![](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/How%20to%20Enable%20and%20Set%20Up%20the%20Edge%20Device%20MQTT%20Broker_566761230.png) ``` { "id":"c8829f45.d66fd", "type": "tab"、 "label": "Flow 1"、 "disabled":false、 "信息":" }, { "id":"983032d6.f2f378", "类型": "调试"、 "z":"c8829f45.d66fd", "名称":""、 "active":true、 "tosidebar":true、 "console":false、 "tostatus":false、 "complete": "topic"、 "targetType": "msg"、 "statusVal":""、 "statusType": "auto"、 "x":800, "y":180, "电线":[ ``` ] ``` }, { "id":"39d4c518.6948ba", "类型": "注入"、 "z":"c8829f45.d66fd", "名称":""、 "道具": [ { "p": "payload" }, "props":[ { }, { "p": "topic"、 "vt": "str" } ], "重复":""、 "crontab":""、 "once":false、 "onceDelay":0.1、 "topic": "hello"、 "payload": "world"、 "payloadType": "str"、 "x":480, "y":120, "电线":[ [ "33035adc.d4eae6" [ ] ] }, { "id":"f7839332.ea3a98", "type": "mqtt in"、 "z":"c8829f45.d66fd", "name": "MQTT Receive All"、 "主题": "##"、 "qos": "2"、 "datatype": "auto"、 "broker":"6f327e4f.0a172", "nl":false、 "rap":true、 "rh":0、 "x":450, "y":200, "电线":[ [ "983032d6.f2f378"、 "97df7c35.a8d228 ] ] }, { "id":"33035adc.d4eae6", "type": "mqtt out"、 "z":"c8829f45.d66fd", "name": "MQTT Send Hello"、 "主题":""、 "qos":""、 "保留":""、 "respTopic":""、 "contentType":""、 "userProps":""、 "correl":""、 "到期":""、 "broker":"6f327e4f.0a172", "x":830, "y":120, "wires":[ ``` ] ``` }, { "id":"97df7c35.a8d228", "类型": "调试"、 "z":"c8829f45.d66fd", "名称":""、 "active":true、 "tosidebar":true、 "console":false、 "tostatus":false、 "complete": "payload"、 "targetType": "msg"、 "statusVal":""、 "statusType": "auto"、 "x":810, "y":240, "电线":[ ``` ] ``` }, { "id":"6f327e4f.0a172", "type": "mqtt-broker"、 "名称":""、 "broker": "localhost"、 "端口": "1883 "clientid":""、 "usetls":false、 "协议版本": "5"、 "keepalive": "60"、 "cleansession":true、 "出生主题":""、 "birthQos": "0"、 "birthPayload":""、 "出生信息":{ ``` }, "closeTopic":"", "closeQos": "0", "closePayload":"", "closeMsg":{ }, "willTopic":"", "willQos": "0", "willPayload":"", "willMsg":{ }, "sessionExpiry":"" ``` } ]``` --- 找到您想要的东西了吗? 您还可以前往[community.tulip.co](https://community.tulip.co/?utm_source=intercom&utm_medium=article-link&utm_campaign=all)发布您的问题,或查看其他人是否遇到过类似问题! ```