This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
getting_started:20_install_ubuntu_mqtt [2022/06/10 06:04] – created admin | getting_started:20_install_ubuntu_mqtt [2022/06/10 10:25] (current) – [Install Mosquitto] admin | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== MQTT Real-time Support for MESHdesk and APdesk ====== | ====== MQTT Real-time Support for MESHdesk and APdesk ====== | ||
+ | |||
+ | ===== Install Mosquitto ===== | ||
+ | * Install the Mosquitto MQTT Broker as per these fine instructions: | ||
+ | * https:// | ||
+ | * Make sure you do **Step 3** to secure the it with usernames and passwords. | ||
+ | * In this document we use username and password of **openwrt**. Please change according to your preference. | ||
+ | |||
+ | <WRAP center round important 100%> | ||
+ | * Please use a strong password for the MQTT user in a production environment. | ||
+ | </ | ||
+ | |||
+ | |||
+ | ===== Install Rdcore-API-Gateway ===== | ||
+ | * Go to /opt directory | ||
+ | <code bash> | ||
+ | cd /opt | ||
+ | </ | ||
+ | * Clone Rdcore API Gateway from Github | ||
+ | <code bash> | ||
+ | sudo git clone https:// | ||
+ | </ | ||
+ | * Go to newly cloned directory | ||
+ | <code bash> | ||
+ | cd / | ||
+ | </ | ||
+ | * Install NPM Dependencies | ||
+ | <code bash> | ||
+ | sudo npm install | ||
+ | </ | ||
+ | * 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=" | ||
+ | MQTT_BROKER=" | ||
+ | MQTT_PORT=1883 | ||
+ | MQTT_USER=openwrt | ||
+ | MQTT_PASS=openwrt | ||
+ | |||
+ | </ | ||
+ | * The Rdcore API Gateway Systemd Startup File | ||
+ | <code bash> | ||
+ | sudo cp / | ||
+ | </ | ||
+ | * Enable the Rdcore API Gateway | ||
+ | <code bash> | ||
+ | sudo systemctl enable rdcore-api-gateway.service | ||
+ | </ | ||
+ | * Start the Rdcore API Gateway | ||
+ | <code bash> | ||
+ | sudo systemctl start rdcore-api-gateway.service | ||
+ | sudo systemctl status rdcore-api-gateway.service | ||
+ | </ | ||
+ | * Confirm the service is running by visiting the FQDN:8001 | ||
+ | * e.g http:// | ||
+ | |||
+ | ===== MQTT Settings in RADIUSdesk ===== | ||
+ | * To enable MQTT on RADIUSdesk there are two places where it has to be configured. | ||
+ | * For the devices managed by MESHdesk and APdesk there is this GUI under **Settings** -> **MQTT** | ||
+ | |||
+ | {{: | ||
+ | * Command topic is always **/ | ||
+ | * Then for the server to use MQTT instead of the heartbeat system you have to edit the following config file. | ||
+ | * Edit **/ | ||
+ | * Look for this sections and adapt to your server' | ||
+ | <code php> | ||
+ | $config[' | ||
+ | $config[' | ||
+ | </ | ||
+ | |||
+ | |||
+ | |||