Disconnect after a few second

Hello!

I am using a nRF52840 board for some really simple development.
First I just tried to run the blinky example and connected with another BT device. It worked well but after a few seconds I just totally lost the connection and needed to connect again.
Do you know how can I solve it?

My main goal will be to create a simple GATT service with indicate, and notify flags and do some 1-2 hour term testing.
If somebody has any simple example code for this I would appreciate that.

Parents
  • Hi,

    but after a few seconds I just totally lost the connection and needed to connect again.

    Do you have the log output?

    My main goal will be to create a simple GATT service with indicate, and notify flags and do some 1-2 hour term testing.
    If somebody has any simple example code for this I would appreciate that.

    A good start would be to study the BLE HRS sample from the SDK which implements this,

    regards

    Jared 

  • Hi Jared,

    Instead of ble_app_blinky, I finally tried the ble_app_hrs code, because as far as I know, it already supports the pairing function.
    Here is the result:

    Unfortunately, it has been disconnected immediately.

    By the way, is there any other way to check the logs?
    I just used Putty here for UART logging.

    BR,
    Balint

  • Hi,

    What is the other BLE device that you're using? Are you able to connect to it with your phone?

    You can change the backend to use RTT instead but using UART is probably the simplest approach. 

    regards

    Jared 

  • Hi,
    I found the bug, there was a problem with my BLE device. Now the service works with the ble_app_hrs code and the connection is not interrupted either.

    In this code I saw some notify settings, can I implement some indication service as well?
    Is it possible to enable notify and indication in the same service?

    BR,
    Balint

  • Hi,

    For the same characteristic? I don't think that make quite sense to have both notification and indication enabled.

    regards

    Jared 

  • Hi,

    Let me describe my situation. I am using the hrs_freetos example code.

    I created a GATT service characteristic with a notify flag. If I try to read without acquiring, the reading does not work and I get an error. On the other hand, if I activate the acquire notify function, the reading goes on without any problems. I think that would be good behavior.

    However, in the same way, it works differently in the case of indication. I can read there without any errors even without acquiring. Is this normal? 
    Does acquiring indications mean that the other side of the communication will send an acknowledgment back after receiving new data? If yes, how can we test if our device sent acknowledgment to the Nordic?

    BR,

    Bálint

Reply
  • Hi,

    Let me describe my situation. I am using the hrs_freetos example code.

    I created a GATT service characteristic with a notify flag. If I try to read without acquiring, the reading does not work and I get an error. On the other hand, if I activate the acquire notify function, the reading goes on without any problems. I think that would be good behavior.

    However, in the same way, it works differently in the case of indication. I can read there without any errors even without acquiring. Is this normal? 
    Does acquiring indications mean that the other side of the communication will send an acknowledgment back after receiving new data? If yes, how can we test if our device sent acknowledgment to the Nordic?

    BR,

    Bálint

Children
Related