question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Frequent GATT errors

See original GitHub issue

Information This GitHub Issue page is for reporting issues or asking questions regarding the iOS DFU library. For general DFU questions, SDK questions, etc, please check our DevZone. Make sure you are using the latest version of the library: Download Also, before creating a new issue, make sure similar issue isn’t already opened in open or closed issues.

DFU Bootloader version (please complete the following information):

  • SDK version: don’t know; the firmware was provided by a 3rd party.
  • Bonding used: no
  • Library version: 1.11.1

Device information (please complete the following information):

  • Device: various (including Pixel 2, OnePlus 3)
  • OS: various (including 9.0, 11.0)

Describe the bug Firmware updates frequently fail on some devices, when using library version 1.11.1.
DfuProgressListener.onError() is called with error=133, errorType=1, message="GATT ERROR"

This happens more frequently on some devices than on others. Note that this seems to be a new issue in library version 1.11.1; I have not been able to reproduce it with versions 1.11.0 or 1.10.4.

I ran multiple firmware updates one after the other on several devices to test: On a Pixel 2, the error happened 5/10 times. On a OnePlus 3, it happened 1/12 times. One a Samsung Galaxy S10 it happened 0/10 times.

Logs

In the log below, note the line:

Scanning for new address finished with: null

The address is only null when the error occurs.

18:21:32.134 I/DfuBaseService: DFU service created. Version: 1.11.1
18:21:32.153 I/DfuBaseService: Starting DFU service in foreground
18:21:32.160 W/DfuBaseService: getNotificationTarget() should not return null if the service is to be started as a foreground service
18:21:32.238 I/DfuBaseService: Connecting to the device...
18:21:32.239 D/BluetoothGatt: connect() - device: EC:5E:29:62:B5:E8, auto: false
18:21:32.239 D/BluetoothGatt: registerApp()
18:21:32.240 D/BluetoothGatt: registerApp() - UUID=cd0731c0-ae04-40cf-be2c-4f897b4cff57
18:21:32.242 D/BluetoothGatt: onClientRegistered() - status=0 clientIf=10
18:21:32.243 D/BluetoothGatt: onClientConnectionState() - status=0 clientIf=10 device=EC:5E:29:62:B5:E8
18:21:32.243 I/DfuBaseService: Connected to GATT server
18:21:32.244 D/BluetoothGatt: discoverServices() - device: EC:5E:29:62:B5:E8
18:21:32.245 I/DfuBaseService: Attempting to start service discovery... succeed
18:21:32.249 D/BluetoothGatt: onSearchComplete() = Device=EC:5E:29:62:B5:E8 Status=0
18:21:32.249 I/DfuBaseService: Services discovered
18:21:32.252 I/DfuImpl: Buttonless service without bond sharing found -> SDK 13 or newer
18:21:33.257 I/DfuImpl: Enabling indications...
18:21:33.267 D/BluetoothGatt: setCharacteristicNotification() - uuid: 8ec90003-f315-4f60-9fb8-838830daea50 enable: true
18:21:34.263 D/BluetoothGatt: onConnectionUpdated() - Device=FA:E2:8E:ED:62:77 interval=18 latency=0 timeout=400 status=0
18:21:34.302 I/DfuImpl: Sending Enter Bootloader (Op Code = 1)
18:21:34.352 I/DfuImpl: Response received (Op Code = 1, Status = 1)
18:21:35.860 V/FA: Inactivity, disconnecting from the service
18:21:38.384 D/BluetoothGatt: onClientConnectionState() - status=8 clientIf=10 device=EC:5E:29:62:B5:E8
18:21:38.385 W/DfuBaseService: Target device disconnected with status: 8
18:21:38.386 D/BluetoothGatt: onClientConnectionState() - status=8 clientIf=11 device=EC:5E:29:62:B5:E8
18:21:38.389 W/focusmotion.tk: Accessing hidden method Landroid/bluetooth/BluetoothGatt;->refresh()Z (greylist, reflection, allowed)
18:21:38.389 D/BluetoothGatt: refresh() - device: EC:5E:29:62:B5:E8
18:21:38.391 D/BluetoothGatt: setCharacteristicNotification() - uuid: 1cac0003-656e-696c-4b5f-6e6572726157 enable: false
18:21:38.391 I/DfuBaseService: Refreshing result: true
18:21:38.391 I/DfuBaseService: Cleaning up...
18:21:38.395 D/BluetoothGatt: cancelOpen() - device: EC:5E:29:62:B5:E8
18:21:38.397 I/FM: FM INFO: io.focusmotion.ptsdk.Device$Companion: "Sensoria-C1-1D43" connected: false
18:21:38.400 D/BluetoothGatt: close()
18:21:38.400 D/BluetoothGatt: unregisterApp() - mClientIf=10
18:21:38.401 I/DfuImpl: Restarting to bootloader mode
18:21:38.402 I/FM: FM INFO: DeviceService: DeviceService: device 0: Sensoria-C1-1D43
18:21:38.407 I/FM: FM INFO: DeviceService:   storing serial DE35017C12E84212
18:21:38.411 D/BluetoothAdapter: isLeEnabled(): ON
18:21:38.411 I/FM: FM INFO: DeviceService: DeviceService: device 1: Sensoria-C1-A0A1
18:21:38.413 D/BluetoothLeScanner: onScannerRegistered() - status=0 scannerId=10 mScannerId=0
18:21:38.414 I/FM: FM INFO: DeviceService:   storing serial 3FE44A921EBC570C
18:21:38.417 I/DfuBaseService: Action received: android.bluetooth.device.action.ACL_DISCONNECTED
18:21:38.539 D/BluetoothGatt: cancelOpen() - device: EC:5E:29:62:B5:E8
18:21:38.541 D/BluetoothGatt: close()
18:21:38.541 D/BluetoothGatt: unregisterApp() - mClientIf=11
18:21:43.411 D/BluetoothAdapter: isLeEnabled(): ON
18:21:43.419 I/DfuImpl: Scanning for new address finished with: null
18:21:43.444 I/DfuBaseService: Starting DFU service in foreground
18:21:43.445 W/DfuBaseService: getNotificationTarget() should not return null if the service is to be started as a foreground service
18:21:45.465 I/DfuBaseService: Connecting to the device...
18:21:45.472 D/BluetoothGatt: connect() - device: EC:5E:29:62:B5:E8, auto: false
18:21:45.474 D/BluetoothGatt: registerApp()
18:21:45.477 D/BluetoothGatt: registerApp() - UUID=770bfdbf-ef2d-4c88-bb52-83059fa322bf
18:21:45.480 D/BluetoothGatt: onClientRegistered() - status=0 clientIf=11
18:22:15.488 D/BluetoothGatt: onClientConnectionState() - status=133 clientIf=11 device=EC:5E:29:62:B5:E8
18:22:15.489 E/DfuBaseService: Connection state change error: 133 newState: 0
18:22:15.490 I/DfuBaseService: Connection error after: 30025 ms
18:22:15.490 E/DfuBaseService: Device not reachable. Check if the device with address EC:5E:29:62:B5:E8 is in range, is advertising and is connectable
18:22:15.491 I/DfuBaseService: Attempt: 1
18:22:15.493 D/BluetoothGatt: refresh() - device: EC:5E:29:62:B5:E8
18:22:15.495 I/DfuBaseService: Refreshing result: true
18:22:15.495 I/DfuBaseService: Cleaning up...
18:22:15.497 D/BluetoothGatt: cancelOpen() - device: EC:5E:29:62:B5:E8
18:22:15.500 D/BluetoothGatt: close()
18:22:15.500 D/BluetoothGatt: unregisterApp() - mClientIf=11
18:22:15.502 I/DfuBaseService: Restarting the service
18:22:15.515 I/DfuBaseService: Starting DFU service in foreground
18:22:15.516 W/DfuBaseService: getNotificationTarget() should not return null if the service is to be started as a foreground service
18:22:17.531 I/DfuBaseService: Connecting to the device...
18:22:17.537 D/BluetoothGatt: connect() - device: EC:5E:29:62:B5:E8, auto: false
18:22:17.537 D/BluetoothGatt: registerApp()
18:22:17.541 D/BluetoothGatt: registerApp() - UUID=55fcb7bf-8046-4c28-8bc1-b9c1a6645d28
18:22:17.547 D/BluetoothGatt: onClientRegistered() - status=0 clientIf=10
18:22:47.552 D/BluetoothGatt: onClientConnectionState() - status=133 clientIf=10 device=EC:5E:29:62:B5:E8
18:22:47.553 E/DfuBaseService: Connection state change error: 133 newState: 0
18:22:47.554 I/DfuBaseService: Connection error after: 30023 ms
18:22:47.554 E/DfuBaseService: Device not reachable. Check if the device with address EC:5E:29:62:B5:E8 is in range, is advertising and is connectable
18:22:47.555 I/DfuBaseService: Attempt: 2
18:22:47.557 D/BluetoothGatt: refresh() - device: EC:5E:29:62:B5:E8
18:22:47.559 I/DfuBaseService: Refreshing result: true
18:22:47.559 I/DfuBaseService: Cleaning up...
18:22:47.561 D/BluetoothGatt: cancelOpen() - device: EC:5E:29:62:B5:E8
18:22:47.562 D/BluetoothGatt: close()
18:22:47.563 D/BluetoothGatt: unregisterApp() - mClientIf=10
18:22:47.563 I/DfuBaseService: Restarting the service
18:22:47.579 I/DfuBaseService: Starting DFU service in foreground
18:22:47.580 W/DfuBaseService: getNotificationTarget() should not return null if the service is to be started as a foreground service
18:22:49.598 I/DfuBaseService: Connecting to the device...
18:22:49.603 D/BluetoothGatt: connect() - device: EC:5E:29:62:B5:E8, auto: false
18:22:49.605 D/BluetoothGatt: registerApp()
18:22:49.608 D/BluetoothGatt: registerApp() - UUID=3cd80b94-97e9-4637-8f20-204c4d187d2e
18:22:49.616 D/BluetoothGatt: onClientRegistered() - status=0 clientIf=10
18:23:19.620 D/BluetoothGatt: onClientConnectionState() - status=133 clientIf=10 device=EC:5E:29:62:B5:E8
18:23:19.620 E/DfuBaseService: Connection state change error: 133 newState: 0
18:23:19.620 I/DfuBaseService: Connection error after: 30024 ms
18:23:19.621 E/DfuBaseService: Device not reachable. Check if the device with address EC:5E:29:62:B5:E8 is in range, is advertising and is connectable
18:23:19.621 I/DfuBaseService: Attempt: 3
18:23:19.623 D/BluetoothGatt: refresh() - device: EC:5E:29:62:B5:E8
18:23:19.623 I/DfuBaseService: Refreshing result: true
18:23:19.623 I/DfuBaseService: Cleaning up...
18:23:19.624 D/BluetoothGatt: cancelOpen() - device: EC:5E:29:62:B5:E8
18:23:19.625 D/BluetoothGatt: close()
18:23:19.625 D/BluetoothGatt: unregisterApp() - mClientIf=10
18:23:20.301 8831-8831/io.focusmotion.tkr I/DfuBaseService: DFU service destroyed

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:17 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
QuentinFarizoncommented, Oct 8, 2021

I’ve rollbacked to 1.11.0 since mid-august and did not encounter any customer issue since. In particular it fixed the issue on a customer’s Oppo phone.

1reaction
QuentinFarizoncommented, Jan 20, 2022

It’s difficult to test because it’s happening only on specific devices (1% of our customers).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Android 10: GATT error with 133 - how fix? - Stack Overflow
1 Answer 1 ... As seen in the AOSP constants, this error is the most generic error you can get. Generally, it happens...
Read more >
Android Ble GATT ERROR 133 getting often with samsung ...
I am getting the GATT Error 133 in Samsung Devices alone(Samsung A5 2016). Trying to connect 10 times it gets connected only 2...
Read more >
Error codes - v2.13 - Bluetooth API Documentation Silicon Labs
GATT connection is closed due procedure timeout. Bonding procedure can't be started because device has no space left for bond. The bonding does...
Read more >
App shows "Error 257" or "GATT Error" – Motowatch - Support
App shows "Error 257" or "GATT Error" · The Bluetooth connection between your phone and the watch is stable. · Your Moto Watch...
Read more >
Connect to a GATT server - Android Developers
Handling a false return value from the initialize() function depends on your application. You could show an error message to the user indicating ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found