I have small project where i want to put OrangePi Zero 2 in LE advertising mode (peripheral) and connect to it with NRF51822 (central) keychain.
Currently I have a problem with BlueZ, the stack not registering LEAdvertisingManager1
in dbus because not recognizing BLE support by adapter. But adapter support BLE, you can check this with low level hci tools, example turn on LE advertising:
root@orangepizero2:~# hciconfig hci0 up
root@orangepizero2:~# hciconfig hci0 leadv 0
and device can found with any tool like NRF Connect.
First at all look to output of hciconfig commands/features: https://pastebin.com/0AYH0bJx
Commands prints big list of supported commands where you can see LE support, but features output looks wrong, i not sure.
So i decided to download source of BlueZ 5.62 and try to do debug, but found nothing...
When bluetoothd initializing, it send MGMT_OP_READ_INFO (0x0004) to adapter, when data arrived, callback read_info_complete (adapter.c:9689) called. There are present variables: rp->supported_settings and rp->current_settings (adapter.c:9693). In my scenario i have supported_settings = 0x10BF, current_settings = 0x90. Further along the code, the presence of the LE flag (MGMT_SETTING_LE 0x00000200) is checked. Of course 0x200 bit in supported_settings not set, so support dropped. If you try to hardcode bit (adapter->supported_settings |= MGMT_SETTING_LE) LEAdvertisingManager1 appears in dbus, advertise appears in bluetoothctl, but BLE still not work properly:
[bluetooth]# advertise on
Failed to register advertisement: org.bluez.Error.NotPermitted
So, now i don't have any ideas yet. The reason is clearly not in BlueZ, perhaps some problem with the driver.
Configure flags: ./configure --enable-debug --prefix=/usr --enable-experimental --enable-testing --enable-logger --enable-admin
Armbian 21.08.1 Bullseye with Linux 4.9.280-sun50iw9
Bluetoothd log: https://pastebin.com/9eQqkiE4
Sorry for my English.