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

Problem in data transfer in Bluetooth at 10ms

Hi,

We are using NRF52840 Dk board to transfer the data at 10ms through Bluetooth which is central and peripheral  as other cc250moda controller  Bluetooth. Our objective is to send the data of 8 bytes at  10ms from the NRF52840 Bluetooth to other Bluetooth. We are able to send the data from NRF52840 Bluetooth of 8 bytes at 30ms,50ms,100ms,500 ms to other controller Bluetooth correctly which means at every 50ms  we are sending 8  of bytes data which is receiving  8 bytes of data at every 50ms in the receiving controller Bluetooth. The problem here is when we are sending the  8 bytes of data at 10ms from NRF52840  Bluetooth to  receiving Bluetooth it should read  8 bytes of data at 10ms but here the problem is it is reading as 8 bytes, 16 bytes ,24 bytes ,0 bytes ,0 bytes, 24 bytes,16 bytes, 0 bytes, 0 bytes  as such at every 10 ms.Can you please tell me what is the problem . How to resolve the issue.

  • Thank you for you patience.
    I have allocated time to review your code tomorrow.

    I'll get back to you once I have looked over the code.

    Best regards,
    Karl

  • Hi again,

    I have been able to replicate your minimal 20 ms connection interval with the code you provided.
    I have also successfully created a modified version of the Blinky examples, that communicate with 10 ms connection intervals - since this is the basis of your application.

    Tomorrow I will pursue the reason for your application only achieving to send every 20 ms.

    Best regards,
    Karl

  • Thanks for the support.

    In our application  we need to achieve at every 10ms. 

  • Hello,

    sharmelaraju said:
    Thanks for the support.

    No problem at all, I am happy to help!

    sharmelaraju said:
    In our application  we need to achieve at every 10ms. 

    Yes, that much is understood.
    I took a closer look at the code you provided, and made some discoveries.
    First of all, the reason why you have not been able to set the connection interval properly: It seems that there is a bug in the ble_central/blinky source code, where it in fact does not make use of the parameters MIN_CONNECTION_INTERVAL and MAX_CONNECTION_INTERVAL as specified in main.c - but instead uses the default NRF_BLE_SCAN_MIN_CONNECTION_INTERVAL from the sdk_config.h file.
    I have created an internal ticket on these misleading lines, for our SDK team to take a closer look at. I am sorry for any confusion this has caused you in your development.

    Having found this, I changed the NRF_BLE_SCAN_MIN_CONNECTION_INTERVAL and NRF_BLE_SCAN_MAX_CONNECTION_INTERVAL to 10, which resulted in the expected 10 ms connection interval between the central device and an arbitrary peripheral device I set up.

    Then, I used a Sniffer tool to capture the BLE traffic from the central, and noticed that it was only sending the data every other connection interval, instead of every 10 ms.
    Taking a closer look at you code, I see that you have merged the Led Button service with the Nordic UART example service, and discovered that your data is scheduled to be sent every 20 ms by your "battery_level_meas_timeour_handler()" function. I changed the BATTERY_LEVEL_MEAS_INTERVAL from 20 ms to 10 ms, and observed that the changes were reflected in the BLE traffic captured using the Sniffer. I have attached the sniffer log here, for you to take a look at.

    For future reference, I strongly recommend changing variable- and function-names so that they match their actual function, for significantly increased readability.

    You can find the changes I made to your project code by looking at the lines preceded by "CHANGE START" and ending with "CHANGE END"
    I recommend that you take a look at the changes I have made, but input them into your project yourself - rather than continuing to develop using the code I have sent.
    This will ensure that you have full control and understanding of the changes made.

    Please let me know if you should encounter any other questions or issues in the future.

    Best regards,
    Karl

    sharmelaraju.pcapngIBP_DONGLE.zip

  • Thanks for the support.

    I have tried your it is working....I am receiving the 8 bytes of data at every 10 ms .But sometimes the receiver Bluetooth reads 24 bytes,16 bytes,0 bytes. Can you please tell me how to resolve this issue.

    I am here by attaching the log of the received data.MAIN_IBP_DONGLE.txt

Related