MQTT real-time support for MESHdesk and APdesk

  • 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
  • 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 SettingsMQTT

  • 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';
  • install_22_4_mqtt.txt
  • Last modified: 2024/02/07 22:47
  • by system