MQTT real-time support for MESHdesk and APdesk
Install Mosquitto
- Install the Mosquitto MQTT broker according to these detailed instructions:
- Make sure you perform step 3 to secure the application with username and password.
- In this document we use the username and password of openwrt, please change them according to your needs.
- Please use a secure password for the MQTT user in a production environment.
Install Rdcore-API-Gateway
- The Rdcore API Gateway is a Node.js application. We start with the installation of Node.js and npm.
sudo apt install nodejs sudo apt install npm
- Change to the /opt directory
cd /opt
- Clone Rdcore API Gateway from Github
sudo git clone https://github.com/RADIUSdesk/Rdcore-API-Gateway.git
- Change to the newly cloned directory
cd /opt/Rdcore-API-Gateway
- Install NPM dependencies
sudo npm install
- Rename .env.sample to .env and edit
sudo mv .env.sample .env sudo vi .env PORT=8001 #FQDN of your installed server MESH_CONTROLLER="http://cloud.mesh-manager.com" MQTT_BROKER="127.0.0.1" MQTT_PORT=1883 MQTT_USER=openwrt MQTT_PASS=openwrt
- The Rdcore API gateway systemd startup file
sudo cp /opt/Rdcore-API-Gateway/rdcore-api-gateway.service /lib/systemd/system/
- Activate the Rdcore API Gateway
sudo systemctl enable rdcore-api-gateway.service
- Start the Rdcore API gateway
sudo systemctl start rdcore-api-gateway.service sudo systemctl status rdcore-api-gateway.service
- Confirm that the service is running by calling the FQDN:8001
MQTT settings in RADIUSdesk
- To activate MQTT on RADIUSdesk, you must configure it in two places.
- For the devices managed by MESHdesk and APdesk there is this GUI under Settings → MQTT
- Command topic is always /RD/NODE/COMMAND/RESPONSE
- To enable the server to use MQTT instead of the heartbeat system, you must edit the following configuration file.
- Edit /var/www/html/cake4/rd_cake/config/MESHdesk.php
- Search for these sections and adapt them to the values of your server.
$config['mqtt_settings']['enable_realtime'] = true; $config['mqtt_settings']['api_gateway_url'] = 'http://164.160.89.129:8001';