1

I want to automatically accept Bluetooth pairings with any device that wants to connect, I tried all answers (without python ones) from this question: Automatically accept bluetooth pairings But they don't work for me, if I try to connect to Raspberry Pi, it connects for 10 seconds and then disconnects and prints error aborted by local. I have Raspberry Pi Zero 2 W. I am running latest Raspberry Pi OS.

On my computer when I run bluetoothctl - B8:27:EB:9C:DB:9E is Raspberry Pi

[bluetooth]# connect B8:27:EB:9C:DB:9E
Attempting to connect to B8:27:EB:9C:DB:9E
[CHG] Device B8:27:EB:9C:DB:9E Connected: yes
[CHG] Device B8:27:EB:9C:DB:9E UUIDs: 00001108-0000-1000-8000-00805f9b34fb
[CHG] Device B8:27:EB:9C:DB:9E UUIDs: 0000110a-0000-1000-8000-00805f9b34fb
[CHG] Device B8:27:EB:9C:DB:9E UUIDs: 0000110b-0000-1000-8000-00805f9b34fb
[CHG] Device B8:27:EB:9C:DB:9E UUIDs: 0000110c-0000-1000-8000-00805f9b34fb
[CHG] Device B8:27:EB:9C:DB:9E UUIDs: 0000110e-0000-1000-8000-00805f9b34fb
[CHG] Device B8:27:EB:9C:DB:9E UUIDs: 00001112-0000-1000-8000-00805f9b34fb
[CHG] Device B8:27:EB:9C:DB:9E UUIDs: 00001200-0000-1000-8000-00805f9b34fb
[CHG] Device B8:27:EB:9C:DB:9E UUIDs: 00001800-0000-1000-8000-00805f9b34fb
[CHG] Device B8:27:EB:9C:DB:9E UUIDs: 00001801-0000-1000-8000-00805f9b34fb
[CHG] Device B8:27:EB:9C:DB:9E UUIDs: 0000180a-0000-1000-8000-00805f9b34fb
[CHG] Device B8:27:EB:9C:DB:9E ServicesResolved: yes
Failed to connect: org.bluez.Error.Failed br-connection-unknown
[CHG] Device B8:27:EB:9C:DB:9E ServicesResolved: no
[CHG] Device B8:27:EB:9C:DB:9E Connected: no
[CHG] Device B8:27:EB:9C:DB:9E Connected: yes
[CHG] Device B8:27:EB:9C:DB:9E Connected: no
[DEL] Device B8:27:EB:9C:DB:9E raspberrypi
[NEW] Device B8:27:EB:9C:DB:9E raspberrypi
[DEL] Device B8:27:EB:9C:DB:9E raspberrypi

Raspberry pi log:

[NEW] Device 04:42:1A:5A:42:1B mnxd 
[CHG] Device 04:42:1A:5A:42:1B Connected: no


> HCI Event: Simple Pairing Complete (0x36) plen 7                                                                                                                                           #1 [hci0] 29.091890
        Status: Authentication Failure (0x05)
        Address: 04:42:1A:5A:42:1B (OUI 04-42-1A)
@ MGMT Event: Authentication Failed (0x0011) plen 8                                                                                                                                    {0x0001} [hci0] 29.091998
        BR/EDR Address: 04:42:1A:5A:42:1B (OUI 04-42-1A)
        Status: Authentication Failed (0x05)
> HCI Event: Disconnect Complete (0x05) plen 4                                                                                                                                               #2 [hci0] 29.092843
        Status: Success (0x00)
        Handle: 12
        Reason: Remote User Terminated Connection (0x13)
7
  • What is it that is trying to connect to the RPi? Often that error message is because the connecting device is requesting a service on the RPi that doesn't exist so it disconnects it. Do you have bluetoothctl running on the RPi? What is reported in that? Also have sudo btmon running. The output is very verbose but it might give more information to debug this.
    – ukBaz
    Commented Nov 1, 2022 at 15:17
  • it connects for 10 seconds and then disconnects and prints error aborted by local ... what connects to what? ... what prints the error?
    – jsotola
    Commented Nov 1, 2022 at 15:19
  • @jsotola I connect my computer running Arch Linux to Raspberry Pi. Error prints blueman-manager on my computer
    – MN_XD
    Commented Nov 1, 2022 at 15:35
  • @ukBaz Yes I have bluetoothctl running on my Raspberry Pi, btmon doesn't print anything when I try to connect to Raspberry Pi. This is error that after some time bleman-manager prints: Connection Failed: le-connection-abort-by-local. I think this error is because I cannot click allow to pair on my raspberry pi.
    – MN_XD
    Commented Nov 1, 2022 at 15:40
  • Well done on updating your question with the bluetootchctl log. That is the bluetoothctl log from the Arch Linux computer. What is the bluetoothctl log from the RPi? Try setting up a GATT Server on the RPi and then see if the Arch Linux machine can connect and stay connected.
    – ukBaz
    Commented Nov 1, 2022 at 15:54

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.