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 . 

  • 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 . 

  • Mohsin khan said:
    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 .

    Are you connecting two centrals to the same peripheral?
    What do you mean when you say that data is missed - is there a sudden gap in the increments? Please show a log of this if possible.
    Please elaborate thoroughly, so I may better understand what you are testing and observing, so I may better advice you.

    Mohsin khan said:
    When i disconnect all and connect with nrf connect it gives good data rate but not whole data just starting data 

    Please elaborate on what you mean when you say not whole data and good data rate. Is the throughput only good for a limited time?
    Does your peripheral logger indicate anything unusual at this time?

    Best regards,
    Karl

  • Are you connecting two centrals to the same peripheral?

    No i am connecting nus peripheral with my mobile phone .

    What do you mean when you say that data is missed - is there a sudden gap in the increments? Please show a log of this if possible.

    It means my code is like incrementing every value  last some data has been missed some data in between missed as i receive 162 number after i receive 198 so many notification missed on nrf toolbox . 

    Please elaborate on what you mean when you say not whole data and good data rate. Is the throughput only good for a limited time?

    That means as i have complete string 

    {\"g_x\":%d,\"g_y\":%d,\"g_z\":%d,\"a_x\":%d,\"a_y\":%d,\"a_z\":%d,\"m_x\":%d,\"m_y\":%d,\"m_z\":%d,\"lat\":%d,\"lon\":%d,\"alt\":%d,\"hb\":%d}",gyrox,gyroy,gyroz,accelx,accely,accelz,magx,magy,magz,lat,lon,alt,heart_rate);

    I am receiving just 

    \"g_x\":%d,\"g_y\":%d part as i have sent you picture .

    That's on nrf connect .

    and when i open both then i receive everything but throughput is just 41kBps . Previously i have told you less throughput but now my throughput is 41 kBps but i want to achieve more . 

  • So these are logs from nrf toolbox , I am simply incrementing the data but many notification got missed as you can see after 67 i received 71 and after 71 i received 76 . and 1 thing i want to clear is its with same data rate means 41kBps . 

Related