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

BLE data write delay

FormerMember
FormerMember

Hello, all

I have a problem with ble data exchanging.

I have programmed an application which controls servo motors through phone application.

At the connection, ble data is sent immediately by clicking phone app button,

but the problem is that it lasts only few seconds.

After 3~4 sec, data exchanging has a delay and operates like a queue.


please watch this link.

As you can see, data exchange has delay 3~4 sec later and it operates past event even I don't click app button.


So I found solution but it also has another problem.

I set CONN_SUP_TIMEOUT to MSEC_TO_UNITS(10000, UNIT_10_MS) from MSEC_TO_UNITS(4000, UNIT_10_MS)

data exchanging has no delay permanently, but after 1~2 minute the connection is disconnected.


Here is the link.

Unlike first video, there is no delay but after 1-2 minute the connection is lost.


I also changed value of MIN_CONN_INTERVAL and MAX_CONN_INTERVAL, but the result has delay or disconnection event.

How do I exchange ble data without delay and diconnection event?

Parents
  • FormerMember
    0 FormerMember

    I find how to fix it.

    The problem is MAX_CONN_PARAMS_UPDATE_COUNT.

    MAX_CONN_PARAMS_UPDATE_COUNT is basically set to 3

    and NEXT_CONN_PARAMS_UPDATE_DELAY is set to 30.

    So after about 1m 30s, the ble_conn_params timeout event call on_conn_params_evt() and operate sd_ble_gap_disconnect().

    The solution is that set sd_ble_gap_disconnect() comment or remove in on_conn_params_evt().

    But I dont understand why it wasnt disconnceted if I set MIN_CONN_INTERVAL to 450, MAX_CONN_INTERVAL to 550 and CONN_SUP_TIMEOUT to 4000. It should be disconnected after 1m 30s technically but woldnt, only make delay and operate past data.

    Now I set MIN_CONN_INTERVAL, MAX_CONN_INTERVAL and CONN_SUP_TIMEOUT to whatever I want, I dont get delay and disconnection.

  • FormerMember
    0 FormerMember in reply to FormerMember

    Thx! I understand what happened.

Reply Children
No Data
Related