Skip to content

Node-RED ​

Node-RED's built-in mqtt in and mqtt out nodes connect to ConnectMQ with a TLS broker configuration.

Configure the broker ​

  1. Drag an mqtt out node onto the flow and double-click it.
  2. Next to Server, click the pencil to add a new mqtt-broker config node.
  3. Connection tab:
    • Server: broker.connectmq.com
    • Port: 8883
    • Connect automatically: on
    • Use TLS: on. Add a TLS configuration with no certificate files and Verify server certificate on.
    • Protocol: MQTT V5 (or V3.1.1)
    • Client ID: <issued client ID>_nodered
    • Keep Alive: 60
  4. Security tab: your Username and Password from MQTT Connection Settings.
  5. Click Add, then Done, then Deploy. The node shows connected.

Publish and subscribe ​

  • mqtt out: set Topic (for example acme/istanbul/assembly/line1/nodered-01/telemetry) and send a JSON object in msg.payload, for example from an inject node with JSON {"temperature": 21.5}.
  • mqtt in: set Topic to a filter such as acme/istanbul/# and Output to a parsed JSON object.

An importable flow is in connectmq/mqtt-code-samples/node-red. In Node-RED choose Menu → Import, paste flow.json and fill in the credentials.

Polling Modbus or OPC UA with Node-RED?

ConnectMQ Edge reads PLCs, Modbus meters and OPC UA servers without a flow and buffers data on disk while the internet is down.

Fully managed MQTT broker for connected devices.