Bluez аварийно завершает работу после сопряжения с моим BLE Remote

У меня есть пульт Bluetooth, который я использовал раньше в другой системе, и теперь, когда я запускаю 4.52 BLUEZ, я получаю сообщение об ошибке bluetoothctl, как только подключаюсь к пульту.

Подключение к блютуз ctl

pi@marcophone:~$ sudo bluetoothctl
 Agent registered
[CHG] Controller B8:27:EB:1B:C4:00 Pairable: yes
[CHG] Device 20:C3:8F:BD:93:40 Connected: yes
[Remote RC]# trust
 Changing 20:C3:8F:BD:93:40 trust succeeded

Здесь я успешно подключился к удаленному

[RC]# pair
 Attempting to pair with 20:C3:8F:BD:93:40
[CHG] Device 20:C3:8F:BD:93:40 Paired: yes
Pairing successful

Сразу после этого bluetoothctl теряет связь

[DEL] Descriptor (Handle 0x2ec8)
    /org/bluez/hci0/dev_20_C3_8F_BD_93_40/service0008/char0009/desc000b
    00002902-0000-1000-8000-00805f9b34fb
    Client Characteristic Configuration
[DEL] Characteristic (Handle 0x4cf0)
    /org/bluez/hci0/dev_20_C3_8F_BD_93_40/service0008/char0009
    00002a05-0000-1000-8000-00805f9b34fb
    Service Changed
[DEL] Primary Service (Handle 0x0073)
    /org/bluez/hci0/dev_20_C3_8F_BD_93_40/service0008
    00001801-0000-1000-8000-00805f9b34fb
    Generic Attribute Profile
[DEL] Characteristic (Handle 0x4cf0)
    /org/bluez/hci0/dev_20_C3_8F_BD_93_40/service000c/char000d
    00002a50-0000-1000-8000-00805f9b34fb
    PnP ID
[DEL] Primary Service (Handle 0x0073)
    /org/bluez/hci0/dev_20_C3_8F_BD_93_40/service000c
    0000180a-0000-1000-8000-00805f9b34fb
    Device Information
Agent unregistered
[DEL] Controller B8:27:EB:1B:C4:00 marcophone [default]
Waiting to connect to bluetoothd...con

Журналы:

pi@marcophone:~$ cat /var/log/syslog | grep bluetooth -a
Jan 27 18:39:40 marcophone bluetoothd[1048]: Bluetooth daemon 5.52
Jan 27 18:39:40 marcophone bluetoothd[1048]: Starting SDP server
Jan 27 18:39:40 marcophone systemd[1]: Started Raspberry Pi bluetooth helper.
Jan 27 18:39:40 marcophone bluetoothd[1048]: Bluetooth management interface 1.14 initialized
Jan 27 18:39:40 marcophone bluetoothd[1048]: Endpoint registered: sender=:1.21 path=/A2DP/SBC/Source/1
Jan 27 18:39:40 marcophone bluetoothd[1048]: Failed to set privacy: Rejected (0x0b)
Jan 27 18:41:07 marcophone bluetoothd[1048]: No cache for 20:C3:8F:BD:93:40
Jan 27 18:41:12 marcophone bluetoothd[1048]: Protocol Mode characteristic read failed: Request attribute has encountered an unlikely error
Jan 27 18:41:13 marcophone bluetoothd[1048]: Report Map read failed: Request attribute has encountered an unlikely error
Jan 27 18:41:13 marcophone bluetoothd[1048]: Read External Report Reference descriptor failed: Request attribute has encountered an unlikely error
Jan 27 18:41:13 marcophone bluetoothd[1048]: Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
Jan 27 18:41:13 marcophone bluetoothd[1048]: Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
Jan 27 18:41:13 marcophone bluetoothd[1048]: Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
Jan 27 18:41:13 marcophone bluetoothd[1048]: Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
Jan 27 18:41:13 marcophone bluetoothd[1048]: Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
Jan 27 18:41:13 marcophone bluetoothd[1048]: HID Information read failed: Request attribute has encountered an unlikely error
Jan 27 18:41:24 marcophone bluetoothd[1048]: Protocol Mode characteristic read failed: Request attribute has encountered an unlikely error
Jan 27 18:41:24 marcophone bluetoothd[1048]: Report Map read failed: Request attribute has encountered an unlikely error
Jan 27 18:41:24 marcophone bluetoothd[1048]: Read External Report Reference descriptor failed: Request attribute has encountered an unlikely error
Jan 27 18:41:24 marcophone bluetoothd[1048]: Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
Jan 27 18:41:24 marcophone bluetoothd[1048]: Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
Jan 27 18:41:24 marcophone bluetoothd[1048]: Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
Jan 27 18:41:24 marcophone bluetoothd[1048]: Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
Jan 27 18:41:24 marcophone bluetoothd[1048]: Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
Jan 27 18:41:24 marcophone bluetoothd[1048]: Error storing included service - can't find it
Jan 27 18:41:24 marcophone systemd[1]: bluetooth.service: Main process exited, code=killed, status=11/SEGV
Jan 27 18:41:24 marcophone systemd[1]: bluetooth.service: Unit entered failed state.
Jan 27 18:41:24 marcophone systemd[1]: bluetooth.service: Failed with result 'signal'.
Jan 27 18:43:07 marcophone bluetoothd[356]: Bluetooth daemon 5.52
Jan 27 18:43:07 marcophone bluetoothd[356]: Starting SDP server
Jan 27 18:43:08 marcophone systemd[1]: Started Raspberry Pi bluetooth helper.
Jan 27 18:43:08 marcophone bluetoothd[356]: Bluetooth management interface 1.14 initialized
Jan 27 18:43:08 marcophone bluetoothd[356]: Endpoint registered: sender=:1.5 path=/A2DP/SBC/Source/1
Jan 27 18:43:08 marcophone bluetoothd[356]: Failed to set privacy: Rejected (0x0b)
Jan 27 18:45:11 marcophone bluetoothd[356]: No cache for 20:C3:8F:BD:93:40
Jan 27 18:45:11 marcophone bluetoothd[356]: BATT attribute not found
Jan 27 18:45:11 marcophone bluetoothd[356]: batt-profile profile accept failed for 20:C3:8F:BD:93:40
Jan 27 18:45:11 marcophone bluetoothd[356]: GAP attribute not found
Jan 27 18:45:11 marcophone bluetoothd[356]: gap-profile profile accept failed for 20:C3:8F:BD:93:40
Jan 27 18:45:11 marcophone bluetoothd[356]: input-hog profile accept failed for 20:C3:8F:BD:93:40
Jan 27 18:45:14 marcophone bluetoothd[356]: HID Information read failed: Request attribute has encountered an unlikely error
Jan 27 18:45:14 marcophone bluetoothd[356]: Protocol Mode characteristic read failed: Request attribute has encountered an unlikely error
Jan 27 18:45:14 marcophone bluetoothd[356]: Report Map read failed: Request attribute has encountered an unlikely error
Jan 27 18:45:14 marcophone bluetoothd[356]: Read External Report Reference descriptor failed: Request attribute has encountered an unlikely error
Jan 27 18:45:14 marcophone bluetoothd[356]: Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
Jan 27 18:45:14 marcophone bluetoothd[356]: Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
Jan 27 18:45:14 marcophone bluetoothd[356]: Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
Jan 27 18:45:14 marcophone bluetoothd[356]: Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
Jan 27 18:45:14 marcophone bluetoothd[356]: Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
Jan 27 18:45:17 marcophone bluetoothd[356]: HID Information read failed: Request attribute has encountered an unlikely error
Jan 27 18:45:17 marcophone bluetoothd[356]: Protocol Mode characteristic read failed: Request attribute has encountered an unlikely error
Jan 27 18:45:17 marcophone bluetoothd[356]: Report Map read failed: Request attribute has encountered an unlikely error
Jan 27 18:45:17 marcophone bluetoothd[356]: Read External Report Reference descriptor failed: Request attribute has encountered an unlikely error
Jan 27 18:45:17 marcophone bluetoothd[356]: Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
Jan 27 18:45:18 marcophone bluetoothd[356]: Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
Jan 27 18:45:18 marcophone bluetoothd[356]: Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
Jan 27 18:45:18 marcophone bluetoothd[356]: Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
Jan 27 18:45:18 marcophone bluetoothd[356]: Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
Jan 27 18:45:18 marcophone bluetoothd[356]: Error storing included service - can't find it
Jan 27 18:45:18 marcophone systemd[1]: bluetooth.service: Main process exited, code=killed, status=11/SEGV
Jan 27 18:45:18 marcophone systemd[1]: bluetooth.service: Unit entered failed state.
Jan 27 18:45:18 marcophone systemd[1]: bluetooth.service: Failed with result 'signal'.
Jan 27 18:54:00 marcophone bluetoothd[358]: Bluetooth daemon 5.52
Jan 27 18:54:00 marcophone bluetoothd[358]: Starting SDP server
Jan 27 18:54:00 marcophone systemd[1]: Started Raspberry Pi bluetooth helper.
Jan 27 18:54:00 marcophone bluetoothd[358]: Bluetooth management interface 1.14 initialized
Jan 27 18:54:01 marcophone bluetoothd[358]: Endpoint registered: sender=:1.5 path=/A2DP/SBC/Source/1
Jan 27 18:54:01 marcophone bluetoothd[358]: Failed to set privacy: Rejected (0x0b)
Jan 27 18:55:30 marcophone bluetoothd[358]: No cache for 20:C3:8F:BD:93:40
Jan 27 18:55:30 marcophone bluetoothd[358]: BATT attribute not found
Jan 27 18:55:30 marcophone bluetoothd[358]: batt-profile profile accept failed for 20:C3:8F:BD:93:40
Jan 27 18:55:30 marcophone bluetoothd[358]: GAP attribute not found
Jan 27 18:55:31 marcophone bluetoothd[358]: gap-profile profile accept failed for 20:C3:8F:BD:93:40
Jan 27 18:55:31 marcophone bluetoothd[358]: input-hog profile accept failed for 20:C3:8F:BD:93:40
Jan 27 18:55:36 marcophone bluetoothd[358]: Protocol Mode characteristic read failed: Request attribute has encountered an unlikely error
Jan 27 18:55:36 marcophone bluetoothd[358]: Report Map read failed: Request attribute has encountered an unlikely error
Jan 27 18:55:36 marcophone bluetoothd[358]: Read External Report Reference descriptor failed: Request attribute has encountered an unlikely error
Jan 27 18:55:36 marcophone bluetoothd[358]: Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
Jan 27 18:55:36 marcophone bluetoothd[358]: Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
Jan 27 18:55:36 marcophone bluetoothd[358]: Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
Jan 27 18:55:36 marcophone bluetoothd[358]: Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
Jan 27 18:55:36 marcophone bluetoothd[358]: Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
Jan 27 18:55:36 marcophone bluetoothd[358]: HID Information read failed: Request attribute has encountered an unlikely error
Jan 27 18:55:47 marcophone bluetoothd[358]: Protocol Mode characteristic read failed: Request attribute has encountered an unlikely error
Jan 27 18:55:47 marcophone bluetoothd[358]: Report Map read failed: Request attribute has encountered an unlikely error
Jan 27 18:55:47 marcophone bluetoothd[358]: Read External Report Reference descriptor failed: Request attribute has encountered an unlikely error
Jan 27 18:55:47 marcophone bluetoothd[358]: Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
Jan 27 18:55:47 marcophone bluetoothd[358]: Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
Jan 27 18:55:47 marcophone bluetoothd[358]: Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
Jan 27 18:55:47 marcophone bluetoothd[358]: Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
Jan 27 18:55:47 marcophone bluetoothd[358]: Read Report Reference descriptor failed: Request attribute has encountered an unlikely error
Jan 27 18:55:48 marcophone bluetoothd[358]: Error storing included service - can't find it
Jan 27 18:55:48 marcophone systemd[1]: bluetooth.service: Main process exited, code=killed, status=11/SEGV
Jan 27 18:55:48 marcophone systemd[1]: bluetooth.service: Unit entered failed state.
Jan 27 18:55:48 marcophone systemd[1]: bluetooth.service: Failed with result 'signal'.

Hciconfig

pi@marcophone:~$ hciconfig -a
hci0:   Type: Primary  Bus: UART
    BD Address: B8:27:EB:1B:C4:00  ACL MTU: 1021:8  SCO MTU: 64:1
    UP RUNNING 
    RX bytes:2850 acl:94 sco:0 events:117 errors:0
    TX bytes:3820 acl:92 sco:0 commands:62 errors:0
    Features: 0xbf 0xfe 0xcf 0xfe 0xdb 0xff 0x7b 0x87
    Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3 
    Link policy: RSWITCH SNIFF 
    Link mode: SLAVE ACCEPT 
    Name: 'marcophone'
    Class: 0x480000
    Service Classes: Capturing, Telephony
    Device Class: Miscellaneous, 
    HCI Version: 4.1 (0x7)  Revision: 0x168
    LMP Version: 4.1 (0x7)  Subversion: 0x2209
    Manufacturer: Broadcom Corporation (15)

Версии:

pi@marcophone:~$ sudo bluetoothctl -v
sudo: Hostname marcophone kann nicht aufgelöst werden
bluetoothctl: 5.52
pi@marcophone:~$ 

Также я должен увидеть здесь запись: /dev/input/event* а там только /dev/input/mice.

Я знаю, что у меня это работает в bluez 5.50, так что это может быть проблемой в bluez 5.52.

Проведя исследование, я добавил следующие три параметра в свой /lib/systemd/system/bluetooth.service:

ExecStart=/usr/libexec/bluetooth/bluetoothd --compat --noplugin=sap -E 

person Besi    schedule 27.01.2020    source источник
comment
Тот факт, что служба завершается с status=11/SEGV (сбой сегментации), указывает на то, что это ошибка в BlueZ, поэтому лучше сообщить об этом разработчикам.   -  person tttapa    schedule 27.01.2020
comment
Как упоминал tttapa, это, скорее всего, ошибка в BlueZ, учитывая, что вы получаете ошибку сегментации и тот факт, что она работала со старой версией BlueZ. А пока вы можете попробовать запустить bluetoothctl --agent KeyboardDisplay в начале и посмотреть, что произойдет?   -  person Youssif Saeed    schedule 28.01.2020
comment
@YoussifSaeed: sudo bluetoothctl --agent KeyboardDisplay ничего не делает. И bluetoothctl не запускается, а просто блокирует приглашение. Что вы ожидаете, входя в это?   -  person Besi    schedule 10.02.2020


Ответы (2)


У меня это работает на другой машине. Однако на этой машине работает Raspbian Buster (4.19.97+ #1294, четверг, 30 января, 13:10:54 по Гринвичу, 2020, armv6l GNU/Linux).

У меня возникли проблемы с подключением и сопряжением с пультом, поэтому я сделал следующее, и это наконец заработало:

Обновите систему

sudo apt update && sudo apt upgrade

Обновление до последнего стека bluez

sudo apt-get remove bluez
date && sudo apt-get update && sudo apt-get install libdbus-1-dev libglib2.0-dev libudev-dev libical-dev libreadline-dev -y && 

date && wget www.kernel.org/pub/linux/bluetooth/bluez-5.52.tar.xz &&  tar xvf bluez-5.52.tar.xz && 

date && cd bluez-5.52 && ./configure --prefix=/usr --mandir=/usr/share/man --sysconfdir=/etc --localstatedir=/var --enable-experimental && make -j4 && sudo make install && date && sudo reboot

Теперь обновите ExecStart часть службы /lib/systemd/system/bluetooth.service следующим образом:

ExecStart=/usr/lib/bluetooth/bluetoothd --compat --noplugin=sap -E 

Также обновите /etc/bluetooth/main.conf и установите Privacy = off в разделе [General].

person Besi    schedule 10.02.2020

чтобы перейти на более новый стек bluez, я бы предпочел использовать пакеты следующим образом

sudo apt install debhelper autotools-dev dh-autoreconf \
    flex  bison libdbus-glib-1-dev  libglib2.0-dev \
    libcap-ng-dev    udev   libudev-dev   libreadline-dev \
    libical-dev  check   dh-systemd     libebook1.2-dev
mkdir bluez
cd bluez
wget https://launchpad.net/ubuntu/+archive/primary/+sourcefiles/bluez/5.55-0ubuntu1.1/bluez_5.55-0ubuntu1.1.dsc 
wget https://launchpad.net/ubuntu/+archive/primary/+sourcefiles/bluez/5.55-0ubuntu1.1/bluez_5.55.orig.tar.xz 
wget https://launchpad.net/ubuntu/+archive/primary/+sourcefiles/bluez/5.55-0ubuntu1.1/bluez_5.55-0ubuntu1.1.debian.tar.xz 
dpkg-source -x bluez_5.55-0ubuntu1.1.dsc 
cd bluez-5.55
dpkg-buildpackage -b
cd ..
sudo dpkg -i *deb

Использование пакетов имеет то преимущество, что вы можете установить другие версии этого материала.

person am70    schedule 02.01.2021