From b01f8992f5feb2a7054a3423ab95b7909d7608ed Mon Sep 17 00:00:00 2001 From: deaflynx Date: Wed, 23 Oct 2024 16:54:12 +0300 Subject: [PATCH] updated getting started guides --- ui-ngx/src/assets/getting-started/guide-arduino.md | 2 ++ ui-ngx/src/assets/getting-started/guide-java-ws.md | 2 ++ ui-ngx/src/assets/getting-started/guide-java.md | 2 ++ ui-ngx/src/assets/getting-started/guide-javascript.md | 2 ++ ui-ngx/src/assets/getting-started/guide-mosquitto.md | 10 +++++++--- ui-ngx/src/assets/getting-started/guide-python.md | 2 ++ 6 files changed, 17 insertions(+), 3 deletions(-) diff --git a/ui-ngx/src/assets/getting-started/guide-arduino.md b/ui-ngx/src/assets/getting-started/guide-arduino.md index 34e5f7915..9c3107e6b 100644 --- a/ui-ngx/src/assets/getting-started/guide-arduino.md +++ b/ui-ngx/src/assets/getting-started/guide-arduino.md @@ -33,6 +33,8 @@ Find and install the following libraries: The code snippet below provides an example on how to connect to a TBMQ broker using default credentials `TBMQ WebSockets MQTT Credentials`, subscribe to a topic, publish a message, and handle received message. +In case you have changed the `TBMQ WebSockets MQTT Credentials`, don't forget to update the client ID, username, and password in the guide. + Please do not forget to edit following constants and variables in the sketch: - `WIFI_AP` - name of your access point diff --git a/ui-ngx/src/assets/getting-started/guide-java-ws.md b/ui-ngx/src/assets/getting-started/guide-java-ws.md index 3358a42fc..d0414ed87 100644 --- a/ui-ngx/src/assets/getting-started/guide-java-ws.md +++ b/ui-ngx/src/assets/getting-started/guide-java-ws.md @@ -20,6 +20,8 @@ In order to use Paho library in your Maven project, please make sure you have ad The Java code below is an example of how to establish a connection to the TBMQ using default credentials `TBMQ WebSockets MQTT Credentials`, subscribe to a topic, and publish a message. +In case you have changed the `TBMQ WebSockets MQTT Credentials`, don't forget to update the client ID, username, and password in the guide. + ```bash import org.eclipse.paho.mqttv5.client.IMqttMessageListener; import org.eclipse.paho.mqttv5.client.MqttClient; diff --git a/ui-ngx/src/assets/getting-started/guide-java.md b/ui-ngx/src/assets/getting-started/guide-java.md index 5f7c6b14f..c4ecf77b0 100644 --- a/ui-ngx/src/assets/getting-started/guide-java.md +++ b/ui-ngx/src/assets/getting-started/guide-java.md @@ -20,6 +20,8 @@ In order to use Paho library in your Maven project, please make sure you have ad The Java code below is an example of how to establish a connection to the TBMQ using default credentials `TBMQ WebSockets MQTT Credentials`, subscribe to a topic, and publish a message. +In case you have changed the `TBMQ WebSockets MQTT Credentials`, don't forget to update the client ID, username, and password in the guide. + ```bash import org.eclipse.paho.mqttv5.client.IMqttMessageListener; import org.eclipse.paho.mqttv5.client.MqttClient; diff --git a/ui-ngx/src/assets/getting-started/guide-javascript.md b/ui-ngx/src/assets/getting-started/guide-javascript.md index 76e37ebc2..836bde2ba 100644 --- a/ui-ngx/src/assets/getting-started/guide-javascript.md +++ b/ui-ngx/src/assets/getting-started/guide-javascript.md @@ -36,6 +36,8 @@ MQTT.js version: 5.9.1 ##### Connect to the TBMQ The code snippet below provides a demonstration on how to connect to a TBMQ broker using default credentials `TBMQ WebSockets MQTT Credentials`, subscribe to a topic, publish a message, handle received messages and some MQTT client events. +In case you have changed the `TBMQ WebSockets MQTT Credentials`, don't forget to update the client ID, username, and password in the guide. + You may paste this code into a new JavaScript file in your project, e.g. `tbmq_js_example.js`. ```bash diff --git a/ui-ngx/src/assets/getting-started/guide-mosquitto.md b/ui-ngx/src/assets/getting-started/guide-mosquitto.md index e424735cf..1b5bdd63e 100644 --- a/ui-ngx/src/assets/getting-started/guide-mosquitto.md +++ b/ui-ngx/src/assets/getting-started/guide-mosquitto.md @@ -13,11 +13,15 @@ sudo apt-get install mosquitto-clients{:copy-code} ``` ##### Subscribe -To subscribe client to the MQTT topic `tbmq/demo/+` we will use the mosquitto_sub MQTT client. + +In this guide we will use the default TBMQ credentials `TBMQ WebSockets MQTT Credentials` to subscribe to the MQTT topic `tbmq/demo/+`. + +In case you have changed the `TBMQ WebSockets MQTT Credentials`, don't forget to update the client ID (`-i`), username (`-u`), and password (`-P`) in the commands below. + Please copy and paste the following code into a terminal tab: ```bash -mosquitto_sub -h {:mqttHost} -p {:mqttPort} -d -u tbmq_websockets_username -t tbmq/demo/+ -q 1 -c -i tbmq -v -V mqttv5{:copy-code} +mosquitto_sub -d -q 1 -h {:mqttHost} -p {:mqttPort} -t tbmq/demo/+ -i tbmq -u tbmq_websockets_username -c -v{:copy-code} ``` ##### Publish @@ -25,7 +29,7 @@ mosquitto_sub -h {:mqttHost} -p {:mqttPort} -d -u tbmq_websockets_username -t tb In order to publish a message on topic `tbmq/demo/topic`, open a new terminal tab and paste the following command: ```bash -mosquitto_pub -h {:mqttHost} -p {:mqttPort} -d -u tbmq_websockets_username -t tbmq/demo/topic -m 'Hello World' -q 1 -V mqttv5{:copy-code} +mosquitto_pub -d -q 1 -h {:mqttHost} -p {:mqttPort} -t tbmq/demo/topic -u tbmq_websockets_username -m 'Hello World'{:copy-code} ```
diff --git a/ui-ngx/src/assets/getting-started/guide-python.md b/ui-ngx/src/assets/getting-started/guide-python.md index d0bf8e866..6df776195 100644 --- a/ui-ngx/src/assets/getting-started/guide-python.md +++ b/ui-ngx/src/assets/getting-started/guide-python.md @@ -23,6 +23,8 @@ pip3 show paho-mqtt{:copy-code} ##### Connect to the TBMQ The script below sets up a Paho MQTT client to connect to the TBMQ broker using default credentials `TBMQ WebSockets MQTT Credentials`, handles basic MQTT operations such as publishing a message and subscribing to a topic. +In case you have changed the `TBMQ WebSockets MQTT Credentials`, don't forget to update the client ID, username, and password in the guide. + You can paste this code into a new file in your project `tbmq-python.py`. ```bash