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

Connection issues with Android smartphones

Hi everybody,

I have developed a BLE sensor based on nRF52840 (S140 6.1.1 and SDK 15.3.0) that is normally performing connectable scannable undirected advertising. Since I have to maximise the throughput over connection, 2M PHY is used and DLE is enabled.
With some smartphones there are no problems at all, but with some others (Samsung Galaxy A6 with Android 10, Samsung S8 with Android 9, OnePlus One with Android 9) it is really hard to establish a connection (say only one attempt out of four would be successful). Errors shown by nRF Connect are Error 8 (0x8): GATT CONN TIMEOUT and Error 133 (0x85): GATT ERROR.

I've been looking for possible solutions in this forum and it looks like it is quite common to encounter these kind of errors with Samsung devices.

(1) Can you confirm that?


This post (quite old) is mentioning a workaround involving the use of compatibilty mode 2. I've tried to add it to my code but seems like only compatibility mode 1 is available in SDK 15.3.0, then I have edited the code snippet as follows:

ble_opt_t ble_opt;
memset(&ble_opt, 0, sizeof(ble_opt));

ble_opt.gap_opt.compat_mode_1.enable = 1;

err_code = sd_ble_opt_set(BLE_GAP_OPT_COMPAT_MODE_1, &ble_opt); 
APP_ERROR_CHECK(err_code);

(2) Is this correct?

(3) Why has compatibility mode 2 been removed/replaced?

It is also suggested (in the above mentioned post and in other posts) to disable DLE to avoid these kind of issues.

(4) Does this mean that in applications where DLE is required there is no alternative solution but to be patient and retry until a successful connection?

(5) Finally, if after tests comes out that DLE really is the problem, would it be possible (for other applications) to enable/disable it at run time through a BLE command, and which functions should be used?

 

Thank you for your help

Lorenzo

  • About question (2), I can already say there's something wrong because with this modification the device does not work at all (keeps rebooting immediately).

  • Hi Lorenzo

    The 2MBPS PHY is a BLE 5.0 feature, and from what I can see the OnePlus One and Samsung Galaxy A6 does not support Bluetooth 5.0, which would explain why you might see these errors there. For the Samsung Galaxy S8 I'm not sure what could cause this, but yes, The GATT ERROR (0x85) is a rather common Android error that can be caused by multiple things.

    Do you see these errors if you use the 1MBPS PHY and/or disable DLE on your nRF application for instance?

    2. I don't think compatibility mode will do anything for you I'm afraid, as what Sigurd mentions here is not very relevant in later products.

    3. Compatibility mode 2 was removed from SoftDevice v5.0.0 as we added support for overlapping procedures, and this is enabled by default in the later SoftDevice versions and should take care of this issue.

    4. I'm guessing that (at least two of) your devices are not supporting DLE which would cause issues. Are you able to take a sniffer trace of the connection to see if there is a connection parameter update on successful connections where DLE/2MBPS is disabled.

    5. Are you using nRFConnect app for Android or the Bluetooth settings to connect to your device? I think the nRFConnect app should disable DLE by default if it's not supported, so that might not be the issue at all. Are you testing on a DK or on custom HW design? Are you able to reproduce this issue with a Development kit as the peripheral?

    Best regards,

    Simon

    Side note: GATT error 133 is an infamous issue on Android and happens more often in older Android devices (older than Android 8.0), and some Samsung phones. The suggested workaround here is to add delays/retries when connecting to a device on the Android side.

  • Hi Simonr,

    thanks a lot for your reply. We could try to disable DLE and use 1MBPS PHY but since the problem is only occuring with those particular smartphones and our application needs both features, the best thing at this time is to change the smartphones Slight smile

    Knowing this issue though it is probably better to disable DLE and 2MBPS PHY for general purpose applications where they're not necessary.

    Thank you!

Related