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

  • I have to transmit accelerometer (acc), magnetometer (mag), gyroscope (gyro) and temperature data. I have 3 valeus for acc, mag and gyro along their 3 axes namely x, y and z. Along with these I am also sending the time value in ms by reading the timer. (Sending time value so as to compare it with the timer on Rpi). Thus a total of 3+3+3+1+1=11 values. Every value is an int thus 2 bytes. Stacking them in an array of 11 elements gives me an array of 22 bytes. I have also added a loop where i can collect these sensor values multiple times say 10, hence that would make an array of 22*10.

    As suggested by you, I also included minConnectionInterval = 8 (10ms), maxConnectionInterval = 16 (20ms) and set these connection params using the ble.setPreferredConnectionParams() function before the connection being established. Yet the time does not change (still a difference of 140-150ms between consecutive values)

Reply
  • I have to transmit accelerometer (acc), magnetometer (mag), gyroscope (gyro) and temperature data. I have 3 valeus for acc, mag and gyro along their 3 axes namely x, y and z. Along with these I am also sending the time value in ms by reading the timer. (Sending time value so as to compare it with the timer on Rpi). Thus a total of 3+3+3+1+1=11 values. Every value is an int thus 2 bytes. Stacking them in an array of 11 elements gives me an array of 22 bytes. I have also added a loop where i can collect these sensor values multiple times say 10, hence that would make an array of 22*10.

    As suggested by you, I also included minConnectionInterval = 8 (10ms), maxConnectionInterval = 16 (20ms) and set these connection params using the ble.setPreferredConnectionParams() function before the connection being established. Yet the time does not change (still a difference of 140-150ms between consecutive values)

Children
No Data
Related