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

Establishing one to many connection with BLE on nRF51 DK

Hi,

I am trying to build an application for nRF51DK which would continuously collect data from multiple BLE devices. Since there is no example for multiple connections application anywhere, I decided to start from zephyr/samples/bluetooth/central_hr - as the board will play central role in the architecture, and I do have two devices with Heart Rate service. I modified is slightly so that after creating first connection it starts scanning again and looks for another HR sensor. When it finds it it tries to create second connection.

I tried to simply create two bt_conn structures and call bt_conn_le_create() twice, each time after receiving advertisement from HR sensor. However, in this case when trying to create second connection, bt_conn_le_create() returns -12 error.

I am aware of the SoftDevice which should make it possible for the board to establish more than one connection. However I am not exactly sure how to implement the softdevice, and my knowledge is not sufficient to tell what exactly softdevice is. I am working on 1.3.0 SDK and I use Segger Studio to upload my application.

My question is - what is the "required" algorithm for establishing multiple BLE connections - from one central to many peripherals (star network)? Should multiple bt_conn_le_create() calls be enough? Or something in between has to happen?

Regards

Maciek

Parents
  • I have the same issue. Were you able to solve it? 

    I am using nrf52840 dev kit with NCS V1.3.0

    I have this issue, that if I am starting the scan after the first connection, the wireshark no longer shows that 1st connection as master and slave. 
    For me while bt_conn_le_create() does not show any error but the wireshark does not show either of the connections. On the tera term terminal window , I can see that my both devices are connected since they do not return an error but when I open wireshark to confirm that, no connection is there
  • Hi

    Did you make sure to set the CONFIG_BT_MAX_CONN parameter to the number of connections you need to support?

    The Wireshark sniffer is not very well suited for multilink applications, as it can only sniff one connection at a time. 

    Best regards
    Torbjørn

  • As ovrebekk said, for me setting CONFIG_BT_MAX_CONN solved the issue. If you are building on the central_hr sample, you might want to make sure that scanning is started again after establishing first connection. And most likely you will need to change the main code a bit to handle multiple connections. But in principle changing BT_MAX_CONN to something bigger should allow you establish multiple connections at the same time.

Reply
  • As ovrebekk said, for me setting CONFIG_BT_MAX_CONN solved the issue. If you are building on the central_hr sample, you might want to make sure that scanning is started again after establishing first connection. And most likely you will need to change the main code a bit to handle multiple connections. But in principle changing BT_MAX_CONN to something bigger should allow you establish multiple connections at the same time.

Children
No Data
Related