This repository contains basic code required to do ranging between the Qorvo DWM3001CDK and an Android phone. There is no Bluetooth implementation, out-of-band communication is done manually and the DWM3001CDK needs to be connected to a computer via USB to start ranging.
The android_app directory contains a simple UWB project that is capable of starting and stopping a ranging session and displaying the resulting data.
Tested on:
- Pixel 8 Pro
- Pixel 9 Pro
The new_python_script directory contains a copy of the script found in the DW3_QM33_SDK_1.0.2.zip archive provided by Qorvo. It is modified slightly to work with the Android app. The modifications are listed below:
--ranging-spandefault changed to 120 to match Android config--macand--dest-macparameters modified to accept the MAC address in the formatXX:XX--en-rssidefault changed to True to match Android config--preabmle-idxdefault changed to 9 to match Android config--slots-per-rrdefault changed to 6 to match Android config--hopping-modedefault changed toenabledto match Android config
The Python script uses the new UCI firmware from the above archive, a copy is also provided in the new_firmware directory.
To setup the environment:
- Install the Android app (.apk provided in releases)
- Flash the firmware using J-Link and connect the module to the PC using the other USB port
- [OPTIONAL] create and activate a virtual environment in the
new_python_scriptdirectory. - Install the python requirements using
pip install -r requirements.txt
To perform a ranging session:
- Open the Android app, select if you want the phone to be a controller or controlee (with this new firmware, the ranging appears to work reliably with both options)
- Press the
Prepare sessionbutton to get the phone's local address - Launch
run_fira_twr.py, use the correct port for-pand the address from the previous step for--dest-mac, optionally use the--controleeflag
python run_fira_twr.py -p <COMX> --mac 00:00 --dest-mac <XX:XX> [--controlee]- Press
Start rangingon the phone
This section refers to the old firmware that is no longer available from Qorvo.
It is found in the firmware directory and can be used with the script in the python_script directory.
The python_script directory contains a copy of the script found in the DWM3001CDK DK Software, Sources, Tools and Developer Guide.zip archive provided by Qorvo. It is modified slightly to work with Android. The modifications are listed below:
App.RangingIntervalis set to 120 to match Android configApp.SlotsPerRris set to 6 to match Android configApp.HoppingModeis set to 1 to match Android config- Added command line parameters
addressandtargetto set the local and target MAC address from the command line. The input format is XX:XX. Note that the script reverses the byte order, because the Python library accepts the address as a value instead of an array.
The Python script uses UCI firmware from the above archive, a copy is also provided in the firmware directory.
To setup the environment:
- Install the Android app (.apk provided in releases)
- Flash the firmware using J-Link and connect the module to the PC using the other USB port
- [OPTIONAL] create and activate a virtual environment in the
python_scriptdirectory. - Install the python requirements using
pip install -r requirements.txt
To perform a ranging session:
- Open the Android app, select if you want the phone to be a controller or controlee (note that right now, for unknown reasons, the ranging only works reliably if the phone is controlee)
- Press the
Prepare sessionbutton to get the phone's local address - Launch
uci_uart_fira_test.py, use the correct port for-pand the address from the previous step for-t, optionally use the--controleeflag
python uci_uart_fira_test.py -p <COMX> -a 00:00 -t <XX:XX> [--controlee]- Press
Start rangingon the phone