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

BLE performance suffers when a second peripheral is connected

Hi there,

We're using SDK 16.0.0_98a98e2.  Our setup is a PC running BLE Central connecting to 2 nRF 52840 running as BLE peripherals.  We use the provided BLE UART example as the basis of our code. 

                                             BLE Central on PC

                                                    /                \

                                                 /                     \

                                               /                         \

                                    (A) nRF52840           (B) nRF52840

                                   BLE Peripheral         BLE Peripheral


We need each BLE peripheral to stream about 50 Hz of 244 bytes per packet (ie the max packet size afaik).  So, per second: 50 * 244 bytes * 8 bits/bytes = 97.6 Kbps per nRF 52840.
When only 1 peripheral -say A- is connected, it can stream around 50 Hz as expected.  But, once the second peripheral -say, B- is connected, the performance of A's streaming slowly degrades down to 40 Hz or sometimes less than 40 Hz.  And, this is even before B starts any streaming.  

First question, why is that? Is it because B has some sort of continuous handshake transactions going on with the Central to maintain the connection? 

Second question, is it possible that Central talks to A in one set of BLE channels and Central talks to B in a different set of BLE channels? We're thinking it might reduce the interference and thus improve the streaming performance of both A & B.  

Or, please let us know if you have other suggestions to reach our desired throughput (max latency required is 100 ms).

By the way, on few occasions we can see both A & B streaming 'simultaneously' at 50 Hz.  But, it's not true simultaneity because they actually take turn in sending.  

Thanks,
Cecylia

  • Hi Cecylia

    I think streaming at ~100kbps to two devices should be possible, but there are some caveats to keep in mind. First off, the nRF52 series only have one radio, so you will need to switch between communicating with these two devices. During the connection and (if there is) any pairing/bonding to a second device, the radio will prioritize this which will likely cause a temporary drop until both devices are connected at which point it is up to you how you handle the connections. 

    We have an example project of this in the BLE Multi-link example which shows you how to handle one or more connection simultaneously. For maximizing throughput in your application I would suggest checking out this blog post which is very detailed in which parameters to edit to get the best possible throughput in a BLE connection.

    For starters I would try using the 2MBPS PHY and make sure that the two peripheral devices get the same amount of time on air with the central device. 

    For your second question, due to the central only having one radio, transmitting data on different channels at the exact same time that would likely cause the central to lose packets as it will only be able to scan one channel at a time, and they will indeed need to take turns transmitting data.

    Best regards,

    Simon

  • thanks for the explanation.  I've looked over the links you've provided.  Unfortunately my PC client is made by a 3rd party and it doesn't want to go to 2 MBPS PHY.  I'm expecting the other settings might be difficult to change as well.  So, I'm thinking of writing a Client project on 52840 DK instead, since it's easier to play around with.  This should be a BLE Central that talks to 2 BLE Peripherals (also running 52840).

    I'm thinking to combine the BLE Multi-link example and BLE Uart example.  Do you think this would be a good idea?  FYI my peripheral's project is based on the BLE Uart example.  But, the first question would be, from the BLE Multi-link example, how do I find the identity of the sender? I.e. whether it's from peripheral 1 or peripheral 2?

    Thanks,
    Cecylia


  • Hi again Cecylia

    I agree that making a BLE central using an nRF52 DK will be easier to get up and running, so that should make things easier for you. There should not be any problems combining the BLE Multi-link and BLE Uart examples, so that seems logical.

    You can identify a specific peripheral by I.E. setting the scan filter to scan for addresses instead of names by calling SCAN_ADDR_FILTER in the nrf_ble_scan_filter_set() function to separate the names at least. How you handle this once the devices are connected is entirely up to you, whether you want them to do something different or not.

    Best regards,

    Simon

Related