This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Android GATT 133 error

Hi. I'm using nRF52832, SDK13.0.0, S132.

First of all, I already know this Q has lots of Q and A.

But I'm so confused which case do I pick.

In my case, iPhone has no problem with connection and disconnection.

But only Android has problems.

1. Connection : Andoird phone hardly connect my device. It returns GATT error 133.

After application try more(3~4 times more), it connects.

2. Disconnection : After making connection, if Android apllication start 'disconnect', it takes 30 senconds around to get 'disconnected'

If my device start 'disconnect', connection is disconnected immediately.

Could you give me an advice?

  • Hi,

    This is a known issue with Android, we have had similiar issues where error 133 is returned. In those case we had sniffer traces, and saw that the phone first sent a LL_VERSION_IND and then it sent a LL_FEATURE_REQ before the peripheral had sent its LL_VERSION_IND. In other words, the phone initiated a seconds LL Control Procedure before the first is finished, and this is a clear violation of the Bluetooth specification. The SoftDevice will disconnect at this point.

    The Bluetooth Specification Version 4.2 [Vol 6, Part B] Chapter 5 (page 2634), the second paragraph states the following:

    "...For all other Link Layer Control Procedures, only one Link Layer Control Procedure shall be initiated in the Link Layer at a time per connection per device. A new Link Layer Control Procedure can be initiated only after a previous Link Layer Control Procedure has completed. ..."

    Can you try the sniffer and see if this is the case for you too?

    To solve this issue we added Compatibility mode 2 to the softdevice.

    So If your case turns out to be the same you can enable Compatibility Mode 2 by adding this: 

     

    ble_opt_t ble_opt;
    
    memset(&ble_opt, 0, sizeof(ble_opt));
    
    ble_opt.gap_opt.compat_mode_2.enable = 1;
    
    err_code = sd_ble_opt_set(BLE_GAP_OPT_COMPAT_MODE_2,&ble_opt);
    
    APP_ERROR_CHECK(err_code);
     

  • Hello Mttrinh,

    Compat mode 2 doesn't seem to be present in s132 6.0. Is there another way to invoke it in 6.0?

    Thanks, Howard

  • Hi,

    This compatibility mode was removed for the s132 5.0.0 when we added support for overlapping procedures. So this should be enabled by default in the SoftDevice. For most LL control procedures, if the peer has initiated a procedure and then initiates one of the simple procedures (either version ind, feature req or LE ping) the SoftDevice handles the overlapping procedures.

  • The question came up as part of a hunt for a workaround when using a Moto Android. Has the root cause of the Moto and Error 133 GATT been identified?

Related