Hi All,
I'm using nrf Connect SDK v1.7.0 with Vs Code
So here I can see in the debug prints that Bluetooth device is able to get connection successfull callback and Immediately I get disconnection callback with this error reason.
Hi All,
I'm using nrf Connect SDK v1.7.0 with Vs Code
So here I can see in the debug prints that Bluetooth device is able to get connection successfull callback and Immediately I get disconnection callback with this error reason.
Hi
BT_HCI_ERR_CONN_FAIL_TO_ESTABLISH will happen from time to time. This means that the peripheral didn't respond to the connect request correctly (only one request is sent per connect attempt). It's normal for this error to happen from time to time, but it can for example happen if there is lots of noise or interference from nearby sources. It could also be due to a whitelisting issue, that either side of the connection simply doesn't allow connections to the device it's trying to connect with. Hard to say without a bit more information on what you're doing.
Best regards,
Simon
We're trying to connect these mutliple peripheral devices one at a time, which comes out of sleep every 3 minutes and advertises. On receiving matching bluetooth Address I'm going for connect request. using following Api.
param2.interval_max = 30;
param2.interval_min = 7;
param2.latency = 0;
param2.timeout = 400;
err = bt_conn_le_create(addr, BT_CONN_LE_CREATE_CONN,
¶m2, conn);
I'm not whitelisting or anything as such deliberately
Please ask me if you need any specific details.
Thanks & Regards
Viswa
Hi
What kinds of devices are the central device and the peripherals in this use case? Do these fail to establish errors occur even when trying to connect to the first peripheral as well, or only when trying to connect to peripheral number X? It could be that the maximum number of connected devices has been reached by the central device. What is your CONFIG_BT_MAX_CONN set to in the central application for example?
Best regards,
Simon
Hi Simon,
Sorry for late reply.
What is your CONFIG_BT_MAX_CONN set to in the central application for example?
I have not used that setting in our application and I clear bt_conn variables used for connection after every disconnection.
Do these fail to establish errors occur even when trying to connect to the first peripheral as well, or only when trying to connect to peripheral number X?
Our application acts a central, with two peripheral sensors all placed together currently and in field they are placed meters apart.
As I said these are very near to the central device and disconnection occurs randomly not particularly with one peripheral device.
Do I need to stop peripheral advertising before I go for a central connection?
I use internal software timer to count milliseconds in our code does it has a toll on performance.
Hi
I assume the CONFIG_BT_MAX_CONN is set to some value by default in your application either way? Can you show us how you clear the BT conn variables upon a disconnect?
It should not be necessary to stop advertising in order to connect, as a scanning central device will establish a connection with advertising devices.
What sample project is your central application based on? It might be that the connection establishment isn't handled correcty, and it for some reason tries to connect to both advertising devices at the same time at some points.
Best regards,
Simon