Connection interval for nrf52840

Hi ,

 For Battery operated devices, we are using NRF52840, and developing the firmware using Segger Embedded studio +  NRF SDK. s140nrf52720, nRF5SDK1702d674dde

For our application we are using the "Peripheral -  Nordic UART Service NUS" example to send the pressure data over the BLE.

To take it further we are going to add the

  • VT - Variable Transmission Time for sensor data ( adjustable interval from 1 sec to 1 minute)
  • DFU

With above context, while developing the firmware we are facing few issues,

For VT,  after reading the several Noridc forum, we come to know that it’s a Central who decide the connection parameters ( slave latency, connection interval MAX, and MIN, supervision timeout).

 Issue#1 : With below setting, we are able to connect with central after every 10 sec of interval , how can we increase it ? To have interval between connection equal to 60 sec. ?

 

In NUS example when we try to change the connection parameters then code didn’t work

Our plan is to use the connection interval always 1 sec and change the Slave latency to change interval between connection.

However , max connection supervision timeout we can set is 32Sec.

   

Issue#2:

 How can, peripheral firmware be able to accept the change in connection parameter ? is this sufficient to have in the firmware?

   Also, is there any simple way we can change the connection parameter from the Mobile APP and test it?

  

Parents
  • HI

    Sorry, but an error 7 in this function points to an invalid parameters being set in your gap_params_init(). I think this is because of your supervision timeout + the latency set together increasing the supervision timeout above the allowed 32 seconds set by the Bluetooth specification. Check out the DevZone thread here where my colleague Edvin explains a similar issue another user was running into.

    It could also be the connection intervals being set too high.

    Best regards,

    Simon

Reply
  • HI

    Sorry, but an error 7 in this function points to an invalid parameters being set in your gap_params_init(). I think this is because of your supervision timeout + the latency set together increasing the supervision timeout above the allowed 32 seconds set by the Bluetooth specification. Check out the DevZone thread here where my colleague Edvin explains a similar issue another user was running into.

    It could also be the connection intervals being set too high.

    Best regards,

    Simon

Children
  • Hi Simnor,

    The post you shared is really helpful.

    Okay, noted with BLE we can not go beyond 15sec of connection interval. 

    I kept the parameters same as mentioned in the post for 15 sec connection interval,

    1. MIN_CONN_INTERVAL               MSEC_TO_UNITS(800, UNIT_1_25_MS)
    2. MAX_CONN_INTERVAL               MSEC_TO_UNITS(830, UNIT_1_25_MS)
    3. SLAVE_LATENCY                   18
    4. CONN_SUP_TIMEOUT                MSEC_TO_UNITS(32000, UNIT_10_MS)

    However, with this my effective connection interval is just 10.5 Sec and not close to 15sec. We tried different options but no luck.

    Any idea why it is happening ?

    Second point, I want to change the connection interval from the mobile APP, for this I am sending the new connection interval value from the UART RX characteristic to peripheral. On receiving the value in nus_data_handler(ble_nus_evt_t * p_evt), I am changing the default connection parameters to some fixed value as shown in image.

    New values are taking place and connection interval is changing to 7.5Sec. but after almost 1 min connection interval is again changing to default value in my code i.e. 1 sec.

    Whats wrong , I am doing and because of that values are changing to default after 1 min?

    PS: Fixed values are just for testing, plan is to change the slave latency as per connection interval value sent from the mobile app, keeping the max connection interval to 1sec only. so effective connection interval will be change.

Related