### 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
Custom Control
Read Docs

Here is the that you binded to the control you can access it in the setValue callback type

Counter: 0

``` -------------------------------- ### Usage example of ESCAPEDOUBLEQUOTE Source: https://docs.dronahq.com/reference/keywords-js-utilities/fx-formulas Example showing the function call and its resulting output. ```text ESCAPEDOUBLEQUOTE( [{“productname2”:“Laptop”,“quantity1”:101}]) ``` ```text [{"productname2":"Laptop","quantity1":101}] ``` -------------------------------- ### Initialize Nginx Configuration Source: https://docs.dronahq.com/self-hosted-deployment/configure-ssl-and-ca-certificates Copy the default Nginx configuration file to the root directory. ```bash cp init/nginx.conf nginx.conf ``` -------------------------------- ### Configure OS Prerequisites Source: https://docs.dronahq.com/self-hosted-deployment/deploy-kubernetes-on-macos Load kernel modules and set networking parameters required for Kubernetes. ```bash # Load required kernel modules sudo modprobe overlay sudo modprobe br_netfilter # Persist modules between restarts cat < /dev/null ``` -------------------------------- ### Verify MongoDB tools installation Source: https://docs.dronahq.com/self-hosted-deployment/configure-external-databases Checks the versions of the installed MongoDB shell and restore tools. ```bash mongosh --version && mongorestore --version ``` ```text 1.10.1 mongorestore version: 100.7.4 git version: fb74684da15f56d40231ab04ded86c71c1d8f37c Go version: go1.19.11 os: linux arch: amd64 compiler: gc ``` -------------------------------- ### Initialize secrets configuration Source: https://docs.dronahq.com/self-hosted-deployment/deployment-options/kubernetes Create the secrets file from the provided template. ```bash cp dronahq-secrets.template.yaml dronahq-secrets.yaml ``` -------------------------------- ### Clone Deployment Repository Source: https://docs.dronahq.com/self-hosted-deployment/deploy-kubernetes-on-macos Download the necessary configuration scripts to the local machine. ```bash git clone https://github.com/dronahq/self-hosted.git cd self-hosted/multipass ``` -------------------------------- ### Initialize MongoDB with Root Credentials Source: https://docs.dronahq.com/self-hosted-deployment/environment-variables Use these variables to create a root user in the admin database. Both variables must be provided to enable authentication. ```bash $ docker run -d --network some-network --name some-mongo \ -e MONGO_INITDB_ROOT_USERNAME=mongoadmin \ -e MONGO_INITDB_ROOT_PASSWORD=secret \ mongo $ docker run -it --rm --network some-network mongo \ mongosh --host some-mongo \ -u mongoadmin \ -p secret \ --authenticationDatabase admin \ some-db > db.getName(); some-db ``` -------------------------------- ### WhatsApp Agent Instruction Example Source: https://docs.dronahq.com/agents/triggers/inbuilt-triggers/whatsapp A template for defining agent behavior when a WhatsApp message trigger is activated. ```text When a WhatsApp message is received: - Read the user's message - Use the Message ID to reply - Respond politely and clearly - Maintain conversational context ``` -------------------------------- ### FILTER Function Example Source: https://docs.dronahq.com/reference/keywords-js-utilities/fx-formulas Example usage of the FILTER function to retrieve specific columns with a condition and sorting. ```text FILTER ([prod_datastore.result.rows.name, prod_datastore.result.rows.author_id] , prod_datastore.result.rows.author_id > 6,prod_datastore.result.rows.name, “DESC”) ``` -------------------------------- ### Schedule Preview Example Source: https://docs.dronahq.com/agents/triggers/inbuilt-triggers/scheduler A demonstration of the human-readable output generated by the scheduler for a given Cron expression. ```text */2 * * * ? → Every 2 minutes ``` -------------------------------- ### Set Static Start Value Source: https://docs.dronahq.com/reference/controls/range-picker Defines the initial start value for the range picker using static data. ```text 50 ``` -------------------------------- ### Accessing Get From LocalStorage Output Source: https://docs.dronahq.com/reference/actionflow-blocks/get-kv-data Syntax for accessing the output of a Get From LocalStorage action using its unique name. ```text {{action_unique_name.output}} ``` ```text {{Getlocalstorage_2.output}} ``` -------------------------------- ### Example JS Object implementation Source: https://docs.dronahq.com/app-scripting-and-code/reusable-js-objects A practical example of a JS Object that calculates grades based on input scores and exports the function. ```javascript //required variables var sum, percentage, grades; //function for total function getGradeFromScores (sci,math,eng,pe){ sum = percentage = 0; sum = sci + math + eng + pe; percentage = (sum / 400) * 100; if (percentage <= 100 && percentage >= 80) { grades = "A"; } else if (percentage <= 79 && percentage >= 60) { grades = "B"; } else if (percentage <= 59 && percentage >= 40) { grades = "C"; } else { grades = "F"; } return grades; } ExportModule = { getGradeFromScores: getGradeFromScores, }; ``` -------------------------------- ### GET /api/scim/v2/Groups Source: https://docs.dronahq.com/reference/scim-2-rest-api/groups/list-groups Retrieve a list of groups from the system. ```APIDOC ## GET /api/scim/v2/Groups ### Description Retrieve a list of Groups. ### Method GET ### Endpoint /api/scim/v2/Groups ### Parameters #### Query Parameters - **startIndex** (Integer) - Optional - Index of the first group to be returned - **count** (Integer) - Optional - Number of groups to be returned ### Response #### Success Response (200) - **schemas** (Array) - List of schema URNs - **startIndex** (Integer) - The index of the first result - **totalResults** (Integer) - Total number of results - **itemsPerPage** (Integer) - Number of items returned in this page - **Resources** (Array) - List of group objects #### Response Example { "schemas": [ "urn:ietf:params:scim:api:messages:2.0:ListResponse" ], "startIndex": 1, "totalResults": 3, "itemsPerPage": 3, "Resources": [ { "id": "1234", "displayName": "Administrators", "members": [ { "value": 1, "display": "user1@example.com" }, { "value": 2, "display": "user2@example.com" } ], "meta": { "location": "http://localhost:8080/api/scim/v2/Groups/group-1", "created": "2023-08-04T08:38:02.3732123Z" } } ] } ``` -------------------------------- ### GET /api/scim/v2/Groups/{id} Source: https://docs.dronahq.com/reference/scim-2-rest-api/groups/get-group Retrieve a Group by ID. ```APIDOC ## GET /api/scim/v2/Groups/{id} ### Description Retrieve a Group by ID. ### Method GET ### Endpoint /api/scim/v2/Groups/{id} ### Parameters #### Path Parameters - **id** (string) - Required - Group ID to retrieve the specific group. ### Request Example curl --location 'http://localhost:8080/api/scim/v2/Groups/group-123' \ --header 'Accept: application/json' \ --header 'Authorization: Bearer XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX' ### Response #### Success Response (200) - **id** (string) - Group ID - **displayName** (string) - Group name - **members** (array) - List of group members - **meta** (object) - Metadata including location and creation timestamp #### Response Example { "id": "123", "displayName": "Developers", "members": [ { "value": 1, "display": "user1@example.com" }, { "value": 2, "display": "user2@example.com" } ], "meta": { "location": "http://localhost:8080/api/scim/v2/Groups/group-123", "created": "2023-08-04T08:38:02.3732123Z" } } ``` -------------------------------- ### Accessing Webhook Data in Instructions Source: https://docs.dronahq.com/agents/triggers/inbuilt-triggers/webhook Demonstrates how to reference body fields and normalized headers within agent instructions. ```text When a webhook is received, extract the user's email from {{body.email}} and their order ID from {{body.order_id}}. Check the content type from {{headers.content_type}}. Use the Gmail tool to send a confirmation email to the user about their order. ``` -------------------------------- ### Configure Containerd Service Source: https://docs.dronahq.com/self-hosted-deployment/deploy-kubernetes-on-macos Download the systemd unit file and move it to the system directory. ```bash curl -LO https://license.dronahq.com/self-hosted/master/init/containerd.service sudo mkdir -p /usr/lib/systemd/system sudo mv containerd.service /usr/lib/systemd/system/ ``` -------------------------------- ### $substring Source: https://docs.dronahq.com/reference/dronahq-query-language/dql-function-reference Returns a substring of a string starting at a specific index. ```APIDOC ## $substring ### Description Returns a substring of a string starting at $start and with length $length (if provided). ### Signature `$substring($str: string, $start: number, $length?: number) => string` ### Example `$substring("hello world", 0, 5) -> "hello"` ``` -------------------------------- ### SSH Connection Response Examples Source: https://docs.dronahq.com/self-hosted-deployment/deployment-options/gcp Expected terminal output when connecting to a new host and verifying the connection. ```text The authenticity of host '34.105.89.192 (34.105.89.192)' can't be established. ED25519 key fingerprint is SHA256:gdEtnJ+kLJ1MzPnfCJNfdrstN5xb6s01lLlU1Xtz62g. This key is not known by any other names Are you sure you want to continue connecting (yes/no/[fingerprint])? ``` ```text Warning: Permanently added '34.105.89.192' (ED25519) to the list of known hosts. ``` -------------------------------- ### Install Weave networking Source: https://docs.dronahq.com/self-hosted-deployment/deploy-kubernetes-on-macos Applies the Weave CNI plugin manifest to the cluster. ```bash kubectl apply -f "https://github.com/weaveworks/weave/releases/download/v2.8.1/weave-daemonset-k8s-1.11.yaml" ``` -------------------------------- ### Common Cron Examples Source: https://docs.dronahq.com/agents/triggers/inbuilt-triggers/scheduler Predefined Cron expressions for frequent scheduling requirements. ```text */2 * * * ? ``` ```text 30 9 * * ? ``` ```text 0 9 ? * MON,WED,FRI ``` ```text 0 0 1 * ? ``` ```text 30 9 ? 1-9 MON-FRI ``` -------------------------------- ### Configure ChatGPT Desktop MCP Server Source: https://docs.dronahq.com/mcp%20server/exposing-mcp-to-ai-agents Add the MCP server configuration to the ~/.chatgpt/mcp.json file. ```json { "mcpServers": { "myCustomServer": { "url": "https://mcp.example.com/sse/my-server", "headers": { "Authorization": "Bearer " } } } } ``` -------------------------------- ### Implement a Custom Control with JavaScript Source: https://docs.dronahq.com/reference/controls/custom-control This example demonstrates a complete HTML/JS structure for a custom input control, including lifecycle callbacks and validation logic. ```html

Input

``` -------------------------------- ### Get Timezone Offset Source: https://docs.dronahq.com/reference/keywords-js-utilities/fx-formulas Returns the device's timezone offset in milliseconds. ```text TIMEOFFSET() ``` -------------------------------- ### Example product ratings dataset Source: https://docs.dronahq.com/reference/controls/rating Sample JSON structure representing product ratings fetched from a database. ```json [ { "product_name": "Product A", "rating": 4 }, { "product_name": "Product B", "rating": 3 }, { "product_name": "Product C", "rating": 5 }, { "product_name": "Product D", "rating": 4 } ] ``` -------------------------------- ### Get Key Value Source: https://docs.dronahq.com/reference/keywords-js-utilities/Helper Retrieves the value associated with a specific key from an object. ```javascript HELPER.GETKEYVALUE(object,key); ``` ```javascript HELPER.GETKEYVALUE( { "key1": "DRONA", "key2": "HQ", "key3": "WELCOMES", "key4": "YOU" },"key1"); ``` -------------------------------- ### Stop and Start Virtual Machines Source: https://docs.dronahq.com/self-hosted-deployment/deploy-kubernetes-on-macos Commands to manage the power state of the control plane and worker nodes. ```bash multipass stop kubeworker01 multipass stop kubeworker02 multipass stop kubemaster ``` ```bash multipass start kubemaster # Wait 30 sec or so multipass start kubeworker01 multipass start kubeworker02 ```