--- 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:54Z published: 2025-01-23T10:07:54Z 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. # Como habilitar e configurar o agente MQTT do Edge Device ## Objetivo *Saiba como configurar um broker MQTT externo nos dispositivos Tulip Edge* A partir do OS 50.1, os dispositivos Tulip Edge têm um broker MQTT externo ao qual os dispositivos clientes podem se conectar. ## Instruções 1. Faça login no portal do Edge Device. 2. Na parte inferior da seção "Network configuration" (Configuração de rede), selecione a opção "MQTT Broker" (Corretor 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) 1. Clique em "Enable" (Ativar), digite o nome de usuário e a senha desejados e clique em "Save" (Salvar). ![](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/How%20to%20Enable%20and%20Set%20Up%20the%20Edge%20Device%20MQTT%20Broker_566762340.png) ## Uso do agente MQTT com o Node-RED Para confirmar que o agente está disponível, podemos usar um nó Node-RED MQTT IN. 1. Se o Node-RED estiver desativado, ative-o e faça login no editor do Node-RED. 2. Adicione um nó MQTT ao seu fluxo e edite o nó. ![](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. Clique no botão de lápis para abrir a configuração do broker e defina "Server" como `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. Clique na guia "Security" (Segurança) e digite o nome de usuário e a senha configurados para o agente. ![](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. Clique em "Update" (Atualizar) para salvar as configurações. 2. Clique em "Deploy" (Implementar) para verificar se o nó pode se conectar ao agente. ![](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/How%20to%20Enable%20and%20Set%20Up%20the%20Edge%20Device%20MQTT%20Broker_566762121.png) ### Exemplo de fluxo Node-RED O exemplo abaixo pode ser salvo como um arquivo JSON e importado para o Node-RED para enviar uma mensagem "world" para o tópico "hello". ![](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" (rótulo), "disabled":false, "info":"" }, { "id":"983032d6.f2f378", "type": "debug", "z":"c8829f45.d66fd", "name":"", "active":true, "tosidebar":true, "console":false, "tostatus":falso, "complete": "topic", "targetType": "msg", "statusVal":"", "statusType": "auto", "x":800, "y":180, "wires":[ ``` ] ``` }, { "id":"39d4c518.6948ba", "type": "inject", "z":"c8829f45.d66fd", "name":"", "props":[ { "p": "payload" }, { "p": "topic" (tópico), "vt": "str" } ], "repeat":"", "crontab":"", "once":false, "onceDelay":0.1, "topic": "hello", "payload": "world", "payloadType": "str", "x":480, "y":120, "wires":[ [ "33035adc.d4eae6" ] ] }, { "id":"f7839332.ea3a98", "type": "mqtt in", "z":"c8829f45.d66fd", "name": "MQTT Receive All", "tópico": "##", "qos": "2", "datatype": "auto", "broker":"6f327e4f.0a172", "nl":false, "rap":true, "rh":0, "x":450, "y":200, "wires":[ [ "983032d6.f2f378", "97df7c35.a8d228" ] ] }, { "id":"33035adc.d4eae6", "type": "mqtt out", "z":"c8829f45.d66fd", "name": "MQTT Send Hello", "topic":"", "qos":"", "retain":"", "respTopic":"", "contentType":"", "userProps":"", "correl":"", "expiry":"", "broker":"6f327e4f.0a172", "x":830, "y":120, "wires":[ ``` ] ``` }, { "id":"97df7c35.a8d228", "type": "debug", "z":"c8829f45.d66fd", "name":"", "active":true, "tosidebar":true, "console":false, "tostatus":false, "complete": "payload", "targetType": "msg", "statusVal":"", "statusType": "auto", "x":810, "y":240, "wires":[ ``` ] ``` }, { "id":"6f327e4f.0a172", "type": "mqtt-broker", "name":"", "broker": "localhost", "porta": "1883", "clientid":"", "usetls":false, "protocolVersion": "5", "keepalive": "60", "cleansession":true, "birthTopic":"", "birthQos": "0", "birthPayload":"", "birthMsg":{ ``` }, "closeTopic":"", "closeQos": "0", "closePayload":"", "closeMsg":{ }, "willTopic":"", "willQos": "0", "willPayload":"", "willMsg":{ }, "sessionExpiry":"" ``` } ]``` --- Encontrou o que estava procurando? Você também pode acessar [community.tulip.co](https://community.tulip.co/?utm_source=intercom&utm_medium=article-link&utm_campaign=all) para publicar sua pergunta ou ver se outras pessoas tiveram uma pergunta semelhante! ```