Show pageOld revisionsBacklinksBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ====== MQTT real-time support for MESHdesk and APdesk ====== ===== Install Mosquitto ===== * Install the Mosquitto MQTT broker according to these detailed instructions: * https://www.vultr.com/docs/install-mosquitto-mqtt-broker-on-ubuntu-20-04-server/ * 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. <alert type="info"> * Please use a secure password for the MQTT user in a production environment. </alert> ===== Install Rdcore-API-Gateway ===== * The Rdcore API Gateway is a Node.js application. We start with the installation of Node.js and npm. <code bash> sudo apt install nodejs sudo apt install npm </code> * Change to the /opt directory <code bash> cd /opt </code> * Clone Rdcore API Gateway from Github <code bash> sudo git clone https://github.com/RADIUSdesk/Rdcore-API-Gateway.git </code> * Change to the newly cloned directory <code bash> cd /opt/Rdcore-API-Gateway </code> * Install NPM dependencies <code bash> sudo npm install </code> * Rename **.env.sample** to **.env** and edit <code bash> 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 </code> * The Rdcore API gateway systemd startup file <code bash> sudo cp /opt/Rdcore-API-Gateway/rdcore-api-gateway.service /lib/systemd/system/ </code> * Activate the Rdcore API Gateway <code bash> sudo systemctl enable rdcore-api-gateway.service </code> * Start the Rdcore API gateway <code bash> sudo systemctl start rdcore-api-gateway.service sudo systemctl status rdcore-api-gateway.service </code> * Confirm that the service is running by calling the FQDN:8001 * e.g http://cloud.radiusdesk.com: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** {{:getting_started:mqtt_settings.png|}} * 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. <code php> $config['mqtt_settings']['enable_realtime'] = true; $config['mqtt_settings']['api_gateway_url'] = 'http://164.160.89.129:8001'; </code> install_22_4_mqtt.txt Last modified: 2024/02/07 22:47by system