### Install coap-client for Ubuntu Source: https://thingsboard.io/docs/pe/user-guide/ssl/coap-access-token Provides commands to install the 'coap-client' utility on different Ubuntu versions. This utility is necessary for running the plain CoAP examples. ```shell sudo apt install libcoap2-bin ``` ```shell sudo apt install libcoap1-bin ``` -------------------------------- ### Install and Run ThingsBoard Edge Services Source: https://thingsboard.io/docs/edge/config/edge-cluster-setup Commands to install, start, and manage ThingsBoard Edge services using Docker. Includes instructions for accessing the ThingsBoard Edge UI and viewing container logs. ```bash ./docker-install-tb.sh ./docker-start-services.sh ``` -------------------------------- ### Install Apache Cassandra Source: https://thingsboard.io/docs/user-guide/install/pe/rhel_rhelThingsboardDatabase=postgresql Installs Apache Cassandra and its command-line tools. This involves importing the GPG key, adding the Cassandra repository, installing the packages, and starting the Cassandra service. It also configures Cassandra to start on boot. ```bash # Import GPG key sudo rpm --import https://downloads.apache.org/cassandra/KEYS # Add Cassandra repository sudo tee /etc/yum.repos.d/cassandra.repo > /dev/null < ... ``` -------------------------------- ### Start ThingsBoard Web Report Server (Windows) Source: https://thingsboard.io/docs/user-guide/install/pe/windows_ubuntuThingsboardDatabase=postgresql This command starts the ThingsBoard Web Report Server service on a Windows system. It's typically used after installation or if the service has been stopped. Run the command prompt as an Administrator. ```batch net start tb-web-report ``` -------------------------------- ### Run ThingsBoard Installation Script Source: https://thingsboard.io/docs/user-guide/install/cluster/minikube-cluster-setup Executes the main installation script for ThingsBoard on Kubernetes. The `--loadDemo` flag is optional and used to include demo data. ```bash ./k8s-install-tb.sh --loadDemo ``` -------------------------------- ### Initialize Device and Connect to ThingsBoard (C++) Source: https://thingsboard.io/docs/devices-library/esp-eye Sets up the device's hardware and software during the `setup()` function. This includes configuring peripherals, initializing the camera, establishing WiFi connection, and connecting to the ThingsBoard server. It also subscribes to RPC calls and attribute updates. ```cpp void setup() { WRITE_PERI_REG(RTC_CNTL_BROWN_OUT_REG, 0); ledcAttachPin(4, 4); ledcSetup(4, 5000, 8); imageBuffer = (char *)ps_malloc(50U * 1024); Serial.begin(SERIAL_DEBUG_BAUD); Serial.println("Camera initialization..."); if (!initCamera()) { Serial.println("Camera initialization failed!"); ESP.restart(); } pinMode(LED_BUILTIN, OUTPUT); delay(1000); InitWiFi(); tb.connect(THINGSBOARD_SERVER, TOKEN, THINGSBOARD_PORT); rpc.RPC_Subscribe(callbacks.cbegin(), callbacks.cend()); shared_update.Shared_Attributes_Subscribe(attributes_callback); attr_request.Shared_Attributes_Request(attribute_shared_request_callback); attr_request.Client_Attributes_Request(attribute_client_request_callback); } ``` -------------------------------- ### Device Setup and Loop Logic Source: https://thingsboard.io/docs/paas/devices-library/raspberry-pi-pico-w This section outlines the device's setup and main loop. The `setup()` function initializes serial communication, configures the built-in LED, and connects to WiFi. The `loop()` function continuously checks for WiFi connectivity, connects to ThingsBoard, subscribes to RPC and attribute updates, and requests initial attribute states. ```cpp void setup() { // Initalize serial connection for debugging Serial.begin(115200); pinMode(LED_BUILTIN, OUTPUT); digitalWrite(LED_BUILTIN, LOW); delay(1000); InitWiFi(); } void loop() { delay(10); if (!reconnect()) { subscribed = false; return; } if (!tb.connected()) { subscribed = false; // Connect to the ThingsBoard Serial.print("Connecting to: "); Serial.print(THINGSBOARD_SERVER); Serial.print(" with token "); Serial.println(TOKEN); if (!tb.connect(THINGSBOARD_SERVER, TOKEN, THINGSBOARD_PORT)) { Serial.println("Failed to connect"); return; } // Sending a MAC address as an attribute tb.sendAttributeData("macAddress", getMAC()); } if (!subscribed) { Serial.println("Subscribing for RPC..."); // Perform a subscription. All consequent data processing will happen in // processSetLedState() and processSetLedMode() functions, // as denoted by callbacks array. if (!tb.RPC_Subscribe(callbacks.cbegin(), callbacks.cend())) { Serial.println("Failed to subscribe for RPC"); return; } if (!tb.Shared_Attributes_Subscribe(attributes_callback)) { Serial.println("Failed to subscribe for shared attribute updates"); return; } Serial.println("Subscribe done"); subscribed = true; // Request current states of shared attributes if (!tb.Shared_Attributes_Request(attribute_shared_request_callback)) { Serial.println("Failed to request for shared attributes"); return; } // Request current states of client attributes if (!tb.Client_Attributes_Request(attribute_client_request_callback)) { ``` -------------------------------- ### Install and Start PostgreSQL Source: https://thingsboard.io/docs/trendz/install/ubuntu Installs PostgreSQL version 16 and starts the service. This is a prerequisite for Trendz database setup. ```bash sudo apt update sudo apt -y install postgresql-16 sudo service postgresql start ``` -------------------------------- ### Install and Run TBMQ on Linux/macOS Source: https://thingsboard.io/docs/mqtt-broker/getting-started This script installs and runs the TBMQ broker on Linux and macOS systems using Docker. It downloads the installation script, makes it executable, and then runs it. Ensure Docker is installed and running before executing. ```bash wget https://raw.githubusercontent.com/thingsboard/tbmq/release-2.2.0/msa/tbmq/configs/tbmq-install-and-run.sh && sudo chmod +x tbmq-install-and-run.sh && ./tbmq-install-and-run.sh ``` -------------------------------- ### Install Cassandra on Ubuntu Source: https://thingsboard.io/docs/user-guide/install/linux Installs Cassandra and its tools on an Ubuntu system using apt-get. This is the initial step for setting up a Cassandra backend for ThingsBoard. ```bash sudo apt-get install -y cassandra cassandra-tools ``` -------------------------------- ### Main Execution Block for Device Provisioning (Python) Source: https://thingsboard.io/docs/pe/user-guide/device-provisioning Sets up configuration, generates certificates, and initiates the device provisioning process. It reads configuration, prepares the provisioning request payload, generates necessary certificates, and then uses the ProvisionClient to connect and provision the device. ```python if __name__ == '__main__': config = collect_required_data() THINGSBOARD_HOST = config["host"] THINGSBOARD_PORT = config["port"] PROVISION_REQUEST = {"provisionDeviceKey": config["provision_device_key"], "provisionDeviceSecret": config["provision_device_secret"], "credentialsType": "X509_CERTIFICATE", } if config.get("device_name") is not None: PROVISION_REQUEST["deviceName"] = config["device_name"] generate_certs() cert, key = read_cert() PROVISION_REQUEST["hash"] = cert if PROVISION_REQUEST.get("hash") is not None: provision_client = ProvisionClient(THINGSBOARD_HOST, THINGSBOARD_PORT, PROVISION_REQUEST) provision_client.provision() tb_client = provision_client.get_new_client() if tb_client: tb_client.on_connect = on_tb_connected tb_client.connect(THINGSBOARD_HOST, THINGSBOARD_PORT, 60) ``` -------------------------------- ### Install and Run ThingsBoard (Shell) Source: https://thingsboard.io/docs/user-guide/install/cluster/docker-compose-setup Installs ThingsBoard using a script, with an option to load demo data. After installation, services can be started to make the platform accessible via a web browser. ```shell ./docker-install-tb.sh --loadDemo ``` ```shell ./docker-start-services.sh ``` -------------------------------- ### Install and Run TBMQ on Windows Source: https://thingsboard.io/docs/mqtt-broker/getting-started This PowerShell script installs and runs the TBMQ broker on Windows systems using Docker Desktop. It downloads the installation script and then executes it. Ensure Docker Desktop is installed and running, and that PowerShell scripts are allowed to run. ```powershell Invoke-WebRequest -Uri "https://raw.githubusercontent.com/thingsboard/tbmq/release-2.2.0/msa/tbmq/configs/windows/tbmq-install-and-run.ps1" ` -OutFile ".\tbmq-install-and-run.ps1"; .\tbmq-install-and-run.ps1 ``` -------------------------------- ### Start ThingsBoard Docker Services Source: https://thingsboard.io/docs/mqtt-broker/install/cluster/resources/upgrade-options/docker-compose-upgrade-tbmq-without-from-version This script starts all necessary Docker services for ThingsBoard. It is typically used after stopping services or during initial setup. Ensure Docker is installed and configured. ```bash ./scripts/docker-start-services.sh ``` -------------------------------- ### Install TBMQ on Windows using PowerShell Source: https://thingsboard.io/docs/pe/mqtt-broker/getting-started This PowerShell script installs and runs TBMQ Professional Edition on Windows systems with Docker Desktop. It downloads the script, optionally adjusts the execution policy, and then runs the installation. ```powershell Invoke-WebRequest -Uri "https://raw.githubusercontent.com/thingsboard/tbmq-pe-docker-compose/release-2.2.0/basic/windows/tbmq-install-and-run.ps1" ` -OutFile ".\tbmq-install-and-run.ps1"; .\tbmq-install-and-run.ps1 ``` -------------------------------- ### Client Libraries Setup Source: https://thingsboard.io/docs/reference/mqtt-api Instructions for setting up MQTT client libraries, specifically Mosquitto and MQTT.js, for interacting with the ThingsBoard MQTT API. ```APIDOC ## Client Libraries Setup ### Description This section details how to install and set up MQTT client libraries, including Mosquitto command-line tools and MQTT.js for JavaScript, to interact with the ThingsBoard MQTT API. ### Mosquitto Installation **Ubuntu:** ```bash sudo apt-get install mosquitto-clients ``` **macOS:** ```bash brew install mosquitto-clients ``` **Windows:** 1. Download and install Eclipse Mosquitto from the official download page. 2. Add the Mosquitto installation directory (e.g., `C:\Program Files\mosquitto`) to your system's "Path" environment variable. * Press Win + X, select "System" -> "About" -> "Advanced system settings". * In "System Properties", click "Environment Variables". * Under "System variables", select "Path" and click "Edit". * Click "New" and add the Mosquitto directory path. * Click "OK" on all open windows to save changes. ``` -------------------------------- ### Python Client SDK Getting Started Source: https://thingsboard.io/docs/reference/python-client-sdk Basic example demonstrating client initialization and telemetry publishing. ```APIDOC ## Getting Started Client initialization and telemetry publishing. ```python from tb_device_mqtt import TBDeviceMqttClient, TBPublishInfo aupdated_telemetry = {"temperature": 41.9, "enabled": False, "currentFirmwareVersion": "v1.2.2"} client = TBDeviceMqttClient("127.0.0.1", username="A1_TEST_TOKEN") # Connect to ThingsBoard client.connect() # Sending telemetry without checking the delivery status client.send_telemetry(updated_telemetry) # Sending telemetry and checking the delivery status (QoS = 1 by default) result = client.send_telemetry(updated_telemetry) # get is a blocking call that awaits delivery status success = result.get() == TBPublishInfo.TB_ERR_SUCCESS # Disconnect from ThingsBoard client.disconnect() ``` ``` -------------------------------- ### Start ThingsBoard LwM2M Demo Client with PSK Source: https://thingsboard.io/docs/pe/edge/reference/lwm2m-api Provides command-line examples for launching the ThingsBoard LwM2M Demo Client in PSK mode. It demonstrates usage with a specific version and also with the 'latest' Docker image, specifying connection details like endpoint name, PSK identity, and PSK key. ```bash java -jar thingsboard-lwm2m-demo-client-{version}.jar -u coaps:// -n MyClientPsk --psk-identity myIdentity --psk-key 01020304050607080A0B0C0D0F010203 ``` ```bash java -jar thingsboard-lwm2m-demo-client-4.1.0.jar -u coaps:// -n MyClientPsk --psk-identity myIdentity --psk-key 01020304050607080A0B0C0D0F010203 ``` ```bash docker run --rm -it thingsboard/tb-lwm2m-demo-client:latest -u coaps:// -n MyClientPsk -i myIdentity -p 01020304050607080A0B0C0D0F010203 ``` -------------------------------- ### Get Latest Time-Series Data Response (JSON) Source: https://thingsboard.io/docs/paas/user-guide/telemetry Example JSON response for the 'Get Latest Time-Series Data' API call, showing telemetry keys and their most recent values with timestamps. ```json { "gas": [ { "ts": 1479735870786, "value": "1" } ], "temperature": [ { "ts": 1479735870786, "value": "3" } ] } ``` -------------------------------- ### Device Setup and Initialization Source: https://thingsboard.io/docs/pe/devices-library/arduino-nano-rp2040-connect The setup function initializes the serial communication for debugging, configures LED pins as outputs, and initializes the WiFi connection. This is a standard Arduino setup routine. ```cpp void setup() { // Initalize serial connection for debugging Serial.begin(115200); pinMode(LEDR, OUTPUT); pinMode(LEDG, OUTPUT); pinMode(LEDB, OUTPUT); digitalWrite(LEDR, LOW); digitalWrite(LEDG, LOW); digitalWrite(LEDB, LOW); delay(1000); InitWiFi(); } ``` -------------------------------- ### Run Device Provisioning Script Source: https://thingsboard.io/docs/paas/eu/user-guide/device-provisioning This command executes the Python script 'device-provision-example.py' using the python3 interpreter. The script will guide the user through the process of provisioning a new device with ThingsBoard. ```bash python3 device-provision-example.py ``` -------------------------------- ### Install TBMQ on Linux/macOS using Docker Source: https://thingsboard.io/docs/pe/mqtt-broker/getting-started This script installs and runs TBMQ Professional Edition on Linux or macOS systems with Docker. It downloads the necessary script, makes it executable, and then executes it to set up TBMQ. ```bash wget https://raw.githubusercontent.com/thingsboard/tbmq-pe-docker-compose/release-2.2.0/basic/tbmq-install-and-run.sh && sudo chmod +x tbmq-install-and-run.sh && ./tbmq-install-and-run.sh ``` -------------------------------- ### Clone and Build ThingsBoard Rule Node Examples Source: https://thingsboard.io/docs/pe/user-guide/contribution/rule-node-development This snippet demonstrates how to clone the rule-node-examples repository from GitHub and build the project using Maven. It also shows how to configure the ThingsBoard version in the pom.xml file. ```bash git clone -b release-4.3 https://github.com/thingsboard/rule-node-examples cd rule-node-examples mvn clean install ``` ```xml ... 4.3.0.1PE ... ``` -------------------------------- ### Get Historical Time-Series Data Response (JSON) Source: https://thingsboard.io/docs/paas/user-guide/telemetry Example JSON response for the 'Get Historical Time-Series Data' API call, displaying aggregated time-series data points for specified keys within a given time range. ```json { "gas": [ { "ts": 1479735870786, "value": "1" }, { "ts": 1479735871857, "value": "2" } ], "temperature": [ { "ts": 1479735870786, "value": "3" }, { "ts": 1479735871857, "value": "4" } ] } ``` -------------------------------- ### Setup Function for IoT Device (C++) Source: https://thingsboard.io/docs/devices-library/esp32-dev-kit-v1 The setup function initializes serial communication for debugging and configures the built-in LED pin as an output. It then calls `InitWiFi()` to establish a network connection, ensuring the device is ready to communicate with the IoT platform. ```cpp void setup() { // Initialize serial connection for debugging Serial.begin(SERIAL_DEBUG_BAUD); if (LED_BUILTIN != 99) { pinMode(LED_BUILTIN, OUTPUT); } delay(1000); InitWiFi(); } ``` -------------------------------- ### Getting Started: Client Initialization and Telemetry Publishing Source: https://thingsboard.io/docs/pe/reference/python-client-sdk Demonstrates how to initialize the client and publish telemetry data. Includes examples for sending telemetry with and without checking delivery status. ```APIDOC ## Getting Started Client initialization and telemetry publishing. ```python from tb_device_mqtt import TBDeviceMqttClient, TBPublishInfo aupdate_interval = 10000 telemetry = {"temperature": 41.9, "enabled": False, "currentFirmwareVersion": "v1.2.2"} client = TBDeviceMqttClient("127.0.0.1", username="A1_TEST_TOKEN") # Connect to ThingsBoard client.connect() # Sending telemetry without checking the delivery status client.send_telemetry(telemetry) # Sending telemetry and checking the delivery status (QoS = 1 by default) result = client.send_telemetry(telemetry) # get is a blocking call that awaits delivery status success = result.get() == TBPublishInfo.TB_ERR_SUCCESS # Disconnect from ThingsBoard client.disconnect() ``` ``` -------------------------------- ### Create Project Folder Source: https://thingsboard.io/docs/devices-library/beaglebone-black Creates a new directory for the project and navigates into it. This is the initial step for setting up the project environment. ```bash mkdir thingsboard_example && cd thingsboard_example ``` -------------------------------- ### Install and Start PostgreSQL Service Source: https://thingsboard.io/docs/user-guide/install/rpi Installs the PostgreSQL database system and starts its service using apt package manager. This is a prerequisite for storing ThingsBoard data. ```bash sudo apt update sudo apt -y install postgresql sudo service postgresql start ``` -------------------------------- ### Run ThingsBoard LwM2M Demo Client Source: https://thingsboard.io/docs/paas/reference/lwm2m-api Example command to run the ThingsBoard LwM2M Demo Client with specific parameters for OTA testing. It connects to the ThingsBoard cloud instance and enables OTA functionality. ```bash java -jar thingsboard-lwm2m-demo-client-{version}.jar -u coap://lwm2m.thingsboard.cloud -n MyClientNoSec -tota ``` -------------------------------- ### Install and Initialize PostgreSQL Server Source: https://thingsboard.io/docs/trendz/install/rhel Installs PostgreSQL 16 packages, initializes the database cluster, and starts the PostgreSQL service. Optionally configures it to start on boot. ```bash # Install packages sudo dnf -qy module disable postgresql sudo dnf -y install postgresql16 postgresql16-server postgresql16-contrib # Initialize your PostgreSQL DB sudo /usr/pgsql-16/bin/postgresql-16-setup initdb sudo systemctl start postgresql-16 # Optional: Configure PostgreSQL to start on boot sudo systemctl enable --now postgresql-16 ``` -------------------------------- ### Install and Start Web Report Service (Bash) Source: https://thingsboard.io/docs/user-guide/install/pe/ubuntu This sequence of commands installs the ThingsBoard Reports Server Debian package and then starts the associated service. It requires root privileges for installation and service management. ```bash sudo dpkg -i tb-web-report-4.3.0.1pe.deb sudo service tb-web-report start ``` -------------------------------- ### Setup Logs Volume for ThingsBoard TCP/UDP Integration Source: https://thingsboard.io/docs/paas/eu/user-guide/integrations/remote-integrations Prepares the host system by creating a directory for storing logs from the ThingsBoard PE TCP/UDP integration and assigning the correct permissions to the non-root Docker user. This is a prerequisite for running the container with log volume mapping. ```bash mkdir -p ~/.tb-pe-tcp-udp-integration-logs && sudo chown -R 799:799 ~/.tb-pe-tcp-udp-integration-logs ``` -------------------------------- ### Initialize and Connect to ThingsBoard Source: https://thingsboard.io/docs/samples/arduino/sim808-htu21d Sets up the serial connection, WiFi, and initializes the ThingsBoard client. It attempts to connect to the ThingsBoard server using provided credentials and sends the device's MAC address as an attribute. ```cpp void setup() { // Initalize serial connection for debugging Serial.begin(115200); pinMode(LEDR, OUTPUT); pinMode(LEDG, OUTPUT); pinMode(LEDB, OUTPUT); digitalWrite(LEDR, LOW); digitalWrite(LEDG, LOW); digitalWrite(LEDB, LOW); delay(1000); InitWiFi(); } void loop() { delay(10); if (!reconnect()) { subscribed = false; return; } if (!tb.connected()) { subscribed = false; // Connect to the ThingsBoard Serial.print("Connecting to: "); Serial.print(THINGSBOARD_SERVER); Serial.print(" with token "); Serial.println(TOKEN); if (!tb.connect(THINGSBOARD_SERVER, TOKEN, THINGSBOARD_PORT)) { Serial.println("Failed to connect"); return; } // Sending a MAC address as an attribute tb.sendAttributeData("macAddress", getMAC()); } // ... rest of the loop function ... } ``` -------------------------------- ### Example Cassandra Node Status Output Source: https://thingsboard.io/docs/user-guide/install/pe/ubuntu_ubuntuThingsboardDatabase=postgresql Illustrates the expected output from the `nodetool status` command, showing a Cassandra node in an 'Up/Normal' state. This helps in confirming a successful Cassandra setup. ```text $ nodetool status Datacenter: datacenter1 ======================= Status=Up/Down |/ State=Normal/Leaving/Joining/Moving -- Address Load Tokens Owns (effective) Host ID Rack UN 127.0.0.1 114.67 KiB 16 100.0% b8e1bd83-5280-4e48-8b17-a4548eec583b rack1 $ sudo systemctl status cassandra.service ● cassandra.service - LSB: distributed storage system for structured data Loaded: loaded (/etc/init.d/cassandra; generated) Active: active (running) since Thu 2025-04-24 14:04:35 UTC; 43s ago Docs: man:systemd-sysv-generator(8) Process: 9415 ExecStart=/etc/init.d/cassandra start (code=exited, status=0/SUCCESS) Tasks: 61 (limit: 9439) Memory: 4.3G (peak: 4.3G) CPU: 14.470s CGroup: /system.slice/cassandra.service └─9553 /usr/bin/java -ea -da:net.openhft... -XX:+UseThreadPriorities -XX:+HeapDumpOnOutOfMemoryError -Xss256k -XX:+AlwaysPreTouch -XX:+UseTLAB -XX:+ResizeTLAB -XX:+UseNUMA -XX:> ``` -------------------------------- ### CoAP Device API Reference Source: https://thingsboard.io/docs/paas/eu/reference/coap-api This section details the CoAP Device API, including getting started guides, data formats, and specific API endpoints for telemetry, attributes, RPC, and more. ```APIDOC ## CoAP Device API Reference ### Description This document provides a reference for the CoAP Device API, covering device connectivity, data formats, and API interactions. ### Getting Started #### CoAP Basics CoAP is a light-weight IoT protocol for constrained devices. It is UDP based and uses a request-response model. The CoAP Observe Option allows subscription to resources and receiving notifications on resource change. ThingsBoard server nodes act as a CoAP Server. #### Client Libraries Setup CoAP client libraries are available for various programming languages. The examples use `coap-cli`. Installation on Linux/macOS: ```bash npm install coap-cli -g ``` Note: `coap-cli` does not support query parameters. For query parameter support, use `coap-client` (e.g., `sudo apt install libcoap2-bin` on Ubuntu 20.04). #### CoAP Authentication and Error Codes Device authentication typically uses an access token provided as a path parameter (e.g., `$ACCESS_TOKEN`). **Common Error Codes:** - **4.00 Bad Request**: Invalid URL, parameters, or body. - **4.01 Unauthorized**: Invalid access token. - **4.04 Not Found**: Resource not found. Alternative authentication using X.509 Certificates is also supported. ### Key-Value Format ThingsBoard supports key-value content in JSON format by default. Keys are strings, and values can be strings, booleans, doubles, longs, or JSON objects. **Example JSON Payload:** ```json { "stringKey":"value1", "booleanKey":true, "doubleKey":42.0, "longKey":73, "jsonKey": { "someNumber": 42, "someArray": [1,2,3], "someNestedObject": {"key": "value"} } } ``` Data can also be sent via Protocol Buffers or custom binary formats. Refer to device profile configuration and protocol customization for details. ``` -------------------------------- ### Install Cassandra Tools Source: https://thingsboard.io/docs/user-guide/install/edge/deb-installation Installs the necessary tools for interacting with Cassandra. This is a prerequisite for running Cassandra. ```bash sudo apt-get install cassandra-tools ``` -------------------------------- ### Setup Mosquitto MQTT Client on Windows Source: https://thingsboard.io/docs/paas/eu/reference/mqtt-api Provides step-by-step instructions for downloading, installing, and configuring the Eclipse Mosquitto MQTT client on Windows. This involves downloading the installer, running it, and updating the system's PATH environment variable to include the Mosquitto installation directory. ```text 1. Download and Install Eclipse Mosquitto. Visit Mosquitto’s official download page and choose the appropriate Windows installer (32-bit or 64-bit depending on your system). 2. Once downloaded, run the installer and follow the instructions. This will install Mosquitto on your Windows machine. By default, Mosquitto is installed in ‘C:\Program Files\mosquitto’; 3. Update the System's “Path” variable. The executables ‘mosquitto_pub.exe’ and ‘mosquitto_sub.exe’ are located in the directory where you installed the Mosquitto. You need to add this directory to your system’s “Path” environment variable so that Windows can find these executables regardless of the current directory. To add the Mosquitto directory to the “Path” variable, follow these steps: * Press the Win + X, then select “System”. Then click on the “System” page; * Navigate to the “About” section, then click “Advanced system settings”; * In the “System Properties” pop-up window, click “Environment Variables” button on the “Advanced” tab; * In the “Environment Variables” pop-up window, select the “Path”, then click on the “Edit” button; * In the “Edit environment variable” pop-up window click on the “New” button and add the path to the directory containing 'mosquitto_pub.exe' and 'mosquitto_sub.exe' ('C:\Program Files\mosquitto' by default). Click “OK” button; * Click “OK” button to save changes in the environment variables; * Finally, click “OK” button to apply all changes in the system properties. ``` -------------------------------- ### Launch LwM2M Demo Client (Java JAR) Source: https://thingsboard.io/docs/paas/eu/reference/lwm2m-api This command launches the ThingsBoard LwM2M Demo Client using a Java JAR file. It requires the LwM2M server URL and a unique endpoint name for the device. Ensure the correct JAR file and server address are used. ```bash java -jar thingsboard-lwm2m-demo-client-{version}.jar -u coap:// -n $UNIQUE_ENDPOINT_NAME ``` ```bash java -jar thingsboard-lwm2m-demo-client-4.1.0.jar -u coap:// -n $UNIQUE_ENDPOINT_NAME ``` -------------------------------- ### Install and Start Web Report Service (RPM) Source: https://thingsboard.io/docs/user-guide/install/pe/rhel_rhelThingsboardDatabase=postgresql This sequence of commands installs the ThingsBoard Web Report service using the previously downloaded RPM package and then starts the service. `sudo rpm -Uvh` upgrades or installs the package, and `sudo service tb-web-report start` initiates the service. Ensure all prerequisites are met before running these commands. ```bash sudo rpm -Uvh tb-web-report-4.3.0.1pe.rpm sudo service tb-web-report start ``` -------------------------------- ### Install Apache Cassandra and Tools Source: https://thingsboard.io/docs/user-guide/install/rhel_rhelThingsboardDatabase=postgresql This script installs Apache Cassandra and its command-line tools on a Red Hat-based system. It imports a GPG key, adds the Cassandra repository, installs packages, and starts the Cassandra service, configuring it to start on boot. ```bash # Import GPG key sudo rpm --import https://downloads.apache.org/cassandra/KEYS # Add Cassandra repository sudo tee /etc/yum.repos.d/cassandra.repo > /dev/null <