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

The Android app still disconnect to the device, when device connect to 8 peripherals

 My project is base on ble_app_hrs_rscs_relay in nRF5_SDK_15.2.0_9412b96. It works as central and peripheral. When it works as central, it can connect 8 peripherals. And when it works as peripheral it can be connected with smart phone APP.

The issue is after it connects 8 peripherals, the Android APP will frequently disconnect immediately after establishing the connection. The reason of disconnection is connection timeout. BUt at the same situation, the IOS APP connect it well.

It seems that the more peripherals it connect, the more frequently disconnected from Android APP.

The BU connected 8 appliances android.pcapng and Disconnect.png are the log of sniffer and nRF connect for the Android system. And the device connected 8 peripherals.

The BU connected 8 appliances IOS.pcapng is the sniffer file for the IOS system. And the device connected 8 peripherals.

The BU does not connect to appliances.pcapng is the sniffer file for the android system. And the device doesn't connect any peripherals.

How can I fix this issue. Thank you!

BU connected 8 appliances android.pcapngBU connected 8 appliances IOS.pcapngBU does not connect to appliances.pcapng

Parents
  • Hi David, 
    Could you let me know which Android device you were testing with ? 

    The trace you have for Android looked a little bit strange. When there is a disconnection of timeout, I don't see the central tried to re-transmit packet before the disconnection. It simply stopped which is pretty strange. 

    You mentioned that you also saw the disconnection even when the BU does not connect to any peripheral. Do you have the same issue if you connect to a simple BLE application for example ble_app_hrs or ble_app_rscs (not the relay) ? 

  • Hi Hung Bui,

       My phone model is XIaoMi M1808D2TE. The device information in  nRF connect  is Device name :MI 8 Lite; Android Version 9; Manufacturer: Xiaomi; Model: MI 8 Lite; Build version: PKQ1.181007.001; Board :sdm660; Product: platina.

    I mean when BU doesn't connect any peripherals, the android APP will easy connect to BU successfully and  not disconnect.

    If the android APP (nRF Connect) connect to  ble_app_hrs, it is OK. 

    The same issue with other model XiaoMi.

  • Thanks David,

    I found that the sniffer traces didn't show all the communication due to the connection was switched to 2Mbps and the sniffer can't sniff 2Mbps communication. 

    You may want to disable 2Mbps in the ble_app_hrs_rscs_relay code to force the phone not switching to 2Mbps. Or use a sniffer that can track 2Mbps communication. 

    Could you let me know the connection interval between the relay and the appliances ? Maybe get a sniffer trace of the relay vs one of the appliance as well. 

    Could you try to test this on a phone different from Xiaomi brand ? 

Reply
  • Thanks David,

    I found that the sniffer traces didn't show all the communication due to the connection was switched to 2Mbps and the sniffer can't sniff 2Mbps communication. 

    You may want to disable 2Mbps in the ble_app_hrs_rscs_relay code to force the phone not switching to 2Mbps. Or use a sniffer that can track 2Mbps communication. 

    Could you let me know the connection interval between the relay and the appliances ? Maybe get a sniffer trace of the relay vs one of the appliance as well. 

    Could you try to test this on a phone different from Xiaomi brand ? 

Children
  • The connection interval between the relay and the equipment is 75ms.

    Below is disable 2Mbps, Use sniffer to sniff the communication. Analyze the communication data as follows:

    The connection interval for the CONNECT_REQ is 45ms. But the communication interval in the figure below is less than 7.5ms

    About 800ms later of CONNECT_REQ, the master will update the connection interval to 7.5ms.

    The connection interval is update to 7.5ms.

    Then the communication may be busy. The slave cannot reply to the master.

     

    After about 3 seconds, the master re-update connection interval to 45ms.

     

     

     

     

    BU connected 8 appliances android_1Mbps.pcapng is BU (relay) connecting 8 appliance.

     BU connected 8 appliances android_1Mbps.pcapng

    BU does not connect to appliances_1Mbps.pcapng is the BU (relay) does not connect any appliances.

    BU does not connect to appliances_1Mbps.pcapng

    The question is:

    1. Is the connection interval updated to 7.5ms for android automatic update or nRF Connect APP update?
    2. Can a slave refuse to update a connection interval of 7.5ms? If it can, how can I fix it?

     

  • Hi  David, 

    The request to switch to 7.5ms is from the Android phone. The reason it does that is to reduce the time it takes to do service discovery. Usually when thing goes as planned it will switch back to long connection interval. However in this case for some reason when switching to 7.5ms the softdevice wouldn't managed to handle the connection (with other 8 connections to the appliances). 
    This is performed by the Android OS and not the app, so I don't think it's easy to get rid of that. On bonded device the phone won't do service discovery every time it connects though. This could be an option. 

    Also there is no way the peripheral (BU) can reject the request to change connection interval to 7.5ms. It's controlled by the central. 

    There is an option is to increase the interval to the peripheral from 75ms, hopefully that would reduce the issue.

    Another option is to temporarily disconnect one or some of the peripherals and wait until service discovery is finished and connect them back. It wouldn't take too long, like 1 seconds, depends how you configure the peers. This would be a little bit cumbersome but would work I think, I just don't know the requirement to keep the connection to other peers. 

Related