BlueZ error: Sap driver initialization failed

22k views Asked by At

I've exhausted my search on trying to resolve this problem. I can't seem to get the example GATT server running in BlueZ 5.27. I'm running a Linux VM (kernel = 3.16) connected to a Broadcom BCM20702A0 Bluetooth 4.0 USB dongle. I can run hciconfig, hcitool, and gatttool with the associated commands and these work properly. I start advertising using,

sudo hciconfig hci0 leadv

However, when I try to run a BLe GATT server using,

bluetoothd -d -n

I get the following output:

bluetoothd[8075]: Bluetooth daemon 5.27
bluetoothd[8075]: src/gatt.c:gatt_init() Starting GATT server
bluetoothd[8075]: src/adapter.c:adapter_init() sending read version command
bluetoothd[8075]: Starting SDP server
bluetoothd[8075]: src/sdpd-service.c:register_device_id() Adding device id record for 0002:1d6b:0246:051b
bluetoothd[8075]: src/plugin.c:plugin_init() Loading builtin plugins
bluetoothd[8075]: src/plugin.c:add_plugin() Loading hostname plugin
bluetoothd[8075]: src/plugin.c:add_plugin() Loading wiimote plugin
bluetoothd[8075]: src/plugin.c:add_plugin() Loading autopair plugin
bluetoothd[8075]: src/plugin.c:add_plugin() Loading policy plugin
bluetoothd[8075]: src/plugin.c:add_plugin() Loading gatt_example plugin
bluetoothd[8075]: src/plugin.c:add_plugin() Loading neard plugin
bluetoothd[8075]: src/plugin.c:add_plugin() Loading sap plugin
bluetoothd[8075]: src/plugin.c:add_plugin() Loading a2dp plugin
bluetoothd[8075]: src/plugin.c:add_plugin() Loading avrcp plugin
bluetoothd[8075]: src/plugin.c:add_plugin() Loading network plugin
bluetoothd[8075]: src/plugin.c:add_plugin() Loading input plugin
bluetoothd[8075]: src/plugin.c:add_plugin() Loading hog plugin
bluetoothd[8075]: src/plugin.c:add_plugin() Loading health plugin
bluetoothd[8075]: src/plugin.c:add_plugin() Loading gap plugin
bluetoothd[8075]: src/plugin.c:add_plugin() Loading scanparam plugin
bluetoothd[8075]: src/plugin.c:add_plugin() Loading deviceinfo plugin
bluetoothd[8075]: src/plugin.c:add_plugin() Loading alert plugin
bluetoothd[8075]: src/plugin.c:add_plugin() Loading time plugin
bluetoothd[8075]: src/plugin.c:add_plugin() Loading proximity plugin
bluetoothd[8075]: src/plugin.c:add_plugin() Loading thermometer plugin
bluetoothd[8075]: src/plugin.c:add_plugin() Loading heartrate plugin
bluetoothd[8075]: src/plugin.c:add_plugin() Loading cyclingspeed plugin
bluetoothd[8075]: src/plugin.c:plugin_init() Loading plugins /home/vagrant/bluez-5.27/plugins/.libs
bluetoothd[8075]: src/plugin.c:add_plugin() Loading external_dummy plugin
bluetoothd[8075]: profiles/health/hdp.c:hdp_manager_start() Starting Health manager
bluetoothd[8075]: profiles/input/suspend-dummy.c:suspend_init() 
bluetoothd[8075]: profiles/input/suspend-dummy.c:suspend_init() Created suspend-dummy FIFO on /tmp/hogsuspend
bluetoothd[8075]: profiles/network/manager.c:read_config() Config options: Security=true
bluetoothd[8075]: plugins/neard.c:neard_init() Setup neard plugin
bluetoothd[8075]: plugins/external-dummy.c:dummy_init() 
bluetoothd[8075]: src/main.c:main() Entering main loop
bluetoothd[8075]: src/rfkill.c:rfkill_event() RFKILL event idx 0 type 2 op 0 soft 0 hard 0
bluetoothd[8075]: Bluetooth management interface 1.6 initialized
bluetoothd[8075]: src/adapter.c:read_version_complete() sending read supported commands command
bluetoothd[8075]: src/adapter.c:read_version_complete() sending read index list command
bluetoothd[8075]: src/adapter.c:read_commands_complete() Number of commands: 47
bluetoothd[8075]: src/adapter.c:read_commands_complete() Number of events: 23
bluetoothd[8075]: src/adapter.c:read_index_list_complete() Number of controllers: 1
bluetoothd[8075]: src/adapter.c:read_index_list_complete() Found index 0
bluetoothd[8075]: src/adapter.c:index_added() index 0
bluetoothd[8075]: src/adapter.c:btd_adapter_new() System name: BlueZ 5.27
bluetoothd[8075]: src/adapter.c:btd_adapter_new() Major class: 0
bluetoothd[8075]: src/adapter.c:btd_adapter_new() Minor class: 0
bluetoothd[8075]: src/adapter.c:btd_adapter_new() Modalias: usb:v1D6Bp0246d051B
bluetoothd[8075]: src/adapter.c:btd_adapter_new() Discoverable timeout: 180 seconds
bluetoothd[8075]: src/adapter.c:btd_adapter_new() Pairable timeout: 0 seconds
bluetoothd[8075]: src/adapter.c:index_added() sending read info command for index 0
bluetoothd[8075]: src/adapter.c:read_info_complete() index 0 status 0x00
bluetoothd[8075]: src/adapter.c:clear_uuids() sending clear uuids command for index 0
bluetoothd[8075]: src/attrib-server.c:btd_adapter_gatt_server_start() Start GATT server in hci0
bluetoothd[8075]: src/attrib-server.c:attrib_db_add_new() handle=0x0001
bluetoothd[8075]: src/attrib-server.c:attrib_db_add_new() handle=0x0004
bluetoothd[8075]: src/attrib-server.c:attrib_db_add_new() handle=0x0006
bluetoothd[8075]: src/attrib-server.c:attrib_db_add_new() handle=0x0007
bluetoothd[8075]: src/attrib-server.c:attrib_db_add_new() handle=0x0008
bluetoothd[8075]: src/adapter.c:adapter_service_add() /org/bluez/hci0
bluetoothd[8075]: src/sdpd-service.c:add_record_to_server() Adding record with handle 0x10001
bluetoothd[8075]: src/sdpd-service.c:add_record_to_server() Record pattern UUID 00000007-0000-1000-8000-00805f9
bluetoothd[8075]: src/sdpd-service.c:add_record_to_server() Record pattern UUID 00000100-0000-1000-8000-00805f9
bluetoothd[8075]: src/sdpd-service.c:add_record_to_server() Record pattern UUID 00001002-0000-1000-8000-00805f9
bluetoothd[8075]: src/sdpd-service.c:add_record_to_server() Record pattern UUID 00001800-0000-1000-8000-00805f9
bluetoothd[8075]: src/adapter.c:adapter_service_insert() /org/bluez/hci0
bluetoothd[8075]: src/adapter.c:add_uuid() sending add uuid command for index 0
bluetoothd[8075]: src/attrib-server.c:attrib_db_add_new() handle=0x0010
bluetoothd[8075]: src/adapter.c:adapter_service_add() /org/bluez/hci0
bluetoothd[8075]: src/sdpd-service.c:add_record_to_server() Adding record with handle 0x10002
bluetoothd[8075]: src/sdpd-service.c:add_record_to_server() Record pattern UUID 00000007-0000-1000-8000-00805f9
bluetoothd[8075]: src/sdpd-service.c:add_record_to_server() Record pattern UUID 00000100-0000-1000-8000-00805f9
bluetoothd[8075]: src/sdpd-service.c:add_record_to_server() Record pattern UUID 00001002-0000-1000-8000-00805f9
bluetoothd[8075]: src/sdpd-service.c:add_record_to_server() Record pattern UUID 00001801-0000-1000-8000-00805f9
bluetoothd[8075]: src/adapter.c:adapter_service_insert() /org/bluez/hci0
bluetoothd[8075]: src/adapter.c:add_uuid() sending add uuid command for index 0
bluetoothd[8075]: profiles/audio/a2dp.c:media_server_probe() path /org/bluez/hci0
bluetoothd[8075]: plugins/hostname.c:hostname_probe() 
bluetoothd[8075]: attrib/gatt-service.c:gatt_service_add() New service: handle 0x0009, UUID a002, 4 attributes
bluetoothd[8075]: src/attrib-server.c:attrib_db_add_new() handle=0x0009
bluetoothd[8075]: attrib/gatt-service.c:gatt_service_add() New characteristic: handle 0x000a
bluetoothd[8075]: src/attrib-server.c:attrib_db_add_new() handle=0x000a
bluetoothd[8075]: src/attrib-server.c:attrib_db_add_new() handle=0x000b
bluetoothd[8075]: src/attrib-server.c:attrib_db_add_new() handle=0x000c
bluetoothd[8075]: plugins/gatt-example.c:register_manuf1_service() start_handle=0x0011
bluetoothd[8075]: src/attrib-server.c:attrib_db_add_new() handle=0x0011
bluetoothd[8075]: src/attrib-server.c:attrib_db_add_new() handle=0x0012
bluetoothd[8075]: src/attrib-server.c:attrib_db_add_new() handle=0x0013
bluetoothd[8075]: src/attrib-server.c:attrib_db_add_new() handle=0x0014
bluetoothd[8075]: src/attrib-server.c:attrib_db_add_new() handle=0x0015
bluetoothd[8075]: plugins/gatt-example.c:register_manuf2_service() start_handle=0x0016
bluetoothd[8075]: src/attrib-server.c:attrib_db_add_new() handle=0x0016
bluetoothd[8075]: src/attrib-server.c:attrib_db_add_new() handle=0x0017
bluetoothd[8075]: src/attrib-server.c:attrib_db_add_new() handle=0x0018
bluetoothd[8075]: src/attrib-server.c:attrib_db_add_new() handle=0x0019
bluetoothd[8075]: src/attrib-server.c:attrib_db_add_new() handle=0x001a
bluetoothd[8075]: plugins/gatt-example.c:register_termometer_service() start_handle=0x001b manuf1=0x0011-0x0015, manuf2=0x0016-0x001a
bluetoothd[8075]: src/attrib-server.c:attrib_db_add_new() handle=0x001b
bluetoothd[8075]: src/attrib-server.c:attrib_db_add_new() handle=0x001c
bluetoothd[8075]: src/attrib-server.c:attrib_db_add_new() handle=0x001d
bluetoothd[8075]: src/attrib-server.c:attrib_db_add_new() handle=0x001e
bluetoothd[8075]: src/attrib-server.c:attrib_db_add_new() handle=0x001f
bluetoothd[8075]: src/attrib-server.c:attrib_db_add_new() handle=0x0020
bluetoothd[8075]: src/attrib-server.c:attrib_db_add_new() handle=0x0021
bluetoothd[8075]: src/attrib-server.c:attrib_db_add_new() handle=0x0022
bluetoothd[8075]: src/attrib-server.c:attrib_db_add_new() handle=0x0023
bluetoothd[8075]: src/attrib-server.c:attrib_db_add_new() handle=0x0024
bluetoothd[8075]: src/attrib-server.c:attrib_db_add_new() handle=0x0025
bluetoothd[8075]: src/adapter.c:adapter_service_add() /org/bluez/hci0
bluetoothd[8075]: src/sdpd-service.c:add_record_to_server() Adding record with handle 0x10003
bluetoothd[8075]: src/sdpd-service.c:add_record_to_server() Record pattern UUID 00000007-0000-1000-8000-00805f9
bluetoothd[8075]: src/sdpd-service.c:add_record_to_server() Record pattern UUID 00000100-0000-1000-8000-00805f9
bluetoothd[8075]: src/sdpd-service.c:add_record_to_server() Record pattern UUID 00001002-0000-1000-8000-00805f9
bluetoothd[8075]: src/sdpd-service.c:add_record_to_server() Record pattern UUID 0000a004-0000-1000-8000-00805f9
bluetoothd[8075]: src/adapter.c:adapter_service_insert() /org/bluez/hci0
bluetoothd[8075]: src/adapter.c:add_uuid() sending add uuid command for index 0
bluetoothd[8075]: plugins/gatt-example.c:register_vendor_service() start_handle=0x000d
bluetoothd[8075]: src/attrib-server.c:attrib_db_add_new() handle=0x000d
bluetoothd[8075]: src/attrib-server.c:attrib_db_add_new() handle=0x000e
bluetoothd[8075]: src/attrib-server.c:attrib_db_add_new() handle=0x000f
bluetoothd[8075]: plugins/gatt-example.c:register_weight_service() start_handle=0xfffa, vendor=0x000d-0x000f
bluetoothd[8075]: src/attrib-server.c:attrib_db_add_new() handle=0xfffa
bluetoothd[8075]: src/attrib-server.c:attrib_db_add_new() handle=0xfffb
bluetoothd[8075]: src/attrib-server.c:attrib_db_add_new() handle=0xfffc
bluetoothd[8075]: src/attrib-server.c:attrib_db_add_new() handle=0xfffd
bluetoothd[8075]: src/attrib-server.c:attrib_db_add_new() handle=0xfffe
bluetoothd[8075]: src/attrib-server.c:attrib_db_add_new() handle=0xffff
bluetoothd[8075]: src/adapter.c:adapter_service_add() /org/bluez/hci0
bluetoothd[8075]: src/sdpd-service.c:add_record_to_server() Adding record with handle 0x10004
bluetoothd[8075]: src/sdpd-service.c:add_record_to_server() Record pattern UUID 00000007-0000-1000-8000-00805f9
bluetoothd[8075]: src/sdpd-service.c:add_record_to_server() Record pattern UUID 00000100-0000-1000-8000-00805f9
bluetoothd[8075]: src/sdpd-service.c:add_record_to_server() Record pattern UUID 00001002-0000-1000-8000-00805f9
bluetoothd[8075]: src/sdpd-service.c:add_record_to_server() Record pattern UUID feee74dc-a8de-3196-1149-d43596c
bluetoothd[8075]: src/adapter.c:adapter_service_insert() /org/bluez/hci0
bluetoothd[8075]: src/adapter.c:add_uuid() sending add uuid command for index 0
bluetoothd[8075]: attrib/gatt-service.c:gatt_service_add() New service: handle 0x0026, UUID 1803, 3 attributes
bluetoothd[8075]: src/attrib-server.c:attrib_db_add_new() handle=0x0026
bluetoothd[8075]: attrib/gatt-service.c:gatt_service_add() New characteristic: handle 0x0027
bluetoothd[8075]: src/attrib-server.c:attrib_db_add_new() handle=0x0027
bluetoothd[8075]: src/attrib-server.c:attrib_db_add_new() handle=0x0028
bluetoothd[8075]: profiles/proximity/linkloss.c:link_loss_register() Link Loss service added
bluetoothd[8075]: profiles/proximity/reporter.c:register_tx_power() start_handle=0x0029
bluetoothd[8075]: src/attrib-server.c:attrib_db_add_new() handle=0x0029
bluetoothd[8075]: src/attrib-server.c:attrib_db_add_new() handle=0x002a
bluetoothd[8075]: src/attrib-server.c:attrib_db_add_new() handle=0x002b
bluetoothd[8075]: src/attrib-server.c:attrib_db_add_new() handle=0x002c
bluetoothd[8075]: attrib/gatt-service.c:gatt_service_add() New service: handle 0x002d, UUID 1802, 3 attributes
bluetoothd[8075]: src/attrib-server.c:attrib_db_add_new() handle=0x002d
bluetoothd[8075]: attrib/gatt-service.c:gatt_service_add() New characteristic: handle 0x002e
bluetoothd[8075]: src/attrib-server.c:attrib_db_add_new() handle=0x002e
bluetoothd[8075]: src/attrib-server.c:attrib_db_add_new() handle=0x002f
bluetoothd[8075]: profiles/proximity/immalert.c:imm_alert_register() Immediate Alert service added
bluetoothd[8075]: profiles/proximity/reporter.c:reporter_adapter_probe() Proximity Reporter for adapter 0x95ebf28
bluetoothd[8075]: profiles/time/server.c:time_server_init() path /org/bluez/hci0
bluetoothd[8075]: attrib/gatt-service.c:gatt_service_add() New service: handle 0x0030, UUID 1805, 6 attributes
bluetoothd[8075]: src/attrib-server.c:attrib_db_add_new() handle=0x0030
bluetoothd[8075]: attrib/gatt-service.c:gatt_service_add() New characteristic: handle 0x0031
bluetoothd[8075]: src/attrib-server.c:attrib_db_add_new() handle=0x0031
bluetoothd[8075]: src/attrib-server.c:attrib_db_add_new() handle=0x0032
bluetoothd[8075]: src/attrib-server.c:attrib_db_add_new() handle=0x0033
bluetoothd[8075]: attrib/gatt-service.c:gatt_service_add() New characteristic: handle 0x0034
bluetoothd[8075]: src/attrib-server.c:attrib_db_add_new() handle=0x0034
bluetoothd[8075]: src/attrib-server.c:attrib_db_add_new() handle=0x0035
bluetoothd[8075]: attrib/gatt-service.c:gatt_service_add() New service: handle 0x0036, UUID 1806, 5 attributes
bluetoothd[8075]: src/attrib-server.c:attrib_db_add_new() handle=0x0036
bluetoothd[8075]: attrib/gatt-service.c:gatt_service_add() New characteristic: handle 0x0037
bluetoothd[8075]: src/attrib-server.c:attrib_db_add_new() handle=0x0037
bluetoothd[8075]: src/attrib-server.c:attrib_db_add_new() handle=0x0038
bluetoothd[8075]: attrib/gatt-service.c:gatt_service_add() New characteristic: handle 0x0039
bluetoothd[8075]: src/attrib-server.c:attrib_db_add_new() handle=0x0039
bluetoothd[8075]: src/attrib-server.c:attrib_db_add_new() handle=0x003a
bluetoothd[8075]: attrib/gatt-service.c:gatt_service_add() New service: handle 0x003b, UUID 180e, 9 attributes
bluetoothd[8075]: src/attrib-server.c:attrib_db_add_new() handle=0x003b
bluetoothd[8075]: attrib/gatt-service.c:gatt_service_add() New characteristic: handle 0x003c
bluetoothd[8075]: src/attrib-server.c:attrib_db_add_new() handle=0x003c
bluetoothd[8075]: src/attrib-server.c:attrib_db_add_new() handle=0x003d
bluetoothd[8075]: src/attrib-server.c:attrib_db_add_new() handle=0x003e
bluetoothd[8075]: attrib/gatt-service.c:gatt_service_add() New characteristic: handle 0x003f
bluetoothd[8075]: src/attrib-server.c:attrib_db_add_new() handle=0x003f
bluetoothd[8075]: src/attrib-server.c:attrib_db_add_new() handle=0x0040
bluetoothd[8075]: attrib/gatt-service.c:gatt_service_add() New characteristic: handle 0x0041
bluetoothd[8075]: src/attrib-server.c:attrib_db_add_new() handle=0x0041
bluetoothd[8075]: src/attrib-server.c:attrib_db_add_new() handle=0x0042
bluetoothd[8075]: src/attrib-server.c:attrib_db_add_new() handle=0x0043
bluetoothd[8075]: attrib/gatt-service.c:gatt_service_add() New service: handle 0x0044, UUID 1811, 13 attributes
bluetoothd[8075]: src/attrib-server.c:attrib_db_add_new() handle=0x0044
bluetoothd[8075]: attrib/gatt-service.c:gatt_service_add() New characteristic: handle 0x0045
bluetoothd[8075]: src/attrib-server.c:attrib_db_add_new() handle=0x0045
bluetoothd[8075]: src/attrib-server.c:attrib_db_add_new() handle=0x0046
bluetoothd[8075]: attrib/gatt-service.c:gatt_service_add() New characteristic: handle 0x0047
bluetoothd[8075]: src/attrib-server.c:attrib_db_add_new() handle=0x0047
bluetoothd[8075]: src/attrib-server.c:attrib_db_add_new() handle=0x0048
bluetoothd[8075]: src/attrib-server.c:attrib_db_add_new() handle=0x0049
bluetoothd[8075]: attrib/gatt-service.c:gatt_service_add() New characteristic: handle 0x004a
bluetoothd[8075]: src/attrib-server.c:attrib_db_add_new() handle=0x004a
bluetoothd[8075]: src/attrib-server.c:attrib_db_add_new() handle=0x004b
bluetoothd[8075]: attrib/gatt-service.c:gatt_service_add() New characteristic: handle 0x004c
bluetoothd[8075]: src/attrib-server.c:attrib_db_add_new() handle=0x004c
bluetoothd[8075]: src/attrib-server.c:attrib_db_add_new() handle=0x004d
bluetoothd[8075]: src/attrib-server.c:attrib_db_add_new() handle=0x004e
bluetoothd[8075]: attrib/gatt-service.c:gatt_service_add() New characteristic: handle 0x004f
bluetoothd[8075]: src/attrib-server.c:attrib_db_add_new() handle=0x004f
bluetoothd[8075]: src/attrib-server.c:attrib_db_add_new() handle=0x0050
bluetoothd[8075]: profiles/network/manager.c:panu_server_probe() path /org/bluez/hci0
bluetoothd[8075]: profiles/network/server.c:server_register() Registered interface org.bluez.NetworkServer1 on path /org/bluez/hci0
bluetoothd[8075]: profiles/network/manager.c:gn_server_probe() path /org/bluez/hci0
bluetoothd[8075]: profiles/network/manager.c:nap_server_probe() path /org/bluez/hci0
bluetoothd[8075]: profiles/audio/avrcp.c:avrcp_controller_server_probe() path /org/bluez/hci0
bluetoothd[8075]: src/adapter.c:adapter_service_add() /org/bluez/hci0
bluetoothd[8075]: src/sdpd-service.c:add_record_to_server() Adding record with handle 0x10005
bluetoothd[8075]: src/sdpd-service.c:add_record_to_server() Record pattern UUID 00000017-0000-1000-8000-00805f9
bluetoothd[8075]: src/sdpd-service.c:add_record_to_server() Record pattern UUID 00000100-0000-1000-8000-00805f9
bluetoothd[8075]: src/sdpd-service.c:add_record_to_server() Record pattern UUID 00001002-0000-1000-8000-00805f9
bluetoothd[8075]: src/sdpd-service.c:add_record_to_server() Record pattern UUID 0000110e-0000-1000-8000-00805f9
bluetoothd[8075]: src/sdpd-service.c:add_record_to_server() Record pattern UUID 0000110f-0000-1000-8000-00805f9
bluetoothd[8075]: src/adapter.c:adapter_service_insert() /org/bluez/hci0
bluetoothd[8075]: src/adapter.c:add_uuid() sending add uuid command for index 0
bluetoothd[8075]: profiles/audio/avrcp.c:avrcp_target_server_probe() path /org/bluez/hci0
bluetoothd[8075]: src/adapter.c:adapter_service_add() /org/bluez/hci0
bluetoothd[8075]: src/sdpd-service.c:add_record_to_server() Adding record with handle 0x10006
bluetoothd[8075]: src/sdpd-service.c:add_record_to_server() Record pattern UUID 00000017-0000-1000-8000-00805f9
bluetoothd[8075]: src/sdpd-service.c:add_record_to_server() Record pattern UUID 00000100-0000-1000-8000-00805f9
bluetoothd[8075]: src/sdpd-service.c:add_record_to_server() Record pattern UUID 00001002-0000-1000-8000-00805f9
bluetoothd[8075]: src/sdpd-service.c:add_record_to_server() Record pattern UUID 0000110c-0000-1000-8000-00805f9
bluetoothd[8075]: src/sdpd-service.c:add_record_to_server() Record pattern UUID 0000110e-0000-1000-8000-00805f9
bluetoothd[8075]: src/adapter.c:adapter_service_insert() /org/bluez/hci0
bluetoothd[8075]: src/adapter.c:add_uuid() sending add uuid command for index 0
bluetoothd[8075]: profiles/audio/a2dp.c:a2dp_sink_server_probe() path /org/bluez/hci0
bluetoothd[8075]: profiles/audio/a2dp.c:a2dp_source_server_probe() path /org/bluez/hci0
bluetoothd[8075]: profiles/sap/manager.c:sap_server_probe() path /org/bluez/hci0
**bluetoothd[8075]: Sap driver initialization failed.**
**bluetoothd[8075]: sap-server: Operation not permitted (1)**
bluetoothd[8075]: src/adapter.c:btd_adapter_unblock_address() hci0 00:00:00:00:00:00
bluetoothd[8075]: src/adapter.c:load_link_keys() hci0 keys 0 debug_keys 0
bluetoothd[8075]: src/adapter.c:load_ltks() hci0 keys 0
bluetoothd[8075]: src/adapter.c:load_irks() hci0 irks 0
bluetoothd[8075]: src/adapter.c:load_conn_params() hci0 conn params 0
bluetoothd[8075]: src/adapter.c:load_connections() sending get connections command for index 0
bluetoothd[8075]: src/adapter.c:adapter_service_insert() /org/bluez/hci0
bluetoothd[8075]: src/adapter.c:add_uuid() sending add uuid command for index 0
bluetoothd[8075]: src/adapter.c:set_did() hci0 source 2 vendor 1d6b product 246 version 51b
bluetoothd[8075]: src/adapter.c:adapter_register() Adapter /org/bluez/hci0 registered
bluetoothd[8075]: src/adapter.c:set_dev_class() sending set device class command for index 0
bluetoothd[8075]: src/adapter.c:set_name() sending set local name command for index 0
bluetoothd[8075]: src/adapter.c:set_mode() sending set mode command for index 0
bluetoothd[8075]: src/adapter.c:adapter_start() adapter /org/bluez/hci0 has been enabled
bluetoothd[8075]: src/adapter.c:trigger_passive_scanning() 
bluetoothd[8075]: src/adapter.c:load_link_keys_complete() link keys loaded for hci0
bluetoothd[8075]: src/adapter.c:load_ltks_complete() LTKs loaded for hci0
bluetoothd[8075]: src/adapter.c:load_irks_complete() IRKs loaded for hci0
**bluetoothd[8075]: hci0 Load Connection Parameters failed: Unknown Command (0x01)**
bluetoothd[8075]: src/adapter.c:get_connections_complete() Connection count: 0
bluetoothd[8075]: plugins/hostname.c:property_changed() static hostname: jessie-i386
bluetoothd[8075]: plugins/hostname.c:property_changed() pretty hostname: 
bluetoothd[8075]: plugins/hostname.c:update_name() name: jessie-i386
bluetoothd[8075]: src/adapter.c:adapter_set_name() name: jessie-i386
bluetoothd[8075]: src/adapter.c:adapter_set_name() alias: jessie-i386
bluetoothd[8075]: src/adapter.c:set_name() sending set local name command for index 0
bluetoothd[8075]: plugins/hostname.c:property_changed() chassis: vm
bluetoothd[8075]: src/adapter.c:local_name_changed_callback() Name: BlueZ 5.27
bluetoothd[8075]: src/adapter.c:local_name_changed_callback() Short name: 
bluetoothd[8075]: src/adapter.c:local_name_changed_callback() Current alias: BlueZ 5.27
bluetoothd[8075]: src/attrib-server.c:attrib_db_update() handle=0x0006
bluetoothd[8075]: src/adapter.c:local_name_changed_callback() Name: jessie-i386
bluetoothd[8075]: src/adapter.c:local_name_changed_callback() Short name: 
bluetoothd[8075]: src/adapter.c:local_name_changed_callback() Current alias: jessie-i386
bluetoothd[8075]: src/attrib-server.c:attrib_db_update() handle=0x0006

The Sap driver fails to initialize and I'm guessing that this causes the hci0 adapter to fail to load the connection parameters (see output).

The BlueZ 5.27 stack was built from the source code as follows:

./configure CFLAGS="$CFLAGS -Wno-sign-compare -Wno-format-security" --prefix=/usr --mandir=/usr/share/man --sysconfdir=/etc --localstatedir=/var --disable-systemd --enable-experimental --enable-maintainer-mode
make
sudo make install

No errors were reported during the build and installation.

Why is the Sap driver failing to initialize?

Thanks for any help you can provide.

1

There are 1 answers

2
Johnas Cukier On

After a reinstallation, it seems to have corrected itself. For the benefit of others, I'm listing how I installed, and got the example GATT server running:

My environment:

  • Vagrant
  • Virtual Box
  • Ubuntu Trusty Tahr as a guest OS (v. 14.04 32-bit OS)
  • Updated to linux kernel 3.16

Installed packages:

libglib2.0-dev  
libdbus-1-dev  
libudev-dev  
libical-dev  
libreadline-dev  

Downloaded BlueZ 5.31 from here: https://www.kernel.org/pub/linux/bluetooth/bluez-5.31.tar.xz
Installation of updated kernel:

sudo apt-get update  
sudo apt-get install --install-recommends linux-generic-lts-utopic

A reboot is necessary. I'm using Vagrant and lost shared folder access. If this happens to you, wait for vagrant to report the error and go into the VM anyway (vagrant ssh). In the VM, issue this command to fix the shared folder problem:

sudo /etc/init.d/vboxadd setup  

I would reboot again (probably not necessary), to check that the shared folder is active again.
Once back in the VM, continue the installation of BlueZ 5.31:

cd ~  
sudo apt-get install libglib2.0-dev libdbus-1-dev libudev-dev libical-dev libreadline-dev  
wget https://www.kernel.org/pub/linux/bluetooth/bluez-5.31.tar.xz  
tar xvf bluez-5.31.tar.xz  
cd bluez-5.31  
./configure --prefix=/usr --mandir=/usr/share/man --sysconfdir=/etc --localstatedir=/var --disable-systemd --enable-experimental --enable-maintainer-mode  
make  
sudo make install  
sudo cp attrib/gatttool /usr/bin

Installation completed. Check it as follows:

hciconfig

You should get the follow response (or something similar):

hci0:   Type: BR/EDR  Bus: USB  
        BD Address: 00:1A:7D:DA:71:0C  ACL MTU: 310:10  SCO MTU: 64:8  
        DOWN  
        RX bytes:15528 acl:126 sco:0 events:683 errors:0  
        TX bytes:6459 acl:146 sco:0 commands:234 errors:0

Bring up the Bluetooth adapter, start advertising, start example GATT server (heart rate service) with verbose on:

sudo hciconfig hci0 up  
sudo tools/btmgmt -i hci0 advertising on  
tools/gatt-server -i hci0 -s low -t public -r -v

Go to another device (I've used an iPod and another PC running BlueZ but having problems with Android devices) and connect to the service. Here is how I did it on another PC running BlueZ:

gatttool -b **MAC address of GATT server** -I  
connect  
primary  
characteristics

You can issue other commands to read and write to the GATT server.

I love this forum finding many answers here. I hope this small contribution helps at least one other frustrated developer out there.