DWM3001CDK ranging with iPhone without Bluetooth connection

Hi there

I am testing nearby interaction app with DWM3001CDK and iPhone.
It seems to require Bluetooth connection between DWM3001CDK and iPhone.
If Bluetooth is disconnected, they fail to measure the distance.

When measuring the distance between CDK devices, up to 150m is measured, but when measuring the distance between the iPhone and the CDK device, only about 30m is measured.

I think this is because Bluetooth paring is disconnected.

Is there any way to measure the distance even if Bluetooth connection is disconnected in nearby interaction with iPhone?


Hi @jiwoong !
Stopping UWB Two-Way Ranging is the default behavior on both sides, iOS and Qorvo devices, however, BLE is not required after starting ranging.
You can keep the UWB TWR when the BLE connection is dropped, but you have to plan how to handle timeout issues and implement it in these functions according to what you defined as the default behavior.

On the firmware side, it happens in \Src\Comm\Src\BLE\ble.c, ble_evt_handler().
I think timeout events (BLE_GATTC_EVT_TIMEOUT and BLE_GATTS_EVT_TIMEOUT) will lead to disconnection and then the BLE_GAP_EVT_DISCONNECTED will happen, there ble_evt_disconnected_handler() is called, which calls niq_stop_uwb().

On the iOS side, it happens in \NINearbyAccessorySample\QorvoDemoViewController.swift, accessoryDisconnected().
It is the BLE disconnection handler and the default action is to invalidate the NI Session related to the device disconnected.

Hope it gives you a starting point!
Kind regards!

1 Like

Hello @carlos.silva.

I have a question related to this topic.
I have a problem with random disconnection between DWM3001CDK and iPhone which uses a nearby interaction app.

Connection is often disconnected suddenly. At this time, one of the LED light on the CDK is turned off which means disconnection, and CDK’s distance information or device name itself is disappeared from connected accessories list on app.
If I try to reconnect to the CDK on the app, CDK works again.

Does this random disconnection issue also relate to timeout events on the firmware side?
And could you please tell me where can I find the file below that you mentioned at the last answer and how can I edit the firmware by myself?

On the firmware side, it happens in \Src\Comm\Src\BLE\ble.c, ble_evt_handler().

Best regards.

Hi @yuki5a4n !

We had an issue like this in the first version, and yes, it was related to timeout.
It was two connection parameters that didn’t match iPhone parameters (MIN_CONN_INTERVAL and MAX_CONN_INTERVAL I guess), the iPhone was requesting Connection Parameters Update three times and then disconnecting, you can check if this is your issue by measuring the time between connecting and disconnecting, the whole process takes exactly 90 seconds.

It was fixed in the most recent versions. If you’re using an old version, please download the newer from the Evaluation Tools tab on the DWM3001CDK or DWM3000EVB products page (if you’re using DWM3001CDK):

If you wanna play with BLE timeout, they are set in \Src\Comm\Src\BLE\ble.c as mentioned:

The description for each is in the code comments.
ble_evt_handler() is regarding that specific issue, but if you search for “timeout” in the code you will find more timeout actions for different BLE connection steps.

Kind regards!

Hello @carlos.silva,

I cannot seem to find the files and parameters you mentioned in your previous posts, probably because I am using v3.1. Could you please update your answer and explain how to drop Bluetooth connections after exchanging credentials and perform UWB ranging without Bluetooth on the iPhone? Also, is it possible for multiple iPhones to perform UWB ranging with the same tag simultaneously? I suppose dropping Bluetooth connections should make this possible but I am not sure if the DWM3001CDK is capable of maintaining multiple UWB sessions at the same time. I am looking forward to your soonest reply. Thank you!

Best regards,

Hi @yerke5 !

Are you using QNI 3.1.0? If yes, all I mentioned above can be applied, use Ctrl+Shift+F on Segger Embedded Studio to search the function names.

Unfortunately, the MAC layer in the current version is not capable of running multiple sessions on the device side.

Kind regards!

Thanks a lot for your reply! It was very helpful. I downloaded the latest version and found ble.c there.

1 Like

Hi! I stumbled across this topic when I tried to keep the UWB session running after Bluetooth disconnection. @carlos.silva, are you sure that the iOS Nearby Interaction framework allows the NI session to run after the associated Bluetooth peer disconnects?

I modified the default behavior of my iOS app to stop calling the invalidate() function on my NI session. However, it seems the NI framework invalidates the session with the NI didInvalidate callback and the following error:

NIError.Code.accessoryPeerDeviceUnavailable | Apple Developer Documentation (NI error)

I want to highlight here that I am using the new iOS 16+ API for passing NI Accessory configuration, which also requires Bluetooth peer identifier as a second parameter:

init(accessoryData:bluetoothPeerIdentifier:) | Apple Developer Documentation (NI Accessory Configuration constructor with Bluetooth peer identifier)

Is there any way to work around this automatic invalidation on the iOS side?

I believe the NI session requires the BT connection to continue being active… the Accessory (cdk, or whatever) would need to send a Stop message at least…