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.
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().
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): https://www.qorvo.com/products/p/DWM3001CDK#evaluation-tools
If you wanna play with BLE timeout, they are set in \Src\Comm\Src\BLE\ble.c as mentioned:
APP_ADV_DURATION
MIN_CONN_INTERVAL
MAX_CONN_INTERVAL
CONN_SUP_TIMEOUT
FIRST_CONN_PARAMS_UPDATE_DELAY
NEXT_CONN_PARAMS_UPDATE_DELAY
MAX_CONN_PARAMS_UPDATE_COUNT
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.
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!
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:
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:
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…
I’m quite late here, but to maybe help you or someone looking at this topic in the future:
BLE is required for NI background sessions, this is the way that the NI framework validates the remote device and keeps the UWB active.
Regular NI sessions don’t require BLE to be connected. Actually, BLE is not required at all if you have another way to exchange the OOB info, Wi-Fi for example.