Bluez in BLE peripheral mode : Android can't retrieve services list, OK with iPhone and Win10

0

I try to make a Raspberry Pi 3B+ act as a BLE peripheral.

I downloaded latest version (5.50) of bluez stack here : https://git.kernel.org/pub/scm/bluetooth/bluez.git. I execute provided examples in /test/ directory.

When I run "example-advertisement" and "example-gatt-server" at the same time under root with python 2.7 or python 3.5, I can see the new BLE peripheral with Linux Mint, Win10, IOS and Android devices. However, although Linux, IOS and Win10 succeed in connecting and retrieving services and characteristics list, Android (4.4, 5.1 or 7.0, tested with 5 different brands of smartphones and tablets) can't connect to the device.

I saw this topic : https://raspberrypi.stackexchange.com/questions/90696/bluetooth-low-energy-gatt-services-not-found-on-android but I'm not using my own app for the moment. Even various BLE scanning applications we can find on Play Store don't manage to connect and retrieve service list.

It seems not related to Raspberry Pi specific hardware or software because I also tried with another Single Board Computer (Variscite DART-6UL, https://www.variscite.com/product/system-on-module-som/cortex-a7/dart-6ul-freescale-imx-6ul) and I get exactly the same behavior.

Do someone have an idea ?

Thanks.

fdamien12

Posted 2019-06-28T06:04:47.667

Reputation: 1

Answers

0

I give up after a lot of research. "nRF Connect" app succeed in connecting to my device and retrieve characteristic list, but not all the time : - On some Android devices, I just need to click "Connect" - On some others, I need to click "AutoConnect" in the 3 dots submenu.

However many other apps don't connect at all, including mine, with or without Autoconnect.

Adding some delays (100ms between peripheral discovery and connection and 100ms between connected state and services discovery) make some devices successfully connect, but not all.

fdamien12

Posted 2019-06-28T06:04:47.667

Reputation: 1