# QCLI sub-group: RTT

Source: [https://docs.qualcomm.com/doc/80-Y8730-2/topic/qcli_sub_group_rtt.html](https://docs.qualcomm.com/doc/80-Y8730-2/topic/qcli_sub_group_rtt.html)

Use the RTT sub-group commands to perform Round-Trip Time (RTT) testing.

The RTT test measures the distance between two devices. For example, Device A sends a packet to Device B (packet 1), receives a response from Device B (packet 2), and measures the total round-trip time. The distance is calculated as `d = RTT × c / 2`, where *c* is the speed of light.

The QCLI RTT commands allow the QCC730 device to:

- Initiate RTT measurement as an FTM initiator in the STA connected state.
- Collect T1, T2, T3, and T4 timestamps through FTM request/response/ACK exchanges.
- Calculate distance using calibration parameters.

The general procedure to run a RTT demo is as follows:

1. Enable Wi‑Fi on the QCC730 device and connect it to an AP.
2. Select **QCLI sub-group: RTT**.
3. Run the following commands:
    1. `rtt_cfg`: Configure RTT test parameters.
    2. `rtt_start`: Start the RTT test.

        Run this command multiple times to collect datasets containing T1, T2, T3, T4 timestamps and first arrival correction (FAC).
4. Save the test logs as `.txt` files.
5. Run the `rtt_cal_script.py` script on the saved logs to perform base delay calibration and generate RTT test results.

## rtt\_cfg

Source: [https://docs.qualcomm.com/doc/80-Y8730-2/topic/qcli_sub_group_rtt.html](https://docs.qualcomm.com/doc/80-Y8730-2/topic/qcli_sub_group_rtt.html)

This command configures the RTT test.

| Parameter name | Type/Range | Description |
| :---: | :---: | :---: |
| ftms | Number | The number of FTM frames per burst.<br><br><br>                            <br>Default value: 4, max value: 8. |
| delta | Number | Minimum delta between FTM frames.<br><br><br>                            <br>Default value: 20, unit: 100 µs. |
| bw | Number | Format and bandwidth.<br><br><br>                            <br>Default value: 0, support 20M 4, 6, 8, 9, 10. |

**Example:**

    rtt_cfg ftms=8 delta=20 bw=8Copy to clipboard

## rtt\_start

Source: [https://docs.qualcomm.com/doc/80-Y8730-2/topic/qcli_sub_group_rtt.html](https://docs.qualcomm.com/doc/80-Y8730-2/topic/qcli_sub_group_rtt.html)

This command starts the RTT test.

**Example:**

    rtt_startCopy to clipboard

## rtt\_status

Source: [https://docs.qualcomm.com/doc/80-Y8730-2/topic/qcli_sub_group_rtt.html](https://docs.qualcomm.com/doc/80-Y8730-2/topic/qcli_sub_group_rtt.html)

This command shows RTT result of last calculation and RTT configurations.

**Example:**

    rtt_statusCopy to clipboard

## set\_base\_delay

Source: [https://docs.qualcomm.com/doc/80-Y8730-2/topic/qcli_sub_group_rtt.html](https://docs.qualcomm.com/doc/80-Y8730-2/topic/qcli_sub_group_rtt.html)

This command shows the RTT result of last calculation and RTT configurations.

Note: Run base delay calibration before running this command. For details about calibrating base delay, see [Calculate RTT results and calibrate base delay](https://docs.qualcomm.com/doc/80-Y8730-2/topic/qcli_sub_group_rtt.html#rtt_cal_script_py)

| Parameter name | Type/Range | Description |
| :---: | :---: | :---: |
| Base delay | Number | Set calibrated base delay. |

**Example:**

    set_base_delay 0Copy to clipboard

## Calculate RTT results and calibrate base delay

Source: [https://docs.qualcomm.com/doc/80-Y8730-2/topic/qcli_sub_group_rtt.html](https://docs.qualcomm.com/doc/80-Y8730-2/topic/qcli_sub_group_rtt.html)

Use the rtt\_cal\_script.py script to calculate RTT results and calibrate the `base_delay` value.

### Calculate RTT results

Follow these steps to calculate RTT results:

1. Perform RTT testing at multiple known distances (for example, 3 m, 6 m, 9 m, and 12 m).
2. Save the RTT logs as `.txt` files. Include the distance at the beginning of the filename (for example, `3m_RTT_2G.txt`).
3. Place the files in the following path: qccsdk\tools\rtt\_tools\
4. Run the `rtt_cal_script.py` script to calculate RTT results. The script uses a default `base_delay` value.

After running the script, an `output.xlsx` file is generated. If the RTT results aren't accurate, you need to calibrate the `base_delay` value and update the value in the `rtt_cal_script.py` script.

### Calibrate and update the `base_delay` value

In the `rtt_cal_script.py` script, the calculation is done by the following code:

    row["rtt"] = abs(row["t4_t1-t3_t2"]-9953353/64)-35085   #2g:35085 5g:33013Copy to clipboard

`35085` is the default `base_delay` for the 2.4 GHz band.

Follow these steps to calibrate the `base_delay` value:

1. Set `base_delay` to `0` in the script, rerun the script, and then calculate the median of the `t4_t1-t3_t2` column for each distance (3 m, 6m, 9m, and 12m).
2. Calculate `base_delay` for each distance:

        base_delay = median − (9953353 / 64) − (real_distance × t)Copy to clipboard

Where:
    - Unit of `median`: ps
    - Unit of `real_distance`: m
    - Unit of `t`: ps/m
        `t = (2 / c) × 10^12`; `c` is the speed of light
3. Select the optimal `base_delay`by taking the average of the maximum and minimum calculated values. Ensure the selected value falls within this range:
    - `base_delay ≥ Max(base_delay) − 1.4 × t`
    - `base_delay ≤ Min(base_delay) + 1.4 × t`

Note: This range for `base_delay` is based on the KPI requirement (CEP90 error range ≤ 1.4 m), to ensure that the error ranges of all distance fall within ± 1.4 m.
4. Replace the default value (for example, `35085`) with the calibrated `base_delay`:

        row["rtt"] = abs(row["t4_t1-t3_t2"] - 9953353/64) - <calibrated_base_delay>Copy to clipboard
5. Apply the calibrated value by using the `set_base_delay` command to update the device with the calibrated `base_delay`.
6. Rerun the `rtt_cal_script.py` script and verify that the diagram in the `output.xlsx` file meets the KPI.

Last Published: Jun 03, 2026

[Previous Topic
QCLI sub-group: SecureFs](https://docs.qualcomm.com/bundle/publicresource/80-Y8730-2/topics/qcli_sub_group_securefs.md) [Next Topic
MQTT demo](https://docs.qualcomm.com/bundle/publicresource/80-Y8730-2/topics/mqtt_demo.md)