Tool/software:
Smartphone: Google Pixel 7 pro
During the connection of BLE with the device,
- First time it is Device is connecting well,
- Bonding also happening
- Read / Write characteristics also working
- Now I am disconnecting the Bluetooth
- After that if I am trying to reconnect, it is connected.
- Read / write characteristic i am checking that time "Error 133 (0x85): GATT ERROR" & "Error 22 (0x16): GATT CONN TERMINATE LOCAL HOST"
(Note: This issue happing after 1 or 2 approach randomly, not in first approach).
In log We have identify connection parameter is missing before read write (Please find the file attachment of log).
nRF Connect, 2025-01-21 Bench_Demo (46:B4:77:42:D1:6B) V 19:01:31.352 Connecting to 46:B4:77:42:D1:6B... D 19:01:31.353 gatt = device.connectGatt(autoConnect = false, TRANSPORT_LE, preferred PHY = LE 1M) D 19:01:32.005 [Callback] Connection state changed with status: 0 and new state: CONNECTED (2) I 19:01:32.005 Connected to 46:B4:77:42:D1:6B V 19:01:32.007 Discovering services... D 19:01:32.007 gatt.discoverServices() D 19:01:32.024 [Broadcast] Action received: android.bluetooth.device.action.ACL_CONNECTED I 19:01:32.377 Connection parameters updated (interval: 7.5ms, latency: 0, timeout: 5000ms) I 19:01:32.456 PHY updated (TX: LE Coded, RX: LE Coded) I 19:01:32.657 PHY updated (TX: LE Coded, RX: LE Coded) D 19:01:32.720 [Callback] Services discovered with status: 0 I 19:01:32.720 Services discovered V 19:01:32.735 Generic Access (0x1800) - Device Name [R W] (0x2A00) - Appearance [R W] (0x2A01) - Peripheral Preferred Connection Parameters [R] (0x2A04) - Central Address Resolution [R] (0x2AA6) - Resolvable Private Address Only [R] (0x2AC9) Generic Attribute (0x1801) - Service Changed [I] (0x2A05) Client Characteristic Configuration (0x2902) Device Information (0x180A) - System ID [R] (0x2A23) - Model Number String [R] (0x2A24) - Serial Number String [R] (0x2A25) - Firmware Revision String [R] (0x2A26) - Hardware Revision String [R] (0x2A27) - Software Revision String [R] (0x2A28) - Manufacturer Name String [R] (0x2A29) - IEEE 11073-20601 Regulatory Certification Data List [R] (0x2A2A) - PnP ID [R] (0x2A50) Unknown Service (48eb9001-f352-5fa0-9b06-8fcaa22602cf) - Unknown Characteristic [R W] (48eb9004-f352-5fa0-9b06-8fcaa22602cf) Client Characteristic Configuration (0x2902) Unknown Descriptor (00002800-0000-1000-8000-00805f9b34fb) - Unknown Characteristic [R] (48eb9005-f352-5fa0-9b06-8fcaa22602cf) Client Characteristic Configuration (0x2902) Unknown Descriptor (00002800-0000-1000-8000-00805f9b34fb) - Unknown Characteristic [W] (48eb9002-f352-5fa0-9b06-8fcaa22602cf) Client Characteristic Configuration (0x2902) Unknown Descriptor (00002800-0000-1000-8000-00805f9b34fb) - Unknown Characteristic [N] (48eb9003-f352-5fa0-9b06-8fcaa22602cf) Client Characteristic Configuration (0x2902) Unknown Descriptor (00002800-0000-1000-8000-00805f9b34fb) - Unknown Characteristic [R] (48eb9006-f352-5fa0-9b06-8fcaa22602cf) Client Characteristic Configuration (0x2902) D 19:01:32.735 gatt.setCharacteristicNotification(00002a05-0000-1000-8000-00805f9b34fb, true) D 19:01:32.738 gatt.setCharacteristicNotification(48eb9003-f352-5fa0-9b06-8fcaa22602cf, true) I 19:01:32.825 Connection parameters updated (interval: 30.0ms, latency: 0, timeout: 5000ms) V 19:01:34.953 Starting pairing... D 19:01:34.953 device.createBond() D 19:01:35.006 [Broadcast] Action received: android.bluetooth.device.action.BOND_STATE_CHANGED, bond state changed to: BONDING (11) D 19:01:35.375 [Broadcast] Action received: android.bluetooth.device.extra.PAIRING_VARIANT, pairing variant: CONSENT I 19:01:37.525 PHY updated (TX: LE Coded, RX: LE Coded) D 19:01:38.529 [Broadcast] Action received: android.bluetooth.device.action.BOND_STATE_CHANGED, bond state changed to: BONDED (12) I 19:01:38.529 Device bonded V 19:01:46.843 Writing request to characteristic 48eb9004-f352-5fa0-9b06-8fcaa22602cf D 19:01:46.843 gatt.writeCharacteristic(48eb9004-f352-5fa0-9b06-8fcaa22602cf, value=0x01) I 19:01:46.925 Data written to 48eb9004-f352-5fa0-9b06-8fcaa22602cf, value: (0x) 01 A 19:01:46.925 "(0x) 01" sent V 19:01:48.541 Reading characteristic 48eb9004-f352-5fa0-9b06-8fcaa22602cf D 19:01:48.541 gatt.readCharacteristic(48eb9004-f352-5fa0-9b06-8fcaa22602cf) I 19:01:48.605 Read Response received from 48eb9004-f352-5fa0-9b06-8fcaa22602cf, value: (0x) 01 A 19:01:48.605 "(0x) 01" received V 19:01:52.593 Disconnecting... D 19:01:52.593 gatt.disconnect() D 19:01:52.602 [Callback] Connection state changed with status: 0 and new state: DISCONNECTED (0) I 19:01:52.602 Disconnected D 19:01:53.638 [Broadcast] Action received: android.bluetooth.device.action.ACL_DISCONNECTED D 19:01:56.775 gatt.close() D 19:01:56.781 wait(200) V 19:01:56.983 Connecting to 46:B4:77:42:D1:6B... D 19:01:56.984 gatt = device.connectGatt(autoConnect = false, TRANSPORT_LE, preferred PHY = LE 1M) D 19:01:57.260 [Callback] Connection state changed with status: 0 and new state: CONNECTED (2) I 19:01:57.260 Connected to 46:B4:77:42:D1:6B D 19:01:57.260 wait(1600ms) D 19:01:57.278 [Broadcast] Action received: android.bluetooth.device.action.ACL_CONNECTED I 19:01:57.512 PHY updated (TX: LE 2M, RX: LE 2M) I 19:01:57.935 Connection parameters updated (interval: 7.5ms, latency: 0, timeout: 5000ms) I 19:01:58.067 PHY updated (TX: LE Coded, RX: LE Coded) I 19:01:58.356 Connection parameters updated (interval: 30.0ms, latency: 0, timeout: 5000ms) I 19:01:58.684 PHY updated (TX: LE Coded, RX: LE Coded) V 19:01:58.861 Discovering services... D 19:01:58.861 gatt.discoverServices() D 19:01:58.875 [Callback] Services discovered with status: 0 I 19:01:58.875 Services discovered V 19:01:58.892 Generic Access (0x1800) - Device Name [R W] (0x2A00) - Appearance [R W] (0x2A01) - Peripheral Preferred Connection Parameters [R] (0x2A04) - Central Address Resolution [R] (0x2AA6) - Resolvable Private Address Only [R] (0x2AC9) Generic Attribute (0x1801) - Service Changed [I] (0x2A05) Client Characteristic Configuration (0x2902) Device Information (0x180A) - System ID [R] (0x2A23) - Model Number String [R] (0x2A24) - Serial Number String [R] (0x2A25) - Firmware Revision String [R] (0x2A26) - Hardware Revision String [R] (0x2A27) - Software Revision String [R] (0x2A28) - Manufacturer Name String [R] (0x2A29) - IEEE 11073-20601 Regulatory Certification Data List [R] (0x2A2A) - PnP ID [R] (0x2A50) Unknown Service (48eb9001-f352-5fa0-9b06-8fcaa22602cf) - Unknown Characteristic [R W] (48eb9004-f352-5fa0-9b06-8fcaa22602cf) Client Characteristic Configuration (0x2902) Unknown Descriptor (00002800-0000-1000-8000-00805f9b34fb) - Unknown Characteristic [R] (48eb9005-f352-5fa0-9b06-8fcaa22602cf) Client Characteristic Configuration (0x2902) Unknown Descriptor (00002800-0000-1000-8000-00805f9b34fb) - Unknown Characteristic [W] (48eb9002-f352-5fa0-9b06-8fcaa22602cf) Client Characteristic Configuration (0x2902) Unknown Descriptor (00002800-0000-1000-8000-00805f9b34fb) - Unknown Characteristic [N] (48eb9003-f352-5fa0-9b06-8fcaa22602cf) Client Characteristic Configuration (0x2902) Unknown Descriptor (00002800-0000-1000-8000-00805f9b34fb) - Unknown Characteristic [R] (48eb9006-f352-5fa0-9b06-8fcaa22602cf) Client Characteristic Configuration (0x2902) D 19:01:58.892 gatt.setCharacteristicNotification(00002a05-0000-1000-8000-00805f9b34fb, true) D 19:01:58.896 gatt.setCharacteristicNotification(48eb9003-f352-5fa0-9b06-8fcaa22602cf, true) I 19:01:59.284 PHY updated (TX: LE Coded, RX: LE Coded) I 19:01:59.744 PHY updated (TX: LE Coded, RX: LE Coded) I 19:02:03.457 Connection parameters updated (interval: 120.0ms, latency: 0, timeout: 1000ms) V 19:02:08.567 Writing request to characteristic 48eb9004-f352-5fa0-9b06-8fcaa22602cf D 19:02:08.567 gatt.writeCharacteristic(48eb9004-f352-5fa0-9b06-8fcaa22602cf, value=0x02) I 19:02:08.737 Data written to 48eb9004-f352-5fa0-9b06-8fcaa22602cf, value: (0x) 02 A 19:02:08.737 "(0x) 02" sent V 19:02:14.243 Reading characteristic 48eb9004-f352-5fa0-9b06-8fcaa22602cf D 19:02:14.243 gatt.readCharacteristic(48eb9004-f352-5fa0-9b06-8fcaa22602cf) I 19:02:14.496 Read Response received from 48eb9004-f352-5fa0-9b06-8fcaa22602cf, value: (0x) 02 A 19:02:14.496 "(0x) 02" received V 19:02:17.536 Disconnecting... D 19:02:17.536 gatt.disconnect() D 19:02:17.543 [Callback] Connection state changed with status: 0 and new state: DISCONNECTED (0) I 19:02:17.543 Disconnected D 19:02:18.601 [Broadcast] Action received: android.bluetooth.device.action.ACL_DISCONNECTED D 19:02:19.828 gatt.close() D 19:02:19.831 wait(200) V 19:02:20.032 Connecting to 46:B4:77:42:D1:6B... D 19:02:20.032 gatt = device.connectGatt(autoConnect = false, TRANSPORT_LE, preferred PHY = LE 1M) D 19:02:20.687 [Callback] Connection state changed with status: 0 and new state: CONNECTED (2) I 19:02:20.687 Connected to 46:B4:77:42:D1:6B D 19:02:20.688 wait(1600ms) D 19:02:20.712 [Broadcast] Action received: android.bluetooth.device.action.ACL_CONNECTED V 19:02:22.288 Discovering services... D 19:02:22.288 gatt.discoverServices() D 19:02:22.294 [Callback] Services discovered with status: 0 I 19:02:22.294 Services discovered V 19:02:22.300 Generic Access (0x1800) - Device Name [R W] (0x2A00) - Appearance [R W] (0x2A01) - Peripheral Preferred Connection Parameters [R] (0x2A04) - Central Address Resolution [R] (0x2AA6) - Resolvable Private Address Only [R] (0x2AC9) Generic Attribute (0x1801) - Service Changed [I] (0x2A05) Client Characteristic Configuration (0x2902) Device Information (0x180A) - System ID [R] (0x2A23) - Model Number String [R] (0x2A24) - Serial Number String [R] (0x2A25) - Firmware Revision String [R] (0x2A26) - Hardware Revision String [R] (0x2A27) - Software Revision String [R] (0x2A28) - Manufacturer Name String [R] (0x2A29) - IEEE 11073-20601 Regulatory Certification Data List [R] (0x2A2A) - PnP ID [R] (0x2A50) Unknown Service (48eb9001-f352-5fa0-9b06-8fcaa22602cf) - Unknown Characteristic [R W] (48eb9004-f352-5fa0-9b06-8fcaa22602cf) Client Characteristic Configuration (0x2902) Unknown Descriptor (00002800-0000-1000-8000-00805f9b34fb) - Unknown Characteristic [R] (48eb9005-f352-5fa0-9b06-8fcaa22602cf) Client Characteristic Configuration (0x2902) Unknown Descriptor (00002800-0000-1000-8000-00805f9b34fb) - Unknown Characteristic [W] (48eb9002-f352-5fa0-9b06-8fcaa22602cf) Client Characteristic Configuration (0x2902) Unknown Descriptor (00002800-0000-1000-8000-00805f9b34fb) - Unknown Characteristic [N] (48eb9003-f352-5fa0-9b06-8fcaa22602cf) Client Characteristic Configuration (0x2902) Unknown Descriptor (00002800-0000-1000-8000-00805f9b34fb) - Unknown Characteristic [R] (48eb9006-f352-5fa0-9b06-8fcaa22602cf) Client Characteristic Configuration (0x2902) D 19:02:22.300 gatt.setCharacteristicNotification(00002a05-0000-1000-8000-00805f9b34fb, true) D 19:02:22.302 gatt.setCharacteristicNotification(48eb9003-f352-5fa0-9b06-8fcaa22602cf, true) V 19:02:29.990 Writing request to characteristic 48eb9004-f352-5fa0-9b06-8fcaa22602cf D 19:02:29.990 gatt.writeCharacteristic(48eb9004-f352-5fa0-9b06-8fcaa22602cf, value=0x03) E 19:02:59.997 Error 133 (0x85): GATT ERROR D 19:02:59.999 [Callback] Connection state changed with status: 22 and new state: DISCONNECTED (0) E 19:02:59.999 Error 22 (0x16): GATT CONN TERMINATE LOCAL HOST I 19:02:59.999 Disconnected D 19:03:00.065 [Broadcast] Action received: android.bluetooth.device.action.ACL_DISCONNECTED
The screenshot of log is attached below,
So could you please guide us to where we can check in code for this problem.