The mqtt in component in Node-RED is used to subscribe to MQTT messages. In Chapter 6, Using MicroPython for Edge Analytics, we created an MQTT server using the CloudMQTT website. We will use the settings from this account in this step.
To add an mqtt in component, do the following:
- You will find the mqtt in component under the network section on the left. Click and drag the mqtt in component onto the canvas.
- Double-click on the newly created component to get to Edit mqtt in node.
- Click on the pencil icon beside the Server textbox.
- In the Server box, copy and paste the server address from your CloudMQTT account.
- Do the same for the Port.
- Click on the Security tab.
- Fill in the Username and Password from your CloudMQTT ...