1

I am working on a simple Bluetooth GATT server running on a Raspberry Pi 3 model B. As a start I have used the example code of advertiser and gatt server. These examples are part of Bluez library. In order wrap everything I use example uart code from here.

My problem is that I can connect to Raspberry without any problem, but when I disconnect no actual disconnection happens. I have no any indication of disconnection not in btmon nor in dbus-monitor.

This behavior happens only on iOS (14.2) in Android (11, 8.1) everything works as expected.

There is issue on github here with almost the same problem with python-bluezero (They use dbus under the hood). I have tried suggested solutions but non of them helps.

I have seen the same question before, but this question didn't got any answers. I hope that I will be more lucky...

ArMouReR
  • 23
  • 6
  • So you're saying that the disconnection is working on iOS but not on Android? Are you disconnecting from the iOS app or from the Raspberry Pi? Which apps are you using on Android and iOS? And what version of BlueZ are you using on the Raspberry Pi? – Youssif Saeed Dec 20 '20 at 07:41
  • Exactly the opposite: Android works without issues and iOS do not works. I use Nordic nRF connect App, but in our proprietary app I see the same. I switched to nRF App in order to remove our App from the equation. I disconnect from iOS app and I use Bluez 5.50 – ArMouReR Dec 21 '20 at 13:02
  • Fair enough, it is good that you are removing the app from the equation. Unfortunately I cannot think of a quick way to debug further without a Bluetooth sniffer. If you have one available, you can at least see if the disconnection packet is being sent over the air. – Youssif Saeed Dec 21 '20 at 15:03
  • For now, can you try the following two things:- 1) What happens if you switch off Bluetooth or switch off the iOS device entirely? Do you see a disconnection happening on BlueZ? 2) Can you try running BlueZ through bluetoothctl and see if the behaviour is different? You can see this link for more info:- https://stackoverflow.com/questions/65299644/failed-to-encrypt-the-connection-with-bluez-peripheral-and-ios – Youssif Saeed Dec 21 '20 at 15:04
  • You could try running `sudo btmon` in a different terminal to see what that is reporting on the RPi when the disconnect is sent – ukBaz Dec 21 '20 at 15:24
  • @ukBaz I am trying to work around the problem, Is any easy way to disconnect iOS App from raspberry (I am in peripheral mode) using some dbus command ? – ArMouReR Jan 13 '21 at 19:41

0 Answers0