### Run Setup Script Source: https://docs.dronahq.com/self-hosted-deployment/deployment-options/local-machine Initializes the DronaHQ environment. Note that this will clear any existing installation. ```bash ./dronahq_setup ``` -------------------------------- ### StartGPSLocationTracking Implementation Example Source: https://docs.dronahq.com/reference/keywords-js-utilities/Utility An example of calling the StartGPSLocationTracking method with specific configuration values. ```javascript await UTILITY.StartGPSLocationTracking("https://example.com/gpslocation", {"Content-Type": "application/json"}, {"latitude":"@latitude","longitude":"@longitude"}, 10, 0, 50, 50, true, "App Name", "Tracking your location in background", 10000, 5000, 10000, true, true); ``` -------------------------------- ### Install MySQL client Source: https://docs.dronahq.com/self-hosted-deployment/configure-external-databases Installs the core MySQL client package for database connectivity. ```bash sudo apt install mysql-client-core-8.0 ``` -------------------------------- ### Initialize DronaHQ Environment Source: https://docs.dronahq.com/self-hosted-deployment/deployment-options/azure Executes the setup script to initialize the environment. Note that this will clear existing installations and create backups. ```bash ./dronahq_setup ``` -------------------------------- ### Start Containerd Service Source: https://docs.dronahq.com/self-hosted-deployment/deploy-kubernetes-on-macos Reload systemd and enable the containerd service to start at boot. ```bash sudo systemctl daemon-reload sudo systemctl enable --now containerd ``` -------------------------------- ### Run the DronaHQ RPC Agent Source: https://docs.dronahq.com/reference/connectors/dronahqRPC Command to start the RPC agent process after installing necessary dependencies. ```bash node agent.js ``` -------------------------------- ### Install MongoDB tools Source: https://docs.dronahq.com/self-hosted-deployment/configure-external-databases Installs the MongoDB database tools and removes the installer file. ```bash sudo dpkg -i mongodb-database-tools-ubuntu2204-x86_64-100.7.4.deb \ && rm mongodb-database-tools-ubuntu2204-x86_64-100.7.4.deb ``` -------------------------------- ### Install Containerd Runtime Source: https://docs.dronahq.com/self-hosted-deployment/deploy-kubernetes-on-macos Download and install the ARM64 version of containerd to avoid compatibility issues. ```bash curl -LO https://github.com/containerd/containerd/releases/download/v1.7.0/containerd-1.7.0-linux-arm64.tar.gz sudo tar Czxvf /usr/local containerd-1.7.0-linux-arm64.tar.gz ``` -------------------------------- ### Verify MySQL client installation Source: https://docs.dronahq.com/self-hosted-deployment/configure-external-databases Checks the installed version of the MySQL client. ```bash mysql --version ``` ```text mysql Ver 8.0.33-0ubuntu0.22.04.4 for Linux on x86_64 ((Ubuntu)) ``` -------------------------------- ### Price Update Message Example Source: https://docs.dronahq.com/building-apps-guides/websocket-dronahq Example of the formatted price update string. ```text Price Update for BTCUSDT: $30500.45 ``` -------------------------------- ### BINDAPI Function Examples Source: https://docs.dronahq.com/reference/keywords-js-utilities/fx-formulas Examples showing basic data binding and advanced usage with filtering and sorting. ```text BINDAPI( [userlist.members.id,userlist.members.name,userlist.members.profile.email]) BINDAPI( [AuthorMongoDB.result.rows.author_id,AuthorMongoDB.result.rows.name,AuthorMongoDB.result.rows.last_name], AuthorMongoDB.result.rows.name $cn “A”, AuthorMongoDB.result.rows.last_name, “DESC”) ``` -------------------------------- ### Install Kubernetes components Source: https://docs.dronahq.com/self-hosted-deployment/deploy-kubernetes-on-macos Installs specific versions of kubelet, kubeadm, and kubectl, and pins them to prevent automatic updates. ```bash KUBE_VERSION=1.27.3 sudo apt-get update sudo apt-get install -y kubelet=${KUBE_VERSION}-00 jq kubectl=${KUBE_VERSION}-00 kubeadm=${KUBE_VERSION}-00 runc kubernetes-cni=1.2.0-00 sudo apt-mark hold kubelet kubeadm kubectl ``` -------------------------------- ### Connection Status Message Example Source: https://docs.dronahq.com/building-apps-guides/websocket-dronahq Example of the message displayed upon successful connection. ```text Connected to WebSocket for BTCUSDT. ``` -------------------------------- ### Install MongoDB shell Source: https://docs.dronahq.com/self-hosted-deployment/configure-external-databases Installs the downloaded MongoDB shell package and removes the installer file. ```bash sudo dpkg -i mongodb-mongosh_1.10.1_amd64.deb && rm mongodb-mongosh_1.10.1_amd64.deb ``` -------------------------------- ### OpenFile Usage and Example Source: https://docs.dronahq.com/reference/keywords-js-utilities/Utility Opens a file from the device. Requires an await keyword as it returns a Promise. ```javascript UTILITY.OpenFile(filePath,mimeType); ``` ```javascript await UTILITY.OpenFile("/storage/emulated/0/Download/file.pdf","application/pdf"); ``` ```json { output: 'file opened successfully' } ``` -------------------------------- ### WebSocket URL Example Source: https://docs.dronahq.com/building-apps-guides/websocket-dronahq Example of the constructed WebSocket URL for a specific trading pair. ```text wss://stream.binance.com:9443/ws/btcusdt@trade ``` -------------------------------- ### Install Kubernetes apt dependencies Source: https://docs.dronahq.com/self-hosted-deployment/deploy-kubernetes-on-macos Updates the package index and installs essential transport and security packages. ```bash sudo apt-get update sudo apt-get install -y apt-transport-https ca-certificates curl ``` -------------------------------- ### Configure Dynamic Start Date with JavaScript Source: https://docs.dronahq.com/reference/controls/date-range-picker Uses Moment.js to calculate a start date 15 days in the future for binding to the control. ```javascript function JSCode(output) { var startDate = moment().add(15, 'days').format('LLL'); output = startDate; return output; } ``` -------------------------------- ### Verify node capacity output Source: https://docs.dronahq.com/self-hosted-deployment/deployment-options/kubernetes Example output showing the Capacity and Allocatable resources for a node. ```text Capacity: cpu: 2 ephemeral-storage: 20134592Ki hugepages-1Gi: 0 hugepages-2Mi: 0 memory: 3944424Ki pods: 17 Allocatable: cpu: 1930m ephemeral-storage: 17482298133 hugepages-1Gi: 0 hugepages-2Mi: 0 memory: 3389416Ki pods: 17 ``` -------------------------------- ### UTILITY.StartGPSLocationTracking Source: https://docs.dronahq.com/reference/keywords-js-utilities/Utility Starts continuous GPS location tracking and sends updates to a provided URL. ```APIDOC ## UTILITY.StartGPSLocationTracking() ### Description Allows the application to continuously track the device's geographical location, even in the background or sleep mode. It sends location updates to a user-provided API endpoint. ### Parameters - **url** (string) - Required - Server URL where to send HTTP POST with recorded locations. - **headers** (object) - Optional - HTTP headers sent along in the HTTP request. - **data** (object) - Required - Location properties to send, prefixed with @ (e.g., @latitude, @longitude). - **stationaryRadius** (number) - Required - Stationary radius value in meters. - **distanceFilter** (number) - Required - Distance filter value in meters. - **desiredAccuracy** (number) - Required - Precision of location updates in meters (10, 100, 1000). - **locationProvider** (number) - Required (Android only) - Provider type (0, 1, 2). - **notificationsEnabled** (boolean) - Required (Android only) - Enable/disable local notifications. - **notificationTitle** (string) - Required (Android only) - Custom notification title. - **notificationText** (string) - Required (Android only) - Custom notification text. - **interval** (number) - Required (Android only) - Interval duration in milliseconds. - **fastestInterval** (number) - Required (Android only) - Fastest interval duration in milliseconds. - **activitiesInterval** (number) - Required (Android only) - Activities interval duration in milliseconds. - **pauseLocationUpdates** (boolean) - Required (iOS only) - Temporarily suspend tracking. - **saveBatteryOnBackground** (boolean) - Required (iOS only) - Switch to less accurate tracking in background. ### Example ```javascript await UTILITY.StartGPSLocationTracking("https://example.com/gpslocation", {"Content-Type": "application/json"}, {"latitude":"@latitude","longitude":"@longitude"}, 10, 0, 50, 50, true, "App Name", "Tracking your location in background", 10000, 5000, 10000, true, true); ``` ``` -------------------------------- ### Script output example Source: https://docs.dronahq.com/app-scripting-and-code/reusable-js-objects The expected output result after running the grade calculation script. ```text "B" ``` -------------------------------- ### Install DronaHQ manifests Source: https://docs.dronahq.com/self-hosted-deployment/deployment-options/kubernetes Apply the required Kubernetes YAML files to deploy DronaHQ components. ```bash kubectl apply -f ./dronahq-secrets.yaml kubectl apply -f ./dronahq-webapp.yaml kubectl apply -f ./load-balancer.yaml ``` -------------------------------- ### REST API Endpoint Example Source: https://docs.dronahq.com/rest-apis/ssl-configuration-apis A basic GET request example used to demonstrate the REST API connector configuration. ```http GET https://rahulgharat.online/json ``` -------------------------------- ### Download MySQL initialization file Source: https://docs.dronahq.com/self-hosted-deployment/configure-external-databases Use this command to download the default initialization file when setting up a new installation. ```bash curl -L -O https://license.dronahq.com/self-hosted/master/init/mysql-init.sql ``` -------------------------------- ### Download MongoDB initialization file Source: https://docs.dronahq.com/self-hosted-deployment/configure-external-databases Use this command to download the default initialization file when setting up a new installation. ```bash curl -L -O https://license.dronahq.com/self-hosted/master/init/mongo-init.dump ``` -------------------------------- ### Retrieve Batch Status Response Source: https://docs.dronahq.com/agents/category/api-reference Example JSON response returned by the GET /voice/outbound/dispatch/{batch_id} endpoint. ```json { "batch_id": "f0c1a3f2-9e1c-4b21-9b8b-5a9c0f0a1e3a", "agent_id": "a1d3...", "created_at": "2026-06-23T10:14:02Z", "total": 2, "queued": 0, "dialing": 1, "completed": 1, "failed": 0, "retrying": 0, "calls": [ { "index": 0, "phone_number": "+14155551234", "status": "completed", "attempts": 1, "error_code": null, "error_message": null, "started_at": "2026-06-23T10:14:05Z", "completed_at": "2026-06-23T10:15:22Z" }, { "index": 1, "phone_number": "+919876543210", "status": "dialing", "attempts": 1, "error_code": null, "error_message": null, "started_at": "2026-06-23T10:14:05Z", "completed_at": null } ] } ``` -------------------------------- ### Example output for user creation Source: https://docs.dronahq.com/connecting-via-ssh-keys Displays the expected terminal output after running the adduser command. ```text Adding user `dronahq` ... Adding new group `dronahq` (1003) ... Adding new user `dronahq` (1002) with group `dronahq` ... Creating home directory `/home/dronahq` ... Copying files from `/etc/skel` ... Changing the user information for `dronahq` Enter the new value, or press ENTER for the default Full Name : Room Number : Work Phone : Home Phone : Other : Is the information correct? [Y/n] y ``` -------------------------------- ### GETFROMKV Usage Examples Source: https://docs.dronahq.com/reference/keywords-js-utilities/fx-formulas Demonstrates retrieving a standard value and a globally stored value from KV storage. ```text GETFROMKV("UserOpen") ``` ```text GETFROMKV("SharedKey",1) ``` -------------------------------- ### Implement Custom Control with Events Source: https://docs.dronahq.com/reference/controls/custom-control A complete HTML/JS example demonstrating how to initialize a custom control, handle lifecycle callbacks, and trigger custom events. ```html
Here is the that you binded to the control you can access it in the setValue callback type
Counter: 0
Clicking on Trigger Change, you will see counter value passed to control referring custom control
Configure event named demo, that will get trigger on the click of Trigger Event