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

BLE MESH Stack(2.0.1)Light Switch Demo Roundtrip Delay getting higher between client and server

Hii,

I am currently using two nRF52832 SDK boards to implement text message exchange with another nRF52832 SDK board via BLE Mesh SDK 2.0.1.

However, when I try to increase the frequency of sending the command the communication seem to choke. and i'm getting Roundtrip Delay higher between client and server.

Roundtrip calcualtion of 5byte send and receive  sheet is below

  

Round trip calcualtion of 11byte send and receive  sheet is below

How to reduce round trip delay time please suggest me ASAP.

Thanks,

Nikunj Patidar

 

Parents
  • Hello Nikunj,

    Mesh is built on BLE advertisement packets. An advertising packet is 31 bytes long. In Mesh, if you exclude the headers, you are left with 11 bytes. In addition, since you are using the nordic access API, company-ID and opcode, you are left with 8 bytes.

    This means that when you send a message with 50 bytes, it is split into 7 packets. six with 8 bytes, and one with 2 bytes.

    Your devices will only send a packet every 20ms. I am not sure exactly how that example works, but if you loose a packet, it might have to send the entire message again. Since you only have 2 nodes in the network, you don't have any nodes to retransmit the packets either, so if the client doesn't receive the packet initially, the message will be lost.

     

    Can you please try to split the packet into 8 bytes sized packets? You can use the NRF_MESH_EVT_TX_COMPLETE event to know when a packet is sent, to trigger the next one, like explained earlier.

     

    Best regards,

    Edvin

  • Hello Edvin,

    I have try to send only 8 byte Echo back message.

    Echo Back Calculation Time = (Stop Count - Start Count )/32768  in Second

    Loge Snap Shot is Below

    1st time Send 8 byte Echo back time =(176891 -71253)/32768= 3.22 Second
    2nd time Send 8 byte Echo back time =(16612647  -16585267 )/32768= 0.83 Second
    3rd time Send 8 byte Echo back time =(48805  -21421 )/32768= 0.83 Second

    See in Log 1st time Client send only 8byt to server ,Client Retries 3 time after receive Ack but server receive message 2 times.

    i think client wait for Ack if not receive then retries multiple time . in my case server receive messege 2 time but not send ack to client.

    Thank's

    Nikunj 

  • Hello,

    Ok. It seems that you are missing some packets (then the other device will try to resend them). 

    Since you are using the proxy example, what conn_interval and advertising_interval do you use? Can you try with the non-proxy example to see if that helps?

    The reason might be that since you are using the proxy example, the device will not have control of the radio all the time. Not when the softdevice is using it. If it works better with the non-proxy example, you can try to increase the BLE interval (advertising/scanning interval and connection interval) to see if that helps.

     

    Best regards,

    Edvin

Reply
  • Hello,

    Ok. It seems that you are missing some packets (then the other device will try to resend them). 

    Since you are using the proxy example, what conn_interval and advertising_interval do you use? Can you try with the non-proxy example to see if that helps?

    The reason might be that since you are using the proxy example, the device will not have control of the radio all the time. Not when the softdevice is using it. If it works better with the non-proxy example, you can try to increase the BLE interval (advertising/scanning interval and connection interval) to see if that helps.

     

    Best regards,

    Edvin

Children
  • Hello Edvin,

    Now i'm using non proxy example,The results is better then previous one.

     

    Connection Interval

    #define MIN_CONN_INTERVAL MSEC_TO_UNITS(250, UNIT_1_25_MS)
    #define MAX_CONN_INTERVAL MSEC_TO_UNITS(1000, UNIT_1_25_MS)

    Advertisement interval
    #define BEARER_ADV_INT_DEFAULT_MS 20

    Scan interval
    #define BEARER_SCAN_INT_DEFAULT_MS 2000

    Scan window
    #define BEARER_SCAN_WINDOW_DEFAULT_MS 2000

    i want to send 250 byte Payload using light switch ble mesh example code.i have implemented echo back mechanism.

    i have attached sheet of readings taken with 10,50,250 byte.

    Roundtrip_Calculation_NonProxyClient.xls

    please check it and tell me that roundtrip delay is getting some time higher.  

    Thank's

    Nikunj

  • Hello Nikunj,

    Sorry for the late reply. I was out of office last week.

     

    As mentioned, the proxy part of the project is using the radio for BLE (non-Mesh) protocol, which means that if the message is sent out from one of the mesh nodes when the other is not listening, then it will not be received.

     

    To minimize the chance of this happening you should increase your advertising and connection intervals. Try setting the advertising interval to something higher, like 1 second. I don't know whether you are in a BLE connection while doing these tests, are you? If so, you can try to increase the MIN_CONN_INTERVAL but depending on the phone, it might not work, as it is always the central in a BLE connection that decides the connection interval.

     

    Try to increase the adv interval to 1 second, and see whether the behavior improves.

     

    I should also mention a couple of things:

    • If you add a third node, then the third node would repeat the message, thus increasing the chance of the second node/proxy node to hear the message. This way, if the second node would hear the message from the repeating node if it was busy while it was first broadcasted.
    • Mesh is really not made for high bandwidth. If you intend to send large chunks of data frequently in your network, Mesh might not be the right protocol. What is the sort of throughput that you are looking at?

     

    Best regards,

    Edvin

Related