Android-DFU-Library: 133 errors

Hello

I’m getting a lot of the GATT 133 errors when trying to do a DFU. We’ve implemented the buttonless DFU and it works perfectly on IOS, but I keep getting the 133 in the DFUService. See attached logs: Any hints on what can be done to minimise this issue?

10-31 18:46:29.557 31469-31469/xxx D/BluetoothGatt: close()
10-31 18:46:29.567 31469-31469/xxx D/BluetoothGatt: unregisterApp() - mClientIf=9
10-31 18:46:30.037 31469-31469/xxx I/DfuService: DfuService onCreate
10-31 18:46:32.087 31469-31748/xxx I/DfuBaseService: Connecting to the device...
10-31 18:46:32.087 31469-31748/xxx D/BluetoothGatt: connect() - device: CD:B0:6F:A2:39:6E, auto: false
10-31 18:46:32.097 31469-31748/xxx D/BluetoothGatt: registerApp()
10-31 18:46:32.097 31469-31748/xxx D/BluetoothGatt: registerApp() - UUID=991273b2-06c7-4c4b-b129-c3282904c6e7
10-31 18:46:32.137 31469-31496/xxx D/BluetoothGatt: onClientRegistered() - status=0 clientIf=9
10-31 18:46:32.537 31469-31481/xxx D/BluetoothGattServer: onServerConnectionState() - status=0 serverIf=8 device=CD:B0:6F:A2:39:6E
10-31 18:46:32.537 31469-31481/xxx D/BluetoothGattServer: Server disconnected, update device to list
10-31 18:46:32.547 31469-31481/xxx D/AppManager: Server onConnectionStateChange DISCONNECTED DFU-H41J Address: CD:B0:6F:A2:39:6E
10-31 18:46:32.547 31469-31480/xxx D/BluetoothGatt: onClientConnectionState() - status=133 clientIf=9 device=CD:B0:6F:A2:39:6E
10-31 18:46:32.557 31469-31480/xxx E/DfuBaseService: Connection state change error: 133 newState: 0
10-31 18:46:32.557 31469-31748/xxx E/DfuBaseService: Device got disconnected before service discovery finished
10-31 18:46:32.567 31469-31748/xxx D/BluetoothGatt: refresh() - device: CD:B0:6F:A2:39:6E
10-31 18:46:32.567 31469-31748/xxx I/DfuBaseService: Refreshing result: true
10-31 18:46:32.567 31469-31748/xxx I/DfuBaseService: Cleaning up...
10-31 18:46:32.567 31469-31748/xxx D/BluetoothGatt: close()
10-31 18:46:32.577 31469-31748/xxx D/BluetoothGatt: unregisterApp() - mClientIf=9
10-31 18:46:33.257 31469-31469/xxx I/DfuService: DfuService onDestroy

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 4
  • Comments: 17 (4 by maintainers)

Most upvoted comments

Hello, I just discovered one thing that had a major impact on the amount of 133 errors we got while doing DFU. As you mention over the problem might be correlated with connection parameters and many before has mentioned that 133’s can origin from timing issues.

What we saw was that after sending the necessary commands to put the device in bootloader modus and disconnecting, the act of connecting to the “new” (changed mac-address) device would randomly fail. After a full day of BLE sniffing and debugging I realised that when the connection failed, with an 133 error, Android had not sent any connection request over the air, so the whole “could not connect” or “got disconnected before service discovery” was generated internally in Android.

The solution that I tried was to do a short scan before trying to connect. I didn’t care about the scan results, this was just a way to put the Bluetooth radio in another state. And it seems to work.

So the procedure is as follows:

  1. Write to the buttonless dfu service and make the device reboot into boot loader modus
  2. After getting the disconnected callback in android, do a short (500-1000ms) scan.
  3. Start the Nordic DFU service with the new mac-address.
  4. Wait for DFU to successfully complete.

This might help some others struggling with the same error. Please let me know if anyone has more info regarding this issue.

Yeah, thats the big problem, it happens quite frequently. Like over 50% of the time. Any ideas what triggers this behaviour?

it happens once in a while for me aswell i guess nothing we can do about that for now. is it frequent ?