Communication with an unpaired weara fails at 133 as shown below.

Unable to connect to Bonded weara with GATT 133 error.
Currently, there is only one solution, turning on and off Bluetooth in the OS, which temporarily improves the connection but does not fundamentally solve the problem.

10-21 10:17:05:257 D/PairingDeviceSearchFragment(2) : performPairing
10-21 10:17:05:260 D/PairingViewModel(2) : connect
10-21 10:17:05:268 D/wearamanager(26280) : startConnecting:D5:F7:74:DE:3C:6E <<<<====
10-21 10:17:05:272 D/wearamanager(26280) : connectDevice null
10-21 10:17:05:274 D/wearamanager(26280) : connectDeviceForMacAddress
10-21 10:17:05:286 D/wearamanager(26283) : timer bondState null
10-21 10:17:05:289 D/wearamanager(26283) : timer bondState null
10-21 10:17:05:290 D/wearamanager(26281) : connectDeviceForMacAddress device RxBleDeviceImpl{MAC='D5:F7:74:DE:3C:6E', name=weara}
10-21 10:17:05:291 D/wearamanager(26281) : connectDeviceForMacAddress device.connectionState null
10-21 10:17:05:294 D/wearamanager(26281) : connectDeviceForMacAddress device.bluetoothDevice.bondState null
10-21 10:17:05:296 D/wearamanager(26281) : performBond
10-21 10:17:05:322 D/wearamanager(26281) : observeConnectionStateForBond
10-21 10:17:05:323 D/wearamanager(26281) : observeConnectionStateForBond set
10-21 10:17:05:375 D/wearamanager(26287) : observeConnectionStateForBond RxBleConnectionState{CONNECTING}
10-21 10:17:07:079 D/NotificationPosted:(2) : com.weara
10-21 10:17:09:367 D/NotificationPosted:(2) : com.weara
10-21 10:17:10:285 D/wearamanager(26283) : timer bondState RxBleConnectionState{CONNECTING}
10-21 10:17:10:304 D/wearamanager(26283) : timer bondState 10
10-21 10:17:10:422 E/wearamanager(26288) : connectionObservable com.polidea.rxandroidble2.exceptions.BleDisconnectedException: Disconnected from MAC='D5:F7:74:DE:3C:6E' with status 133 (GATT_ERROR) <<<<==== コネクト失敗

  • Hi

    Do you think you can fill me in on what "weara" is, as Google doesn't seem to find anything BLE related? I'm guessing it is some kind of wearable device. Is it running an Android version? Is the other device that's trying to connect to it an nRF52 DK or a custom board that you've made?

    Best regards,

    Simon

  • Hi, Simonr

    Thank you for your quick reply and I'm sorry for the lack of information.

    Yes, it is about a wearable device product as you guessed.

    We face this GATT_ERROR regardless of the Android version I think. At least it is happening at the following devices:

    - Nexus with Android 8
    - XPERIA with Android 9
    - Pixel with Android 10

    After we face the GATT_ERROR, it is not possible to solve the error when connecting, by disabling and enabling the Smartphone Bluetooth setting. 

    I will try using the DK to know the detail, but if you have something that might help us to understand the GATT_ERROR, we would appreciate anything.

    Thank you,

  • Hi

    And I assume this wearable device use an nRF52832 for BLE communication? Does the nRF52 device you're using have an external LF clock or not? If not, please make sure that the clock configs in sdk_config.h are set to these values.

    // <o> NRF_SDH_CLOCK_LF_SRC  - SoftDevice clock source.
     
    // <0=> NRF_CLOCK_LF_SRC_RC 
    // <1=> NRF_CLOCK_LF_SRC_XTAL 
    // <2=> NRF_CLOCK_LF_SRC_SYNTH 
    
    #ifndef NRF_SDH_CLOCK_LF_SRC
    #define NRF_SDH_CLOCK_LF_SRC 0
    #endif
    
    // <o> NRF_SDH_CLOCK_LF_RC_CTIV - SoftDevice calibration timer interval. 
    #ifndef NRF_SDH_CLOCK_LF_RC_CTIV
    #define NRF_SDH_CLOCK_LF_RC_CTIV 16
    #endif
    
    // <o> NRF_SDH_CLOCK_LF_RC_TEMP_CTIV - SoftDevice calibration timer interval under constant temperature. 
    // <i> How often (in number of calibration intervals) the RC oscillator shall be calibrated
    // <i>  if the temperature has not changed.
    
    #ifndef NRF_SDH_CLOCK_LF_RC_TEMP_CTIV
    #define NRF_SDH_CLOCK_LF_RC_TEMP_CTIV 4
    #endif
    
    // <o> NRF_SDH_CLOCK_LF_ACCURACY  - External clock accuracy used in the LL to compute timing.
     
    // <0=> NRF_CLOCK_LF_ACCURACY_250_PPM 
    // <1=> NRF_CLOCK_LF_ACCURACY_500_PPM 
    // <2=> NRF_CLOCK_LF_ACCURACY_150_PPM 
    // <3=> NRF_CLOCK_LF_ACCURACY_100_PPM 
    // <4=> NRF_CLOCK_LF_ACCURACY_75_PPM 
    // <5=> NRF_CLOCK_LF_ACCURACY_50_PPM 
    // <6=> NRF_CLOCK_LF_ACCURACY_30_PPM 
    // <7=> NRF_CLOCK_LF_ACCURACY_20_PPM 
    // <8=> NRF_CLOCK_LF_ACCURACY_10_PPM 
    // <9=> NRF_CLOCK_LF_ACCURACY_5_PPM 
    // <10=> NRF_CLOCK_LF_ACCURACY_2_PPM 
    // <11=> NRF_CLOCK_LF_ACCURACY_1_PPM 
    
    #ifndef NRF_SDH_CLOCK_LF_ACCURACY
    #define NRF_SDH_CLOCK_LF_ACCURACY 0
    #endif

    The GATT_ERROR 133 is a rather famous Android error. What application are you using for Bluetooth communication on the Android side? It isn't as common anymore on more recent Android devices, but still sometimes happens unfortunately.

    The easiest way to get around this, is generally to add a delay of a few ms when connecting to a device (before connecting through GATT). If you're using the Android BLE library to develop your Android application I'd recommend adding a few retries upon connection failures, as that usually solves this issue.

    Best regards,

    Simon

Related