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

  • Hi

    The connection handle is a unique index assigned to the connection when it is first established. BLE allows you to have multiple connections running at the same time, and you use the connection handles to keep them apart, and send commands to one connection or the other. When you only have a single connection the connection handle is typically 0.

    I am not very familiar with the BlueZ api used on the RPi side, but according to the response in this stack overflow exchange the recommended way to change the connection parameters is to have the peripheral request it. In other words you shouldn't have to do anything on the RPi side.

    Best regards

Reply
  • Hi

    The connection handle is a unique index assigned to the connection when it is first established. BLE allows you to have multiple connections running at the same time, and you use the connection handles to keep them apart, and send commands to one connection or the other. When you only have a single connection the connection handle is typically 0.

    I am not very familiar with the BlueZ api used on the RPi side, but according to the response in this stack overflow exchange the recommended way to change the connection parameters is to have the peripheral request it. In other words you shouldn't have to do anything on the RPi side.

    Best regards

Children
No Data
Related