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

Only getting 1 paket per CI

Hi there,

Im successfully sending 1.1mB om data from Android Samsung S9 or iPhone 11 Pro. My problem is the low throughput i achieve, its about 6.1kB/s on iPhone and about 3kB/s on my android. This is too slow and I cant get it any faster. 

I started off with the ble_app_template och then adding my custom service using this example https://github.com/bjornspockeli/custom_ble_service_example

Im writing withResponse from my phone app. I read somewhere that when writing with response only one packet per CI is allowed. Is that correct?

Some of my parameters:

SDK 16

App is written in flutter_blue

main.c:

Min con interval: 7.5
Max con interval: 15
SlaveLatency: 0

in sdk_config.h:
NRF_SDH_BLE_GAP_DATA_LENGTH: 27 (tried with 251 with no difference)

NRF_SDH_BLE_GAP_EVENT_LENGTH 7 (tried with 400 no difference)
NRF_SDH_BLE_GATT_MAX_MTU_SIZE 247
When reading &p_ble_evt->evt.gap_evt.params.conn_param_update.conn_params im getting:
Min/max conn intervall 24ms (* 1.25) on iPhone and 39ms (*1.25) on android.
Im using notification on my custom service as flow control. I send one packet from app, nrf52 receives the packet and responds with an ACK, app receives this and send the next packet.
Should I handle this in some other way to achieve higher throughput?
If I would write without and response, is there any kind of checksum test going on or how would I know all the bits are correct?

Im pretty much out of ideas. Would really really appreciate some guidance.


Thanks in advance /Rasmus

Parents
  • Hello Rasmus,

    If you are using notifications, then the bluetooth stack will check the CRC of the BLE packet, and ACK it for you. This means that all the packets you send using notifications will be ACKed by the stack. If you wait for a custom ACK in the application, then there will only be one packet in the air each connection interval. 

     

    If I would write without and response, is there any kind of checksum test going on or how would I know all the bits are correct?

     Yes. This is the ACK that is in the bottom of the Bluetooth Low Energy specification, which is embedded in our softdevice, and which is also included in the bluetooth stack on your phone.

    Best regards,

    Edvin

  • Hi Edvin,

    Thank you so much.
    Ok, so the way to go in my case would be something like on the phone-side:
    Set "notification = true"
    "writeWithoutResponse = true"?

    When I try this and I am writing data from phone to 52832 without response set to true, the packets never reaches my ble_cus_on_ble_event(), thus not my on_wite-function in my custom service. Do I have to enable writeWitoutResponse in my custom service/characteristic somehow?
    Please let me know if you need any additional information/code examples etc.. 

    Thanks you and best regards /Rasmus

  • Hi,

    I figured it out, I had to give my char the write without response permission.

    thanks a bunch

Reply Children
No Data
Related