MQTT Overview
An installation of MQTT broker is necessary to publish messages from the Atlas Copco Data Communication. In the following setup, the MQTT broker used is Eclipse Mosquitto but any broker that supports MQTT v5 can be used.
Setting Up the Mosquitto MQTT Broker
Follow these steps to install and configure the Mosquitto MQTT Broker with support for MQTT v5.
Install the Mosquitto MQTT Broker
Download the Mosquitto installer from the official website: https://mosquitto.org/download
Select version 1.6.0 or later to ensure compatibility with MQTT v5.
Run the installer and follow the on-screen instructions.
Configure the Authentication
Open Command Prompt as an administrator.
Navigate to the Mosquitto installation directory:
cd "C:\Program Files\mosquitto"Create a password file using the following command:
mosquitto_passwd.exe -c passwd.txt acdcuserWhen prompted, enter the desired password. This creates a passwd.txt file in the Mosquitto directory.
Update the Mosquitto Configuration
Open the mosquitto.conf file located in:
C:\Program Files\mosquittoAdd the following lines to the configuration file:
allow_anonymous falsepassword_fileC:\Program Files\mosquitto\passwd.txtSave and close the file.
Restart Mosquitto Broker Service
Open the Services application (services.msc) and restart the Mosquitto Broker service.
Verify the MQTT version
Open Command Prompt and run the following command:
mosquitto -hThe expected output is similar to:
mosquitto is an MQTT v5.0/v3.1.1/v3.1 broker.