I want to use a Raspberry Pi running Raspbian version 3.18.11+ with the BATTOP Bluetooth CSR 4.0 Dongle as a BLE peripheral device and connect to it using an iOS device. I am using Bluez 5.28 and the gatt_example plugin as a first step before writing my own gatt server.
I used this tutorial to customize it.
Here's how I can make the bluetooth service work in verbose mode (I'm in the Bluez root directory):
sudo src/bluetoothd -p gatt_example -n
Here is the message I receive after starting the service:
bluetoothd[2823]: Bluetooth daemon 5.28 bluetoothd[2823]: Unknown key PageTimeout in main.conf bluetoothd[2823]: Unknown key DiscoverSchedulerInterval in main.conf bluetoothd[2823]: Unknown key InitiallyPowered in main.conf bluetoothd[2823]: Unknown key RememberPowered in main.conf bluetoothd[2823]: Unknown key AttributeServer in main.conf bluetoothd[2823]: Starting SDP server bluetoothd[2823]: Ignoring (cli) hostname bluetoothd[2823]: Ignoring (cli) wiimote bluetoothd[2823]: Ignoring (cli) autopair bluetoothd[2823]: Ignoring (cli) policy bluetoothd[2823]: Ignoring (cli) neard bluetoothd[2823]: Ignoring (cli) sap bluetoothd[2823]: Ignoring (cli) a2dp bluetoothd[2823]: Ignoring (cli) avrcp bluetoothd[2823]: Ignoring (cli) network bluetoothd[2823]: Ignoring (cli) input bluetoothd[2823]: Ignoring (cli) hog bluetoothd[2823]: Ignoring (cli) health bluetoothd[2823]: Ignoring (cli) gap bluetoothd[2823]: Ignoring (cli) scanparam bluetoothd[2823]: Ignoring (cli) deviceinfo bluetoothd[2823]: Ignoring (cli) alert bluetoothd[2823]: Ignoring (cli) time bluetoothd[2823]: Ignoring (cli) proximity bluetoothd[2823]: Ignoring (cli) thermometer bluetoothd[2823]: Ignoring (cli) heartrate bluetoothd[2823]: Ignoring (cli) cyclingspeed bluetoothd[2823]: Ignoring (cli) external_dummy bluetoothd[2823]: Bluetooth management interface 1.7 initialized
Then I use these commands in another terminal window to get its advertisement:
sudo tools/hciconfig hci0 up sudo tools/hciconfig hci0 leadv 0 sudo tools/hciconfig hci0 noscan sudo tools/hcitool -i hci0 cmd 0x08 0x0008 1E 02 01 1A 1A FF 4C 00 02 15 F3 4A 1A 1F 50 0F 48 FB AF AA 95 84 D6 41 D7 B1 00 01 00 00 C8 00
After these steps, I use the LightBlue app on iOS to connect and view services. I can see my device in the list and connect to it, but after connecting I can not see any services in the gatt example, and bluetoothd gives me the following message:
bluetoothd[2823]: Refusing storage path for private addressed device /org/bluez/hci0/dev_4E_8C_5E_D8_69_A5 bluetoothd[2823]: Can't store info for private addressed device /org/bluez/hci0/dev_4E_8C_5E_D8_69_A5 bluetoothd[2823]: Can't store services for private addressed device /org/bluez/hci0/dev_4E_8C_5E_D8_69_A5 bluetoothd[2823]: Unable to register GATT service with handle 0x0001 for device 4E:8C:5E:D8:69:A5: bluetoothd[2823]: Unable to register GATT service with handle 0x0006 for device 4E:8C:5E:D8:69:A5: bluetoothd[2823]: Unable to register GATT service with handle 0x000a for device 4E:8C:5E:D8:69:A5: bluetoothd[2823]: Unable to register GATT service with handle 0x000f for device 4E:8C:5E:D8:69:A5: bluetoothd[2823]: Unable to register GATT service with handle 0x0013 for device 4E:8C:5E:D8:69:A5: bluetoothd[2823]: Unable to register GATT service with handle 0x0019 for device 4E:8C:5E:D8:69:A5: bluetoothd[2823]: Unable to register GATT service with handle 0x001e for device 4E:8C:5E:D8:69:A5: bluetoothd[2823]: Unable to register GATT service with handle 0x0028 for device 4E:8C:5E:D8:69:A5:
Also, when I disconnect from it, Pi stops advertising, so I need to run the previous four commands again before I can connect to it again.
I searched for several days trying to find a solution, but I cannot get it to work. I would be grateful for any suggestions!
I also tried using Bluez 5.35 and 5.16 with no luck.