Bluetooth connection lost after pairing

chucrut
Posts: 15
Joined: Tue Oct 18, 2022 10:04 pm

Bluetooth connection lost after pairing

Postby chucrut » Thu Jun 15, 2023 3:36 pm

I'm trying to run the Classic Bluetooth "acceptor" example:
https://github.com/espressif/esp-idf/tr ... p_acceptor
With the same sdkconfig configuration settings as the example

I turn on the bluetooth in the phone. I select the ESP32 device.

Then pop up a window with the pairing number:
Image
At the same time this windows pops up, in the terminal i receive the following message:
W (162921) BT_HCI: hcif conn complete: hdl 0x80, st 0x0
W (162940) BT_HCI: hcif link supv_to changed: hdl 0x80, supv_to 8000


As soon as I pair the devices in the phone, the authentication is succesfull, but i receive the following message in the terminal:
W (245220) BT_HCI: hci cmd send: disconnect: hdl 0x80, rsn:0x13
W (245296) BT_HCI: hcif disc complete: hdl 0x80, rsn 0x16


And the connection process stops there. The connection proccess cannot complete
The serial port callback never reach the state: ESP_SPP_SRV_OPEN_EVT (SPP Server connection open)

I think i had this same issue months ago. I think was related with HCI. Now i have a fresh installation, with the latest ESP-IDF version. ESP-IDF works fine. VSCode works fine.
I tried to search the error code rsn:13, but i cannot find any information.

I think is related with the supervision timeout for the HCI link. Where can i change this value?
Last edited by chucrut on Fri Jun 16, 2023 9:18 pm, edited 4 times in total.

chucrut
Posts: 15
Joined: Tue Oct 18, 2022 10:04 pm

Re: Bluetooth connection lost after pairing

Postby chucrut » Fri Jun 16, 2023 7:28 pm

Image

chucrut
Posts: 15
Joined: Tue Oct 18, 2022 10:04 pm

Re: Bluetooth connection lost after pairing

Postby chucrut » Fri Jun 16, 2023 7:40 pm

I tried with this configuration:
Image

chucrut
Posts: 15
Joined: Tue Oct 18, 2022 10:04 pm

Re: Bluetooth connection lost after pairing

Postby chucrut » Fri Jun 16, 2023 7:40 pm

And also tried with HCI instead of PCM

chucrut
Posts: 15
Joined: Tue Oct 18, 2022 10:04 pm

Re: Bluetooth connection lost after pairing

Postby chucrut » Fri Jun 16, 2023 9:19 pm

I tested both ESP32 WROOM 32 and ESP32 PICO MINI 02 and their behaviour is slightly different
ESP32 WROOM 32 not even pair
ESP32 PICO MINI 02 pair and disconnect, like the pictures above

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

Re: Bluetooth connection lost after pairing

Postby InfiniteArray » Fri Jun 14, 2024 6:18 am

Hi chucrut! Almost one year later I'm dealing with exactly the same issue with an ESP32-WROOM-32E and a Quest 3. I have created this post before finding yours: https://esp32.com/viewtopic.php?f=19&t=40345

One thing I found is that it may be related to the type of connection. The bt_spp_acceptor uses the Serial Port Profile from the Bluetooth spec. When I tried the a2dp_sink example, which uses the Advanced Audio Distribution Profile, the connection wasn't terminated.

Interestingly though, the bt_spp_acceptor example works with my phone. Have you been able to get to the bottom of this at all or gain any additional insights into this problem?

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

Re: Bluetooth connection lost after pairing

Postby InfiniteArray » Sat Jun 15, 2024 6:20 pm

Hey chucrut,

The connection being closed after pairing is normal for SPP. You should still be able to access the paired device later in your application.

Who is online

Users browsing this forum: No registered users and 333 guests