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.

  • Hi,

    I have checked with peripheral Bluetooth(CC25664MODA Bluetooth) with other Bluetooth which act as central which is sending 8 bytes of data to peripheral , it is reading  8 bytes of data every 10ms. So i think this is problem with the  central Bluetooth  (NRF52840 ) Bluetooth.

    I have even tried with the ble_app_uart peripheral(nrf52840 peripheral) example program which has to send 8 bytes of data every 10 ms  to NRF_CONNECT Application.In the application also it is  not reading every 10ms. It means there should be time gap of 10ms between each data transfer.In this also it is working fine for 30ms, 50ms,100ms  but not  for 10ms and 20ms. Here by attaching the log file of BLE_APP_UART example program .Log 2020-04-14 13_22_16.txt

    so please give me the solution

  • please give me the solution.

    Waiting for your reply.

  • Hello again,

    Sorry for my delayed response - there was just a public holiday period here in Norway.

    sharmelaraju said:
    so please give me the solution

    I would love to just give you the solution, but it is not that straight forward.

    I see from the code you posted below that you are scanning for 50 ms every 100 ms, which only leaves you a 50 ms room to receive your three 10 ms transfers.
    Could you attempt to disable the scanning on your central, while you are connected to the peripheral?
    If this solves your issue, I suggest a much lower scanning interval and window(if necessary at all) while connected to your peripheral.

    sharmelaraju said:
    I have even tried with the ble_app_uart peripheral(nrf52840 peripheral) example program which has to send 8 bytes of data every 10 ms  to NRF_CONNECT Application.In the application also it is  not reading every 10ms.

    Are you referring to the NRF Connect for mobile, or desktop?
    The mobile application is not guaranteed to support 10 ms connection intervals - it depends on the mobile model, and it is often not the case.

    Looking forward to solving this issue together!

    Best regards,
    Karl

  • Thank you very much for the reply.

    I didn't get where do i need to disable the scanning  on central.If i disable the scanning  the how do the central connect to peripheral.

    Another doubt is in my program where it  is scanning for 50 ms for every 100 ms.

    static void scan_init(void)
    {
        ret_code_t          err_code;
        nrf_ble_scan_init_t init_scan;
    
        memset(&init_scan, 0, sizeof(init_scan));
    
        init_scan.connect_if_match = true;
        init_scan.conn_cfg_tag     = APP_BLE_CONN_CFG_TAG;
    
        err_code = nrf_ble_scan_init(&m_scan, &init_scan, scan_evt_handler);
        APP_ERROR_CHECK(err_code);
    
        // Setting filters for scanning.
        err_code = nrf_ble_scan_filters_enable(&m_scan, NRF_BLE_SCAN_NAME_FILTER, false);
        APP_ERROR_CHECK(err_code);
    
        err_code = nrf_ble_scan_filter_set(&m_scan, SCAN_NAME_FILTER, m_target_periph_name);
        APP_ERROR_CHECK(err_code);
    }
    static void scan_start(void)
    {
        ret_code_t err_code;
    
        err_code = nrf_ble_scan_start(&m_scan);
        APP_ERROR_CHECK(err_code);
    
        bsp_board_led_off(CENTRAL_CONNECTED_LED);
        bsp_board_led_on(CENTRAL_SCANNING_LED);
    }
    
    

    Please do let me know where do i need to disable the scanning.

  • Hi,

    sharmelaraju said:
    I didn't get where do i need to disable the scanning  on central.If i disable the scanning  the how do the central connect to peripheral.

    You need to scan to discover and connect to your peripheral - but when you are already connected, then you do not need to continue scanning unless you are looking to connect to multiple peripherals.

    In the code you posted in the earlier comment, you have these lines:

    #define SCAN_INTERVAL                   0x00A0                              /**< Determines scan interval in units of 0.625 millisecond. */
    #define SCAN_WINDOW                     0x0050                              /**< Determines scan window in units of 0.625 millisecond. */
    #define SCAN_DURATION                   0x0000                              /**< Timout when scanning. 0x0000 disables timeout. */
    
    

    These defines are used in your scan_init, and determine how often you scan.
    For further detail on how to use the scanner module, please see the scanner API Reference.

    Best regards,
    Karl

Related