want to achieve 1-2 Mbps through BLE.

I am working on project in which i want to read data from sd card and send it to mobile through BLE , I am using ble_nus_send to send data but when i decrease the delay then its giving me error 19 and when i increase delay then it is running smoothly .

Can i achieve something between 1-2 Mbps through ble_nus_Send or have to do with some other approach . 

Parents
  • Hello,

    ble_nus_send to send data but when i decrease the delay then its giving me error 19 and when i increase delay then it is running smoothly .

    Exactly which function is returning error 19?

    Can i achieve something between 1-2 Mbps through ble_nus_Send or have to do with some other approach . 

    Please see the SoftDevice throughput documentation for what parameters to use to achieve the highest throughputs.

    Best regards,
    Karl

  • Hello, 

    I have seen throughput documentation please tell me how to achieve highest rate and which example can i use to achieve highest rate . 

  • Hello again,

    If you've changed all your connection parameters to that of the throughput documentation then I think the issue now is how fast you are actually queueing the data.
    I see from your main.c code that your main function calls the idle_state_handler for each successful queueing of a function. This will place the device in SYSTEM_ON sleep, where it will wait for an event before it resumes its program.
    You could try to remove this, to see if this will increase your speed through queueing more data for transfer each connection interval.
    You could have a conditional on the filling of the hvn queue, so that when the hvn queue is full (NRF_ERROR_RESOURCES returned, and no hvn_tx_complete event yet received) you should enter into SYSTEM_ON sleep.

    Additionally, you can remove the BLE_GATTS_EVT_SYS_ATTR_MISSING conditional - since this event will never be passed to the main context (this code snippet should be in the ble_evt_handler instead).

    Let me know if making this change increases your throughput.

    Best regards,
    Karl

  • Additionally, you can remove the BLE_GATTS_EVT_SYS_ATTR_MISSING conditional - since this event will never be passed to the main context (this code snippet should be in the ble_evt_handler instead).

    when i remove this code runs well but when i disconnect and then disconnect this gives me this error .

    <error> app: ERROR 13313 [Unknown error code] at D:\nrf5\nRF5_SDK_17.0.2_d674dde\examples\ble_central\ble_app_hrs_c\main.c:1606
    PC at: 0x0002D745

    I have removed that error by adding this condition .

    I have tested but same results . 

    You could have a conditional on the filling of the hvn queue, so that when the hvn queue is full (NRF_ERROR_RESOURCES returned, and no hvn_tx_complete event yet received) you should enter into SYSTEM_ON sleep.

    I didn't understand this can you please elaborate or give me code of this . 

  • So here is situation when i try to connect through nrf toolbox and want to see data on logs some of notification missed but when i use nrf connect and nrf toolbox on same time , Whole data received . When i disconnect all and connect with nrf connect it gives good data rate but not whole data just starting data 

  • Mohsin khan said:

    when i remove this code runs well but when i disconnect and then disconnect this gives me this error .

    <error> app: ERROR 13313 [Unknown error code] at D:\nrf5\nRF5_SDK_17.0.2_d674dde\examples\ble_central\ble_app_hrs_c\main.c:1606
    PC at: 0x0002D745

    I have removed that error by adding this condition .

    I have tested but same results . 

    This error is commonly returned when you attempt to queue a notification or write operation without being in a connection (no valid connection handle), or when the Attribute table for the connection has yet been filled in.
    You could move this code section into the ble_evt_handler to handle the event when it occurs.

    Mohsin khan said:
    I didn't understand this can you please elaborate or give me code of this . 

    The simplest way to implement this is to create a boolean variable that is set when NRF_ERROR_RESOURCES is returned from ble_nus_data_send, and cleared on the BLE_GATTS_EVT_HVN_TX_COMPLETE event. Then, you could use this variable in your main loop to either go to SYSTEM_ON sleep (by calling idle_state_handler) or to queue new data. This way, you will ensure that the hvn queue is always full, so that you know that you will be sending the maximum amount of data each connection event.

    In your current implementation you are going to SYSTEM_ON sleep between the queueing of each notification, which requires an event to wake the CPU so that it can continue queueing notifications. Therefore, you might not be queueing the full amount of notifications in between each connection event.

    Best regards,
    Karl

  • Please tell me something about this nrf toolbox and nrf connect issue . 

Reply Children
Related