Hello.
I’m working on a UWB sample app.
However, it was difficult to ascertain why it did not work, so I wrote to get advice.
Any advice please.
Thanks.
- uwb settings
- fixed data
- vendor_id : [7, 8]
- static_sts_iv : [1, 2, 3, 4, 5, 6]
- variables
- Mobile address : B3-80
- Device address : 02-C9
- channel : 9
- preambleIndex : 10 (Depends on mobile env.)
- session id : 1763735330
- DWM3000EVB code about uwb settings
// construct_fira_param_from_config() in main_uwb.c
// vendor_id : 0x7, 0x8
// sts_iv : 0x1,0x2,0x3,0x4,0x5,0x6
config->Static_STS_IV[0] = 1;
config->Static_STS_IV[1] = 2;
config->Static_STS_IV[2] = 3;
config->Static_STS_IV[3] = 4;
config->Static_STS_IV[4] = 5;
config->Static_STS_IV[5] = 6;
config->Vendor_ID[0] = 7;
config->Vendor_ID[1] = 8;
fira_param->session.vupper64[7] = config->Vendor_ID[0];
fira_param->session.vupper64[6] = config->Vendor_ID[1];
fira_param->session.vupper64[5] = config->Static_STS_IV[0];
fira_param->session.vupper64[4] = config->Static_STS_IV[1];
fira_param->session.vupper64[3] = config->Static_STS_IV[2];
fira_param->session.vupper64[2] = config->Static_STS_IV[3];
fira_param->session.vupper64[1] = config->Static_STS_IV[4];
fira_param->session.vupper64[0] = config->Static_STS_IV[5];
- Android Mobile some code
suspend fun startRanging() {
// ...
// Create the ranging parameters.
val partnerParameters = RangingParameters(
uwbConfigType = UwbRangingParamters.UWB_CONFIG_ID_1,
sessionId = id, // this value : 1763735330
sessionKeyInfo = keyInfo, // this value : [7, 8, 1, 2, 3, 4, 5, 6]
complexChannel = channel, // this value : channel : 9, preamble_code_index : 10
peerDevices = listOf(device), // this value : [0x02, 0xC9]
updateRateType = UwbRangingParamters.RANGING_UPDATE_RATE_AUTOMATIC
)
// Initiate a session that will be valid for a single ranging session.
val clientSession = uwbManager.clientSessionScope()
// Share the localAddress of the current session to the partner device.
broadcastMyParameters(clientSession.localAddress)
val sessionFlow = clientSession.prepareSession(partnerParameters)
// Start a coroutine scope that initiates ranging.
CoroutineScope(Dispatchers.Main.immediate).launch {
sessionFlow.collect {
when(it) {
is RangingResultPosition -> doSomethingWithPosition(it.position)
is RangingResultPeerDisconnected -> peerDisconnected(it)
}
}
}
}
- DWM3000EVB logs
Application: Nearby Interaction Beta
Target: DWM3000EVB + nRF52840DK
OS: FreeRTOS
Version: 1.0.0-230126
DW3XXX Device Driver Version 06.00.00
MAC: R8.2.3_E
ACCESSORY_RANGING_ROLE: Responder
<info> app: Fast advertising.
<info> app: Connected
<info> app: Notification is enabled
<info> app: handle_new_data: len1=1,len=3, data=0a-
<info> app: App requests accessory config data
<info> app: send_ble_data: len1=36,len=108, data=01-01-00-00-00-14-00-00-00-00-00-00-00-00-00-00-13-01-00-00-00-3f-f5-03-00-b8-0b-00-00-01-09-09-00-00-02-c9-
<info> app: handle_new_data: len1=29,len=87, data=0b-01-00-00-00-17-4b-52-22-77-20-69-0a-09-06-00-60-09-f0-00-03-06-05-04-03-02-01-b3-80-
<info> app: send_ble_data: len1=1,len=3, data=02-
<info> app: Running construct_fira_param_from_config
<info> app: >>> src: 51458 >> 0x02c9,sid: 1763735330 >> 1763735330,initiation_time_ms: 5 >> 5,
dst: 32947 >> 0xb380,VID:0708 SID:010203040506,chn: 9,pream: 10
{"TWR": {"R":1,"a16":"0x80b3","S":"ERR","D cm":0}}
{"TWR": {"R":2,"a16":"0x80b3","S":"ERR","D cm":0}}
{"TWR": {"R":3,"a16":"0x80b3","S":"ERR","D cm":0}}
{"TWR": {"R":4,"a16":"0x80b3","S":"ERR","D cm":0}}
{"TWR": {"R":5,"a16":"0x80b3","S":"ERR","D cm":0}}
{"TWR": {"R":6,"a16":"0x80b3","S":"ERR","D cm":0}}
{"TWR": {"R":7,"a16":"0x80b3","S":"ERR","D cm":0}}
{"TWR": {"R":8,"a16":"0x80b3","S":"ERR","D cm":0}}
- Android Mobile logs
//... uwb parameter
03:01:39.569 18696-16723 NearbyUWB I Add UWB peer: 0X02C9 [CONTEXT service_id=49 ]
03:01:39.569 18696-16723 NearbyUWB I UWB Ranging Device start ranging [CONTEXT service_id=49 ]
03:01:39.569 18696-16723 NearbyUWB I Local UWB address is 0XB380 [CONTEXT service_id=49 ]
03:01:39.570 18696-16723 NearbyUWB I Opens UWB session with bundle parameters: [CONTEXT service_id=49 ]
03:01:39.570 18696-16723 NearbyUWB I UWB parameter: aoa_result_request, value: 1 [CONTEXT service_id=49 ]
03:01:39.570 18696-16723 NearbyUWB I UWB parameter: range_data_ntf_proximity_near, value: 0 [CONTEXT service_id=49 ]
03:01:39.571 18696-16723 NearbyUWB I UWB parameter: is_tx_adaptive_payload_power_enabled, value: false [CONTEXT service_id=49 ]
03:01:39.571 18696-16723 NearbyUWB I UWB parameter: rframe_config, value: 3 [CONTEXT service_id=49 ]
03:01:39.571 18696-16723 NearbyUWB I UWB parameter: max_ranging_round_retries, value: 0 [CONTEXT service_id=49 ]
03:01:39.571 18696-16723 NearbyUWB I UWB parameter: psdu_data_rate, value: 0 [CONTEXT service_id=49 ]
03:01:39.571 18696-16723 NearbyUWB I UWB parameter: fcs_type, value: 0 [CONTEXT service_id=49 ]
03:01:39.571 18696-16723 NearbyUWB I UWB parameter: device_role, value: 1 [CONTEXT service_id=49 ]
03:01:39.571 18696-16723 NearbyUWB I UWB parameter: device_type, value: 1 [CONTEXT service_id=49 ]
03:01:39.571 18696-16723 NearbyUWB I UWB parameter: block_stride_length, value: 0 [CONTEXT service_id=49 ]
03:01:39.571 18696-16723 NearbyUWB I UWB parameter: prf_mode, value: 0 [CONTEXT service_id=49 ]
03:01:39.572 18696-16723 NearbyUWB I UWB parameter: slot_duration_rstu, value: 2400 [CONTEXT service_id=49 ]
03:01:39.572 18696-16723 NearbyUWB I UWB parameter: protocol_version, value: 1.1 [CONTEXT service_id=49 ]
03:01:39.572 18696-16723 NearbyUWB I UWB parameter: slots_per_ranging_round, value: 6 [CONTEXT service_id=49 ]
03:01:39.572 18696-16723 NearbyUWB I UWB parameter: vendor_id, value: [7, 8] [CONTEXT service_id=49 ]
03:01:39.572 18696-16723 NearbyUWB I UWB parameter: ranging_interval_ms, value: 240 [CONTEXT service_id=49 ]
03:01:39.572 18696-16723 NearbyUWB I UWB parameter: dest_address_list, value: [200691658394697728] [CONTEXT service_id=49 ]
03:01:39.572 18696-16723 NearbyUWB I UWB parameter: sfd_id, value: 2 [CONTEXT service_id=49 ]
03:01:39.572 18696-16723 NearbyUWB I UWB parameter: num_of_msrmt_focus_on_range, value: 0 [CONTEXT service_id=49 ]
03:01:39.572 18696-16723 NearbyUWB I UWB parameter: channel_number, value: 9 [CONTEXT service_id=49 ]
03:01:39.572 18696-16723 NearbyUWB I UWB parameter: session_priority, value: 50 [CONTEXT service_id=49 ]
03:01:39.572 18696-16723 NearbyUWB I UWB parameter: is_key_rotation_enabled, value: false [CONTEXT service_id=49 ]
03:01:39.572 18696-16723 NearbyUWB I UWB parameter: sts_config, value: 0 [CONTEXT service_id=49 ]
03:01:39.572 18696-16723 NearbyUWB I UWB parameter: num_of_msrmt_focus_on_aoa_elevation, value: 0 [CONTEXT service_id=49 ]
03:01:39.572 18696-16723 NearbyUWB I UWB parameter: in_band_termination_attempt_count, value: 3 [CONTEXT service_id=49 ]
03:01:39.572 18696-16723 NearbyUWB I UWB parameter: range_data_ntf_proximity_far, value: 20000 [CONTEXT service_id=49 ]
03:01:39.572 18696-16723 NearbyUWB I UWB parameter: bprf_phr_data_rate, value: 0 [CONTEXT service_id=49 ]
03:01:39.572 18696-16723 NearbyUWB I UWB parameter: sts_length, value: 1 [CONTEXT service_id=49 ]
03:01:39.572 18696-16723 NearbyUWB I UWB parameter: initiation_time_ms, value: 0 [CONTEXT service_id=49 ]
03:01:39.572 18696-16723 NearbyUWB I UWB parameter: aoa_type, value: 0 [CONTEXT service_id=49 ]
03:01:39.572 18696-16723 NearbyUWB I UWB parameter: has_time_of_flight_report, value: true [CONTEXT service_id=49 ]
03:01:39.572 18696-16723 NearbyUWB I UWB parameter: has_angle_of_arrival_figure_of_merit_report, value: false [CONTEXT service_id=49 ]
03:01:39.572 18696-16723 NearbyUWB I UWB parameter: has_angle_of_arrival_azimuth_report, value: false [CONTEXT service_id=49 ]
03:01:39.572 18696-16723 NearbyUWB I UWB parameter: mac_address_mode, value: 0 [CONTEXT service_id=49 ]
03:01:39.572 18696-16723 NearbyUWB I UWB parameter: preamble_duration, value: 1 [CONTEXT service_id=49 ]
03:01:39.572 18696-16723 NearbyUWB I UWB parameter: key_rotation_rate, value: 0 [CONTEXT service_id=49 ]
03:01:39.572 18696-16723 NearbyUWB I UWB parameter: bundle_version, value: 1 [CONTEXT service_id=49 ]
03:01:39.572 18696-16723 NearbyUWB I UWB parameter: has_angle_of_arrival_elevation_report, value: false [CONTEXT service_id=49 ]
03:01:39.573 18696-16723 NearbyUWB I UWB parameter: static_sts_iv, value: [1, 2, 3, 4, 5, 6] [CONTEXT service_id=49 ]
03:01:39.573 18696-16723 NearbyUWB I UWB parameter: range_data_ntf_config, value: 1 [CONTEXT service_id=49 ]
03:01:39.573 18696-16723 NearbyUWB I UWB parameter: ranging_round_usage, value: 2 [CONTEXT service_id=49 ]
03:01:39.573 18696-16723 NearbyUWB I UWB parameter: protocol_name, value: fira [CONTEXT service_id=49 ]
03:01:39.573 18696-16723 NearbyUWB I UWB parameter: has_result_report_phase, value: true [CONTEXT service_id=49 ]
03:01:39.573 18696-16723 NearbyUWB I UWB parameter: device_address, value: -5512405943901487104 [CONTEXT service_id=49 ]
03:01:39.573 18696-16723 NearbyUWB I UWB parameter: measurement_report_type, value: 0 [CONTEXT service_id=49 ]
03:01:39.573 18696-16723 NearbyUWB I UWB parameter: preamble_code_index, value: 10 [CONTEXT service_id=49 ]
03:01:39.573 18696-16723 NearbyUWB I UWB parameter: session_id, value: 1763735330 [CONTEXT service_id=49 ]
03:01:39.573 18696-16723 NearbyUWB I UWB parameter: multi_node_mode, value: 0 [CONTEXT service_id=49 ]
03:01:39.573 18696-16723 NearbyUWB I UWB parameter: num_of_msrmt_focus_on_aoa_azimuth, value: 0 [CONTEXT service_id=49 ]
03:01:39.573 18696-16723 NearbyUWB I UWB parameter: hopping_mode, value: 0 [CONTEXT service_id=49 ]
03:01:39.573 18696-16723 NearbyUWB I UWB parameter: sts_segment_count, value: 1 [CONTEXT service_id=49 ]
03:01:39.573 18696-16723 NearbyUWB I exec UWB operation Open session [CONTEXT service_id=49 ]
03:01:39.576 3022-9799 UwbAospAdapterService E call addToNonPrivilegedUidToFiraSessionTableIfNecessary
03:01:39.577 3022-9799 UWB I UwbAdapter: openSession is invoked
03:01:39.577 3022-9799 UWB I UwbAdapter: defaultConfig is null
03:01:39.578 1492-2430 SecContentProvider D query(), uri = 30 selection = isUWBAllowed
03:01:39.578 1492-2430 SecContentProvider D called from android.uid.uwb:1083
03:01:39.579 3022-9799 UwbSessionManager I sessionInit() - Session ID : 1763735330, Service Type : 0
//...
//... range data
3:01:39.633 3022-3425 UwbJni I notifySessionStateNotification: enter; session ID=69207722, State = 2 reasonCode = 0
03:01:39.633 3022-3425 UwbSessionManager I onSessionStatusNotificationReceived - Session ID : 1763735330, state : 2 reasonCode:0
03:01:39.634 3022-9799 UwbSessionNotiManager I IUwbRangingCallbacks - onRangingStarted
03:01:39.634 3022-3425 UwbBigdataManager I Feature : TIMESET ID : 1763735330 State : 2
03:01:39.634 3022-3425 UwbSessionNotiManager I Send session status 2 to system
03:01:39.635 2597-2597 wpa_sslib I oem_data_cmd=14
03:01:39.635 2597-2597 wpa_sslib I UWB COEX=1
03:01:39.635 2597-2597 wpa_sslib E Invalid uwb channel 0
03:01:39.635 2597-2597 wpa_supplicant E wpa_driver_nl80211_driver_cmd: failed to issue private commands
03:01:39.635 1492-2518 SemSupplicantStaIfaceHalHidlImpl E ISehSupplicantStaIface.setExtendedCommand failed: {.code = FAILURE_UNKNOWN, .debugMessage = -1}
03:01:39.635 1492-2518 SemWifiCoexManager D setWifiUwbCoexEnabled - enable = true ch = 9 result = 2
03:01:39.635 3022-3425 UwbJni I notifySessionStateNotification: exit
03:01:39.635 3022-3425 UwbUciCore I uwb_ucif_process_event enter gid:0x62 status:0x0
03:01:39.635 3022-3425 UwbUciCore I uwb_ucif_process_event: UWB received ntf gid:2
03:01:39.635 3022-3425 UwbUciCore I uwb_ucif_proc_ranging_data: ranging_measures_length = 16 range_data_ntf_len = 76
03:01:39.635 3022-3425 UwbUciCore I uwa_dm_uwb_response_cback:UWB_VENDOR_SPECIfIC_UCI_NTF_EVT(0x401d)
03:01:39.635 3022-3425 UwbJni I uwaDeviceManagementCallback: enter; event=0x1D
03:01:39.635 3022-3425 UwbJni I uwaDeviceManagementCallback: UWA_VENDOR_SPECIfIC_UCI_NTF_EVT
03:01:39.635 3022-3425 UwbExtNotificationHandler I handleRangeDataNotification rangeData = 000000002277206900F0000000010000000000000000000001C9022100FFFF000000000000000000000000020000000000000000000000000E000700000000000000000102000000
03:01:39.635 3022-3425 UwbExtNotificationHandler I handleRangeDataNotification vendorInfoLen = 7 vendorspecificlength= 14
03:01:39.635 3022-3425 UwbJni I onVendorUciNotificationReceived: exit
03:01:39.635 3022-3425 UwbUciCore I uwa_dm_uwb_response_cback:UWB_RANGE_DATA_REVT(0x4011)
03:01:39.635 3022-3425 UwbJni I uwaDeviceManagementCallback: enter; event=0x14
03:01:39.635 3022-3425 UwbJni I uwaDeviceManagementCallback: UWA_DM_RANGE_DATA_NTF_EVT
03:01:39.635 3022-3425 UwbJni I notifyRangeDataNotification: Enter
03:01:39.636 3022-3425 UwbJni I onRangeDataNotificationReceived: ranging_measure_type = MEASUREMENT_TYPE_TWOWAY
03:01:39.636 3022-3425 UwbJni I onRangeDataNotificationReceived: exit
03:01:39.636 1168-3801 vendor.qti.bluet...@1.0-ibs_handler I ProcessIbsCmd: Received IBS_SLEEP_IND: 0xFE
03:01:39.637 1203-4173 sensors-hal I handle_indication_realtime:471, SCHED_FIFO(10) for qmi_cbk
03:01:39.637 1203-4176 sensors-hal I handle_indication_realtime:471, SCHED_FIFO(10) for qmi_cbk
03:01:39.638 18696-18779 NearbyUWB I UWB ranging started [CONTEXT service_id=49 ]
03:01:39.639 1168-3801 vendor.qti.bluet...@1.0-ibs_handler I ProcessIbsCmd: Received IBS_WAKE_IND: 0xFD
03:01:39.639 1168-3801 vendor.qti.bluet...@1.0-ibs_handler I ProcessIbsCmd: Writing IBS_WAKE_ACK
03:01:39.640 2887-3841 bt_stack I [INFO:bta_gattc_main.cc(314)] bta_gattc_sm_execute: State 0x02, Event 0x1f0f
03:01:39.641 2887-3138 BtGatt.GattService D onWriteCharacteristic() - increasing permit for address=E74BE1_1
03:01:39.641 2887-3138 BtGatt.GattService D onWriteCharacteristic() - address=E74BE1_1, status=0
03:01:39.641 18696-18779 NearbyUWB I Local UWB address is 0XB380 [CONTEXT service_id=49 ]
03:01:39.641 4006-4006 BlinkyManagerImpl I Data written to 6e400002-b5a3-f393-e0a9-e50e24dcca9e
03:01:39.642 18696-18779 NearbyUWB I Local UWB address is 0XB380 [CONTEXT service_id=49 ]
03:01:39.644 18696-31264 NearbyUWB I UWB Ranging Data from peer 0X02C9 Status 1 [CONTEXT service_id=49 ]
03:01:39.645 4006-4006 BlinkyManagerImpl I Notification received from 6e400003-b5a3-f393-e0a9-e50e24dcca9e, value: (0x) 02
03:01:39.647 4006-4006 UwbClientSessionScope I Started UWB ranging.
03:01:39.647 4006-4006 Tx2Callback D received:data=1
03:01:39.647 4006-4006 BlinkyManager D tx2Callback.onTxChanged:(0x) 02
03:01:39.647 4006-4006 BlinkyManager D parseNi:data=(0x) 02
03:01:39.647 4006-4006 BlinkyManagerImpl I NiMsgId.ACCESSORY_UWB_DID_START
03:01:39.679 1168-3801 vendor.qti.bluet...@1.0-ibs_handler I ProcessIbsCmd: Received IBS_SLEEP_IND: 0xFE
03:01:39.701 1203-4176 sensors-hal I handle_sns_client_event:630, [0][0] gyro_sample_cal(3) [-0.001, 0.001,-0.000] 221798448103956
03:01:39.725 1492-1492 GestureDetector I handleMessage TAP
03:01:39.726 1492-1617 GestureDetector I handleMessage TAP
03:01:39.739 1203-3560 sensors-hal I handle_sns_client_event:540, [0][416] accel_sample [-1.764, -0.027, 9.660] 221798487041873
03:01:39.750 1203-4165 sensors-hal I handle_indication_realtime:471, SCHED_FIFO(10) for qmi_cbk
03:01:39.801 4006-4035 System W A resource failed to call close.
03:01:39.853 3022-3425 UwbUciCore I uwb_ucif_process_event enter gid:0x62 status:0x1
03:01:39.853 3022-3425 UwbUciCore I uwb_ucif_process_event: UWB received ntf gid:2
03:01:39.853 3022-3425 UwbUciCore I uwb_ucif_proc_ranging_data: ranging_measures_length = 16 range_data_ntf_len = 76
03:01:39.853 3022-3425 UwbUciCore I uwa_dm_uwb_response_cback:UWB_VENDOR_SPECIfIC_UCI_NTF_EVT(0x401d)
03:01:39.853 3022-3425 UwbJni I uwaDeviceManagementCallback: enter; event=0x1D
03:01:39.853 3022-3425 UwbJni I uwaDeviceManagementCallback: UWA_VENDOR_SPECIfIC_UCI_NTF_EVT
03:01:39.853 3022-3425 UwbExtNotificationHandler I handleRangeDataNotification rangeData = 010000002277206900F0000000010000000000000000000001C9022100FFFF000000000000000000000000020000000000000000000000000E000700000000000000000102000000
03:01:39.853 3022-3425 UwbExtNotificationHandler I handleRangeDataNotification vendorInfoLen = 7 vendorspecificlength= 14
03:01:39.853 3022-3425 UwbJni I onVendorUciNotificationReceived: exit
03:01:39.853 3022-3425 UwbUciCore I uwa_dm_uwb_response_cback:UWB_RANGE_DATA_REVT(0x4011)
03:01:39.853 3022-3425 UwbJni I uwaDeviceManagementCallback: enter; event=0x14
03:01:39.853 3022-3425 UwbJni I uwaDeviceManagementCallback: UWA_DM_RANGE_DATA_NTF_EVT
03:01:39.853 3022-3425 UwbJni I notifyRangeDataNotification: Enter
03:01:39.853 3022-3425 UwbJni I onRangeDataNotificationReceived: ranging_measure_type = MEASUREMENT_TYPE_TWOWAY
03:01:39.853 3022-3425 UwbJni I onRangeDataNotificationReceived: exit
03:01:39.856 18696-31264 NearbyUWB I UWB Ranging Data from peer 0X02C9 Status 1 [CONTEXT service_id=49 ]
//