What do the acl_disconn_cmpl_stat error codes mean?

InfiniteArray
Posts: 9
Joined: Wed Jun 12, 2024 8:29 am

What do the acl_disconn_cmpl_stat error codes mean?

Postby InfiniteArray » Wed Jun 12, 2024 8:36 am

I am currently debugging an issue while trying to connect an ESP32 with a Meta Quest 3. The pairing is successful, but then is always terminated 3 seconds later. Setting the error log to verbose gives me:

[ 41477][BluetoothSerial.cpp:609] esp_bt_gap_cb(): ESP_BT_GAP_ACL_DISCONN_CMPL_STAT_EVT ACL disconnection complete status event: reason 278, handle 129

According to ChatGTP, reason 278 is 0x116 which stands for "Connection Terminated Due to MIC Failure." however, no such error exists in Espressif's list of error codes https worse yet, 0x116 isn't even a valid error code according to the list.

I have tried plugging "278" into the esp_err_to_name function but all it returns is "ERROR".

What does "ACL disconnection complete status event: reason 278" mean?

Many thanks!
IA

InfiniteArray
Posts: 9
Joined: Wed Jun 12, 2024 8:29 am

Re: What do the acl_disconn_cmpl_stat error codes mean?

Postby InfiniteArray » Thu Jun 13, 2024 2:25 pm

Some additional information, I installed the ESP-IDF and ran the bt_spp_acceptor demo. With that, the output was:

Code: Select all

I (1157) SPP_ACCEPTOR_DEMO: ESP_SPP_INIT_EVT
I (1167) SPP_ACCEPTOR_DEMO: ESP_SPP_START_EVT handle:129 sec_id:55 scn:1
I (1177) SPP_ACCEPTOR_DEMO: event: 10
I (1177) SPP_ACCEPTOR_DEMO: Own address:[08:3a:8d:0d:93:16]
I (1187) main_task: Returned from app_main()
W (27077) BT_HCI: hcif conn complete: hdl 0x81, st 0x0
I (27087) SPP_ACCEPTOR_DEMO: event: 16
W (27087) BT_HCI: hcif link supv_to changed: hdl 0x81, supv_to 8000
I (27367) SPP_ACCEPTOR_DEMO: ESP_BT_GAP_CFM_REQ_EVT Please compare the numeric value: 903415
I (32347) SPP_ACCEPTOR_DEMO: authentication success: Meta Quest 3 bda:[c0:dd:8a:82:a6:c7]
W (36387) BT_HCI: hci cmd send: disconnect: hdl 0x81, rsn:0x13
W (36457) BT_HCI: hcif disc complete: hdl 0x81, rsn 0x16
I (36457) SPP_ACCEPTOR_DEMO: event: 17
We can see that the Meta Quest 3 successfully authenticated, but then shortly after:

Code: Select all

W (36387) BT_HCI: hci cmd send: disconnect: hdl 0x81, rsn:0x13
W (36457) BT_HCI: hcif disc complete: hdl 0x81, rsn 0x16
hdl 0x81 probably stands for handle 0x81 and refers to the connection but what does "rsn: 0x13" stand for?
This also isn't one of the defined ESP32 error codes.

InfiniteArray
Posts: 9
Joined: Wed Jun 12, 2024 8:29 am

Re: What do the acl_disconn_cmpl_stat error codes mean?

Postby InfiniteArray » Thu Jun 13, 2024 2:34 pm

Sorry for double-post but ChatGTP served up the answer:
0x13 is from the Bluetooth Specification and indicates that the remote user terminated the connection.

At this point I am led to conclude that it is not the ESP32 that is disconnecting but the Quest 3. The 0x119 may also be related to Bluetooth rather than espressif, though the Bluetooth Core spec does not mention it.

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 30 guests