Issue
MQTT client from an AS-P cannot establish communication with the Mosquitto broker installed on the machine that hosts the Enterprise Server (ES).
At the same time, the MQTT client from the ES was online with the Mosquitto broker.
Product Line
EcoStruxure Building Operation
Environment
- Building Operation Enterprise Server
- Building Operation Automation Server
- IoT messaging MQTT (Messaging Queuing Telemetry Transport)
Cause
In version 1.6.x and earlier from the Mosquitto broker, the option - allow_anonymous [ true | false ] from the configuration setup (e.g. mosquitto.conf — the configuration file for mosquitto) of the broker was defaulted to true
unless there were other security options set.
In recent versions of the broker, the option allow_anonymous defaults to false
- Unless no listeners are defined in the configuration file, in which case it set to true
- but connections are only allowed from the local machine if external connections are required; specific port listeners need to be set.
Resolution
To configure the MQTT Mosquitto broker for insecure communication with an EBO server, follow these steps.
- Download the Mosquitto broker latest version from the Eclipse website and install it on the host machine.
- Locate the mosquitto.conf file in the Mosquitto installation folder (Default: C:\Program Files\mosquitto).
- Edit the mosquitto.conf file with a text editor application (e.g. Notepad, Notepad++). Setting up the allow_anonymous configuration as true and the listeners to the desired communication ports (e.g. 1883: This is the default MQTT port. 1883 is defined at IANA as MQTT over TCP. 8883: This is the default MQTT port for MQTT over TLS.)
Check the Video attached, which includes the basic configuration of the mosquitto.conf file.