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

How to increase data transfer rate for BLE nrf51822 to raspberry pi?

I am working on a project where i need to send sensor values from nrf51822 module to a raspberry pi. The sensor values are received by the nrf using I2C protocol. I am using mbed compiler with the BLE.h and Gap.h libraries. I want to increase the data transfer rate. Currently it sends data at an interval of 150ms. I want to bring this down to 10ms. I tried tweaking parameters for the setAdvertisingInterval() function, but it didnt change the speed at all. Please help.

Parents
  • Hi

    I assume you are connected when you want to transfer the data, and in this case it is the connection interval that is critical, not the advertising interval.

    The connection interval is typically set by defining a range of acceptable connection intervals, as described in this article:
    https://docs.mbed.com/docs/ble-intros/en/latest/Introduction/ConnectionParameters/

    The minimum connection interval is 7.5ms, but not all BLE central devices will allow you to use the shortest connection intervals. You might want to consider packing multiple sensor updates into a single packet, to make the data transmission more efficient.

    Best regards
    Torbjørn

  • Further doubts to your reply

    ---"I assume you are connected when you want to transfer the data, and in this case it is the connection interval that is critical, not the advertising interval." Currently my advertising type is [GapAdvertisingParams::ADV_CONNECTABLE_UNDIRECTED]. I had read that the 'undirected' mode takes a minimum of 100ms interval time. So i changed it to the 'directed' mode. But, after doing so the raspberry pi(peripheral) couldn't connect to the nrf51822(cental). How do I change this to connection mode from advertising mode? It will be really helpful if you could attach a code snippet that does so.

    ---"You might want to consider packing multiple sensor updates into a single packet, to make the data transmission more efficient." I implemented this but the time interval for each sensor value still remains the same. Calculated this by sending a packet of 10 values which takes approx 1400ms and dividing by 10 yields 140ms

Reply
  • Further doubts to your reply

    ---"I assume you are connected when you want to transfer the data, and in this case it is the connection interval that is critical, not the advertising interval." Currently my advertising type is [GapAdvertisingParams::ADV_CONNECTABLE_UNDIRECTED]. I had read that the 'undirected' mode takes a minimum of 100ms interval time. So i changed it to the 'directed' mode. But, after doing so the raspberry pi(peripheral) couldn't connect to the nrf51822(cental). How do I change this to connection mode from advertising mode? It will be really helpful if you could attach a code snippet that does so.

    ---"You might want to consider packing multiple sensor updates into a single packet, to make the data transmission more efficient." I implemented this but the time interval for each sensor value still remains the same. Calculated this by sending a packet of 10 values which takes approx 1400ms and dividing by 10 yields 140ms

Children
No Data
Related