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

Multilink central with UART

Hello,

I am trying to develop a sensor which can connect to multiple sensors and send the data which is received by its UART through bluetooth, at the peripheral. Central device reveives the data through the bluetooth and then sends it out through UART. I have tried the example given in the SDK and it is working fine. Now i want to add multilink features to the central device. I tried adding, but it did not work out. Can someone please help me out with the same? Is there any example program available for this?

SDK Used: NRF52 SDK 16.0

Chipset : NRF52832

IDE : Segger Embedded Studio

Regards,

Subbu

Parents
  • Hi Subbu

    If I understand you correctly you want a multilink version of the ble_app_uart_c example?

    I have thought about making such an example for a while, and can try to provide something by the end of the week if this is what you need. 

    Best regards
    Torbjørn

  • Yes. Exactly. I need the multilink version of ble_app_uart_c. Please let me know once you have it.

    Thanks,

    Subbu

  • Hi Subbu

    In any BLE connection you will have one central and one peripheral, but you can send data any way you like, it doesn't matter if you are on the central or peripheral side. 

    The code I sent supports up to 4 central links, which means you can connect to 4 different peripheral devices at the same time. 

    When data is received from either of the peripheral devices it will be sent back to all of the connected peripheral devices. 

    The different connected peripherals can be identified by their unique connection handle, which is a 16-bit number that starts at 0 and is incremented by 1 for each additional connection. 

    Whenever you need to send some data to one of the peripherals you use the connection handle to identify them. 

    Best regards
    Torbjørn

  • Hi Torbjørn,

     

    Thank you for the reply. In the earlier example, which came along with the SDK, the ble central was getting conncected to devices with the target device names. I felt that was better to create multiple networks in a single area (i.e., multiple centrals and peripherals together, but they connect to their respective device names). 

    And according to you, just clearing the Echoback should solve all my other concerns. Will check it and get back to you in case if there is anything.

    Regards,

    Subbu

  • Hi Subbu

    The good thing is that the connection establishment process is controlled from the application, so if you want to enforce a certain connection strategy or naming policy of devices you are able to do so. 

    If you have any more questions just let me know Slight smile

    Best regards
    Torbjørn

  • Hi,

    I tried the nrf52-ble-app-uart-c-multilink example but I get NRF_ERROR_BUSY when connecting to more than one ble_app_uart peripheral.

    If I turn on the peripherals one at a time they all connect.

    If all the peripherals are on when I turn on the central I get the NRF_ERROR_BUSY error.

    Can you give me some advice about this issue?

    Best regards,

    Marcio

  • Hi Marcio

    Which call returns NRF_ERROR_BUSY?

    Are you able to connect to 2-3 devices at the same time?

    In the multi link demo on Github I restricted the central to connect to one device at a time, as I saw similar issues. You should be able to put in a similar limit, and stop scanning once you are in the process of connecting to a certain number of devices. 

    Best regards
    Torbjørn

Reply
  • Hi Marcio

    Which call returns NRF_ERROR_BUSY?

    Are you able to connect to 2-3 devices at the same time?

    In the multi link demo on Github I restricted the central to connect to one device at a time, as I saw similar issues. You should be able to put in a similar limit, and stop scanning once you are in the process of connecting to a certain number of devices. 

    Best regards
    Torbjørn

Children
  • Hi Torbjørn,

    Is it possible that ble-app-uart-c-multilink can support more than 4 peripheral connections ? As far as I know, regular ble_app_multilink_central example supports up to 20 concurrent connections, but that example is meant for led blinking, not for sending data. Is it related with RAM size of Soft Device ?

    Best Regards

  • Hi 

    Running up to 20 links is mainly a question of RAM, that is correct, and the nRF52832 might come a bit short in this regard. That being said there is not a huge difference in RAM consumption between the blinky service and the UART service if you keep the max MTU size to the default 27 bytes. 

    I haven't checked the exact numbers, but if you can do 20 blinky connections on the nRF52832 I would expect you to be able to do the same with 20 NUS connections. 

    Then there is the question of application RAM consumption. If you need a lot of RAM for other things in your application it might be better to go for the nRF52833 or the nRF52840 where you have more RAM available. 

    Best regards
    Torbjørn

  • Thanks for the explanation.
    So if we use nRF52840, we can have up to 20 NUS connections. I mean at least, we can try that.

    For 20 peripheral connections, are the modifications below enough ?


    #define NRF_SDH_BLE_PERIPHERAL_LINK_COUNT 0

    #define NRF_SDH_BLE_CENTRAL_LINK_COUNT 20

    #define NRF_SDH_BLE_TOTAL_LINK_COUNT 20

    Best Regards

  • Hi 

    Yes, those changes should be enough. Please be aware that once you run the code after making these changes you will most likely get an error message asking you to increase the amount of RAM assigned to the SoftDevice. 

    The error message will include the RAM settings that you need to apply to ensure the SoftDevice has enough RAM. 

    Best regards
    Torbjørn

Related