This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

gap_params_init and connection parameter issue

Hello,

I'm working on a firmware for a device that is created using ble proximity example. It is power constrain device and required a connection interval of 30 sec between a master (Android phone only) and slave nRF52810.

I’m using the following version and device.

  1. SDK v17.0.2
  2. 2. s112_nrf52_7.2.0_softdevice
  3. Basically I’m using Android phones as my central or master device and nRF52810 as peripheral or slave.

Basic feature of the firmware

                The architecture is based on Application Timer Event callbacks.

                The firmware was prepared using the BLE Peripheral Proximity example.

In order to minimize power consumption the device runs a minimum of active GATT services listed below:

  1. TX Power
  2. Instant Alert Service (IAS)
  3. Instant Alert Service Client (IAS-C)
  4. Connection is BLE_PERIPHERAL

To get the desire interval I'm changing the following parameters. I have used different values for these parameters without violating the following two constrain but seem I'm not able to go beyond 15 sec interval ( 30 sec is desired). Is there anything I'm not doing correct. 

                   //constrains

    1. conn_sup_timeout * 4 > (1 + slave_latency) * max_conn_interval
    2. (1 + Conn_Latency) * Conn_Interval_Max * 2 < conn_sup_timeout

                   // Parameters

    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)

I'm getting the following error whenever I try to increase slave latency.

  • gap_params_init();
    • APP_ERROR_CHECK(err_code);
      • I think It might help you “void app_error_handler_bare(ret_code_t error_code)” here error_code = 0x00000007.
  • Hi,

    HaiderRPM said:
    Error I can see on my nRF Connect app is Error 133, defined as: #define GATT_ERROR 0x85 

    I see. That is very useful information. Unfortunately GATT error 133 is a quite generic error so it is difficult to say what causes it.

    HaiderRPM said:
    I'm using it with the similar device but does it matter?

    It would be interesting to know if this only happens with some specific peer devices. Which phones have you tested with (phone model and Android version), and do you see the same behaviour with all?

    HaiderRPM said:
    I also notice it do not connect after disconnection even if I manually tap the connect button on the app. I have to restart my peripheral and connect it.

    that is interesting. Do you do some debug logging on the nRF side to understand what happens? It would be very useful to see what happens seen form the nRF, bot before the disconnect and which disconnect reason the nRF sees.

    Lastly, a sniffer trace could be very useful, though it may be difficult to produce as the disconnect happens so seldomly. In any case logging and a trace of the failed reconnect attempts before the nRF is reset would also be useful.

Related