NodeRED supports many network protocols, such as UDP, TCP, HTTP, and MQTT. The MQTT protocol is very popular in IoT devices because it is lightweight and easy to use. For example, the MQTT protocol allows controlling actuators over the Internet or reading the values of remote sensors.
Unlike HTTP with its request/response method, MQTT implements a publish/subscribe architecture. In HTTP, a point-to-point connection with request and response is common. The transmission in MQTT works differently: devices that have something to report simply send their data to the broker (central server in the IoT system), that is, they publish their messages. The broker forwards these messages to other devices that have subscribed to these messages.
Devices that can be networked with MQTT include:
All devices connected to an MQTT broker are also referred to as MQTT clients. An MQTT network thus consists of several MQTT clients and one MQTT broker.
It is not always necessary for the data to be accessible on the Internet. For example, if you only need sensor signals within your own home, networking in the local network is sufficient.
A local MQTT broker runs in the dollhouse. This is only accessible within the same network (in this case, the IoTB WLAN).
Now it's your turn! Get the temperature control running!
The flow MQTT Beispiel (MQTT Example) is not yet completely wired. Try to implement a two-point control for the temperature by correctly connecting the nodes. The following is still missing:
The actual temperature is not yet evaluated by the controller
The controller is not yet sending control commands to the heating in the dollhouse.
Test the controller by changing the desired temperature on the dashboard. You need some patience, the control loop is rather sluggish.