I am currently working on an IOS application that pairs with a raspberry pi advertising a UART BLE service. The application successfully discovers the peripheral and attempts to connect to it. However, I keep getting a pop up window from IOS with a request to pair with the device. If I press "cancel", the app disconnects from the peripheral. If I press "pair", the peripheral connects. However, the app continues sending me pairing requests. Is this a known bug with IOS? Is there any way to get around this issue?
Repeating BLE pairing requests
I also just encountered this issue with RPi 4 trying to use NrfConnect or LightBlue on iOS. Have you been able to resolve this issue? I am stuck as well
One cause of this is that Linux tries to read the battery state from the iPhone, which triggers the pairing request. You can configure bluez to prevent this. One of my colleagues at Ditto wrote some docs to fix it, which the forum won't let me link directly, but I will copy-paste the main instructions here.
To disable auto Battery reading
- Open the bluetooth service file
/usr/lib/systemd/system/bluetooth.service
, or/etc/systemd/system/bluetooth.target.wants/bluetooth.service
in a text editor. You may needsudo
permission to write to this file. - Add
-P battery
to the end of theExecStart
line to disable the Battery feature inbluetoothd
. YourExecStart
should look something likeExecStart=/usr/lib/bluetooth/bluetoothd -P battery
now. - Save the file.
- Run
systemctl daemon-reload
andsystemctl restart bluetooth
to apply the changes to the Bluetooth service
Thank you so much thombles, this seems to have resolved the issue