BLE data relay latency issues

Hello,

I am in the process of writing my bachelors thesis about using BLE to relay data over multiple hops.

In my test setup, I have 5 nrf52840 that connect to each other and form a linear "network". I can then send data to the first relay and it will get relayed through all the nRFs to the last one.

The problem is, Im currently trying to evaluate the latency of this system and hit a roadblock. I cannot figure out why the latency behaves how it does:

sometimes I get low latency results of about 100ms, and sometimes I get very high results of >1s, this is all with the exact same setup, sometimes even without disconnecting between the tests.

the strange thing is that the lows and highs are not evenly distributed, but it seems like its low latency for a while, then gradually gets better or worse and then repeats (although its really hard to say how it varies exactly, it sometimes gets worse very sudden too.)

I tried this with various connection parameters but I always observed the same behaviour. It could also be a bug in my software, but I dont think so / dont know.

the payload im testing with is 1.5Kb in size, and Im feeding the data from an android phone into the first relay.

I would greatly appreciate it if someone could just share thoughts on this, as Im out of ideas on what to try next.

thanks,

Jonas

Parents
  • Hi Jonas,

    Can you say more about how you transfer the data?

    • Is it as notifications or another method?
    • What is the connection interval
    • What is the event length?
    • How long packets do you use?
    • Are more/many packets typically sent per connection event?

    Also do you have any siffer trace of this, both the good case (where y0ou have low latency) and the bad case where you have high latency?

    Without knowing more, my gut feeling is that you are using fairly long connection events and event lengths, and send multiple packet per connection event. Is that so? If so, a packet loss could explain what you are seeing, as an event would end in that case, and the retransmission will happen in the next connection event.

    Einar 

  • the data is sent using write without response.

    Tested connection intervals range from 7.5ms up to 400ms, all with the same relative results, the absolute delay is smaller on the smaller intervals.

    I tried with multiple event lengths too, but cant seem to see any difference, is it correct to set it using

    CONFIG_BT_CTLR_SDC_MAX_CONN_EVENT_LEN_DEFAULT

    MTU is set to 1024 at the moment, but I also tried differernt values with similiar results.

    I already did some sniffing and have found out that there indeed is packet loss, I didnt know that a packet loss causes the event to end though, that could go in the right direction. Its hard for me to catch the "long" packets, as the sniffer needs to be setup for a particular device prior to connecting, but I only know which device causes the latency after connecting. I will have to try with multiple sniffers setup beforehand, I will update this with a sniffer log as soon as possible.

    In the meanwhile, here are some pictures of the latency, a rising edge means that the first packet of my test payload has been received, a falling edge means that the payload is complete. The first image shows a case where it behaves more or less like expected, the second image shows a too high latency. this is done with 90ms connection interval.

  • and by the way, if the problem indeed would be packet loss, my guess would be its because I have multiple BLE devices in close proximity, all transmitting simultaneously at full power. How would I try to solve this? is there even anything that could be done to solve this?

Reply Children
No Data
Related