Pairing with bonded peer GATT ERROR 0x85 (133)

Hi,

I want to use filtered list during BLE advertisement in out project. The flow is as follows:

(I'm using nRF connect app for testing ble connection)

1. Just advertise so any device can be paired.
2. Bond (from now on whenever device disconnects advertise with enabled filtered list)
3. Now i can disconnect as many times as i want, and connect using devices remembered in bonded tab.
4. If i reboot the device the bond is still remembered but any pairing attempt results in immediate error log in the nRF app
```
Error 133 (0x85): GATT ERROR
```
5. Now i can try again with another device, but the pairing using remembered bond works until next reboot.

I'm using:
nrf-sdk 1.8.0 with Zephyr v2.7.0-ncs1

Parents
  • Hi

    What device is the central device in this connection? Since you say you are able to disconnect manually and reconnect it doesn't seem either side forgets bonding information upon disconnections either, but perhaps the central side doesn't register the disconnection when you reboot the device. Seeing as the GATT error (0x85) is rather generic, it could be numerous things causing this issues, but that seems like the most likely. If you either initiate the disconnect from the central side once the device is turned off, or wait for a connection timeout before powering the board again that might let the boards disconnect. 

    Could you share the log information from the central side so we can get a better view of what is actually happening? Also, what does the peripheral application do after a reboot, does it go straight into advertising, or does it check for existing connections?

    Best regards,

    Simon

Reply
  • Hi

    What device is the central device in this connection? Since you say you are able to disconnect manually and reconnect it doesn't seem either side forgets bonding information upon disconnections either, but perhaps the central side doesn't register the disconnection when you reboot the device. Seeing as the GATT error (0x85) is rather generic, it could be numerous things causing this issues, but that seems like the most likely. If you either initiate the disconnect from the central side once the device is turned off, or wait for a connection timeout before powering the board again that might let the boards disconnect. 

    Could you share the log information from the central side so we can get a better view of what is actually happening? Also, what does the peripheral application do after a reboot, does it go straight into advertising, or does it check for existing connections?

    Best regards,

    Simon

Children
  • Central device is phone with nrf-connect app.

    Here log from the central. The scenario was:

    1. Pair with the device

    2. Create bond

    3. Click disconnect in nrf-connect app.

    4. Restart device

    5. Try to connect with using bond

    nRF Connect, 2022-03-10
    lildog (7C:FF:8C:D0:D0:6F)
    V	13:43:03.528	Connecting to 7C:FF:8C:D0:D0:6F...
    D	13:43:03.528	gatt = device.connectGatt(autoConnect = false, TRANSPORT_LE, preferred PHY = LE 1M)
    D	13:43:03.826	[Broadcast] Action received: android.bluetooth.device.action.ACL_CONNECTED
    D	13:43:03.854	[Callback] Connection state changed with status: 0 and new state: CONNECTED (2)
    I	13:43:03.854	Connected to 7C:FF:8C:D0:D0:6F
    V	13:43:03.875	Discovering services...
    D	13:43:03.875	gatt.discoverServices()
    I	13:43:04.349	Connection parameters updated (interval: 7.5ms, latency: 0, timeout: 5000ms)
    D	13:43:05.459	[Callback] Services discovered with status: 0
    I	13:43:05.459	Services discovered
    V	13:43:05.501	Generic Attribute (0x1801)
    - Service Changed [I] (0x2A05)
       Client Characteristic Configuration (0x2902)
    - Client Supported Features [R W] (0x2B29)
    - Database Hash [R] (0x2B2A)
    Generic Access (0x1800)
    - Device Name [R] (0x2A00)
    - Appearance [R] (0x2A01)
    - Peripheral Preferred Connection Parameters [R] (0x2A04)
    Unknown Service (00000060-0000-1000-8000-00805f9b34fb)
    - Unknown Characteristic [R] (00000061-0000-1000-8000-00805f9b34fb)
    - Unknown Characteristic [R] (00000062-0000-1000-8000-00805f9b34fb)
    Battery Service (0x180F)
    - Battery Level [N R] (0x2A19)
       Client Characteristic Configuration (0x2902)
    Unknown Service (00000020-0000-1000-8000-00805f9b34fb)
    - Unknown Characteristic [WNR] (00000021-0000-1000-8000-00805f9b34fb)
    Unknown Service (00000070-0000-1000-8000-00805f9b34fb)
    - Unknown Characteristic [R] (00000071-0000-1000-8000-00805f9b34fb)
    Unknown Service (00000100-0000-1000-8000-00805f9b34fb)
    - Unknown Characteristic [R] (00000101-0000-1000-8000-00805f9b34fb)
    - Unknown Characteristic [R] (00000102-0000-1000-8000-00805f9b34fb)
    Device Information (0x180A)
    - Model Number String [R] (0x2A24)
    - Manufacturer Name String [R] (0x2A29)
    - PnP ID [R] (0x2A50)
    - Firmware Revision String [R] (0x2A26)
    Unknown Service (00000030-0000-1000-8000-00805f9b34fb)
    - Unknown Characteristic [R W] (00000030-0000-1000-8000-00805f9b34fb)
    - Unknown Characteristic [N R] (00000031-0000-1000-8000-00805f9b34fb)
       Client Characteristic Configuration (0x2902)
    - Unknown Characteristic [N R] (00000032-0000-1000-8000-00805f9b34fb)
       Client Characteristic Configuration (0x2902)
    - Unknown Characteristic [N R] (00000033-0000-1000-8000-00805f9b34fb)
       Client Characteristic Configuration (0x2902)
    - Unknown Characteristic [N R] (00000034-0000-1000-8000-00805f9b34fb)
       Client Characteristic Configuration (0x2902)
    - Unknown Characteristic [N R] (00000035-0000-1000-8000-00805f9b34fb)
       Client Characteristic Configuration (0x2902)
    - Unknown Characteristic [N R] (00000036-0000-1000-8000-00805f9b34fb)
       Client Characteristic Configuration (0x2902)
    - Unknown Characteristic [N R] (00000037-0000-1000-8000-00805f9b34fb)
       Client Characteristic Configuration (0x2902)
    - Unknown Characteristic [N R] (00000038-0000-1000-8000-00805f9b34fb)
       Client Characteristic Configuration (0x2902)
    - Unknown Characteristic [N R] (00000039-0000-1000-8000-00805f9b34fb)
       Client Characteristic Configuration (0x2902)
    Unknown Service (00000040-0000-1000-8000-00805f9b34fb)
    - Unknown Characteristic [WNR] (00000041-0000-1000-8000-00805f9b34fb)
    Unknown Service (00000050-0000-1000-8000-00805f9b34fb)
    - Unknown Characteristic [R] (00000051-0000-1000-8000-00805f9b34fb)
    Unknown Service (00000010-0000-1000-8000-00805f9b34fb)
    - Unknown Characteristic [R] (00000011-0000-1000-8000-00805f9b34fb)
    - Unknown Characteristic [R] (00000012-0000-1000-8000-00805f9b34fb)
    - Unknown Characteristic [R] (00000013-0000-1000-8000-00805f9b34fb)
    - Unknown Characteristic [R] (00000014-0000-1000-8000-00805f9b34fb)
    - Unknown Characteristic [R] (00000015-0000-1000-8000-00805f9b34fb)
    Unknown Service (00000090-0000-1000-8000-00805f9b34fb)
    - Unknown Characteristic [N R W] (00000091-0000-1000-8000-00805f9b34fb)
       Client Characteristic Configuration (0x2902)
    Unknown Service (00000080-0000-1000-8000-00805f9b34fb)
    - Unknown Characteristic [R] (00000081-0000-1000-8000-00805f9b34fb)
    SMP Service (8d53dc1d-1db7-4cd3-868b-8a527460aa84)
    - SMP Characteristic [N WNR] (da2e7828-fbce-4e01-ae9e-261174997c48)
       Client Characteristic Configuration (0x2902)
    D	13:43:05.501	gatt.setCharacteristicNotification(00002a05-0000-1000-8000-00805f9b34fb, true)
    D	13:43:05.503	gatt.setCharacteristicNotification(00002a19-0000-1000-8000-00805f9b34fb, true)
    D	13:43:05.504	gatt.setCharacteristicNotification(00000031-0000-1000-8000-00805f9b34fb, true)
    D	13:43:05.506	gatt.setCharacteristicNotification(00000032-0000-1000-8000-00805f9b34fb, true)
    D	13:43:05.508	gatt.setCharacteristicNotification(00000033-0000-1000-8000-00805f9b34fb, true)
    D	13:43:05.511	gatt.setCharacteristicNotification(00000034-0000-1000-8000-00805f9b34fb, true)
    D	13:43:05.512	gatt.setCharacteristicNotification(00000035-0000-1000-8000-00805f9b34fb, true)
    D	13:43:05.513	gatt.setCharacteristicNotification(00000036-0000-1000-8000-00805f9b34fb, true)
    D	13:43:05.514	gatt.setCharacteristicNotification(00000037-0000-1000-8000-00805f9b34fb, true)
    D	13:43:05.515	gatt.setCharacteristicNotification(00000038-0000-1000-8000-00805f9b34fb, true)
    D	13:43:05.516	gatt.setCharacteristicNotification(00000039-0000-1000-8000-00805f9b34fb, true)
    D	13:43:05.518	gatt.setCharacteristicNotification(00000091-0000-1000-8000-00805f9b34fb, true)
    I	13:43:05.562	Connection parameters updated (interval: 45.0ms, latency: 0, timeout: 5000ms)
    V	13:43:07.807	Starting pairing...
    D	13:43:07.807	device.createBond()
    D	13:43:07.839	[Broadcast] Action received: android.bluetooth.device.action.BOND_STATE_CHANGED, bond state changed to: BOND_BONDING (11)
    D	13:43:07.913	[Broadcast] Action received: android.bluetooth.device.action.PAIRING_REQUEST, pairing variant: PAIRING_VARIANT_CONSENT (3)
    I	13:43:09.074	Connection parameters updated (interval: 45.0ms, latency: 0, timeout: 420ms)
    D	13:43:11.609	[Broadcast] Action received: android.bluetooth.device.action.BOND_STATE_CHANGED, bond state changed to: BOND_BONDED (12)
    I	13:43:11.609	Device bonded
    V	13:43:19.849	Disconnecting...
    D	13:43:19.849	gatt.disconnect()
    D	13:43:19.868	[Callback] Connection state changed with status: 0 and new state: DISCONNECTED (0)
    I	13:43:19.868	Disconnected
    D	13:43:20.957	[Broadcast] Action received: android.bluetooth.device.action.ACL_DISCONNECTED
    D	13:44:01.343	gatt.close()
    D	13:44:01.344	wait(200)
    V	13:44:01.547	Connecting to 7C:FF:8C:D0:D0:6F...
    D	13:44:01.547	gatt = device.connectGatt(autoConnect = false, TRANSPORT_LE, preferred PHY = LE 1M)
    D	13:44:02.062	[Callback] Connection state changed with status: 133 and new state: DISCONNECTED (0)
    E	13:44:02.063	Error 133 (0x85): GATT ERROR
    I	13:44:02.063	Disconnected
    



    The device starts to advertise after reboot only there is already created bond. If not it waits for push button event.


Related