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

How to send message from two slave to one master in nRF52

I hope to send a message from two slave to one master using nRF52 through bluetooth.

I send a message from a slave to a master with ble_app_uart_c and ble_app_uart. And I also connected two slave and one master with ble_app_multilink_central and peripheral. But I can't combine and apply that two case.

So please tell me how to send a message in multilink code, or how to use ble_app_uart as multilink.

I also found some information on internet, but I can't understand with them.

Parents
  • FormerMember
    0 FormerMember

    Yes,  on_ble_evt() is the same as ble_evt_handler(). 

    The steps above is based on SDK 12 or 13.

    From SDK 14.0.0, ble_evt_dispatch() was replaced by NRF_SDH_BLE_OBSERVER().

  • On the newest status, I've got 1 Error in Keil:

     error:  #167: argument of type "ble_nus_c_t (*)[8]" is incompatible with parameter of type "ble_nus_c_t *"

    The line is: ret_val = ble_nus_c_string_send(&m_ble_nus_c, data_array, index);

    Thats my code: 

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    /**
    * Copyright (c) 2014 - 2017, Nordic Semiconductor ASA
    *
    * All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without modification,
    * are permitted provided that the following conditions are met:
    *
    * 1. Redistributions of source code must retain the above copyright notice, this
    * list of conditions and the following disclaimer.
    *
    * 2. Redistributions in binary form, except as embedded into a Nordic
    * Semiconductor ASA integrated circuit in a product or a software update for
    * such product, must reproduce the above copyright notice, this list of
    * conditions and the following disclaimer in the documentation and/or other
    * materials provided with the distribution.
    *
    * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
    * contributors may be used to endorse or promote products derived from this
    * software without specific prior written permission.
    *
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    I don't understand this error 100%, is it because it can't match the pointers? 

    Thanks for your help :)

  • Hi Karl, 

    thank you for your reply. It's been a long way but I hope we could end it soon. 

    I will test the code and get back to you with my results.

  • I concur, this road has been long.

    I look forward to hearing your results!

    @kishorsherolla I do not think I ever understood your exact need, but perhaps this could be useful for you as well?

    Best regards,
    Karl

  • Hi 

    I am trying same thing here with nRF52840-DK Boards.

    Code attached above is built and connecting to other peripheral board as well. Thank you for sharing it.

    My Question is that To connect let say 4 to 5 peripheral sensor to one central device which method will be more efficient, Bluetooth mesh or by adding here in same example number of sensor.   

  • Hello Vipul2988,

    Vipul2988 said:
    Code attached above is built and connecting to other peripheral board as well. Thank you for sharing it.

    No problem at all, I am happy to hear that it is working!

    Vipul2988 said:
    My Question is that To connect let say 4 to 5 peripheral sensor to one central device which method will be more efficient, Bluetooth mesh or by adding here in same example number of sensor.   

    That depends a little on what you mean by efficient - do you mean in terms of latency or power consumption, etc?
    In general, for 4-5 sensors, the answer is very likely to use the multilink example. The Bluetooth mesh protocol requires the radio to be listening almost constantly, and thus its power consumption is a lot higher than that of BLE linked devices. Furthermore, the throughput through the mesh network is also a lot less than through BLE connections.
    If you elaborate on your requirements and constraints I can be more specific, but for 4-5 peripheral sensor devices sending data to a central the BLE connections will most likely be your best option.

    Best regards,
    Karl

  • Hi ,

    Thank you for your quick response.

    Efficient in terms of Latency I am talking about, though our application is not critical in which we want all sensor reading within 500ms to 1 second.

    also you provided good information for power efficiency point of view as well, that really helps.

    In addition, we have already BLE application is running in nRF52840 Customized board with internal Sensor data values, We want to expand the capability of our application/Device via adding external BLE compatible sensors. 

    I got my answer but want to know more if you have any PRONS and CONS related to our application using mesh vs. Multilink BLE connection. 

Reply
  • Hi ,

    Thank you for your quick response.

    Efficient in terms of Latency I am talking about, though our application is not critical in which we want all sensor reading within 500ms to 1 second.

    also you provided good information for power efficiency point of view as well, that really helps.

    In addition, we have already BLE application is running in nRF52840 Customized board with internal Sensor data values, We want to expand the capability of our application/Device via adding external BLE compatible sensors. 

    I got my answer but want to know more if you have any PRONS and CONS related to our application using mesh vs. Multilink BLE connection. 

Children
  • Vipul2988 said:
    Thank you for your quick response.

    No problem at all, I am happy to help!

    Vipul2988 said:
    Efficient in terms of Latency I am talking about, though our application is not critical in which we want all sensor reading within 500ms to 1 second.

    Thank you for clarifying - this requirement should be fulfilled by either of the protocols, but I would still recommend the BLE multilink approach due to the number of devices and power consumption of BT Mesh.

    Vipul2988 said:
    In addition, we have already BLE application is running in nRF52840 Customized board with internal Sensor data values, We want to expand the capability of our application/Device via adding external BLE compatible sensors. 

    Thank you for elaborating, this makes your project much easier to understand and advice.
    If you only intend to have 4-5 peripheral devices, within BLE connection range, then I would suggest pursuing this with BLE multilink network topology.
    If you need this to be scalable, i.e suddenly adding more sensors and devices to it later, you might instead want to look at using Mesh topology.

    Vipul2988 said:
    I got my answer but want to know more if you have any PRONS and CONS related to our application using mesh vs. Multilink BLE connection. 

    If you want to discuss more in details the differences between BT Mesh and a multilink central, I would prefer it if you could open a new ticket on this separately, since it diverges from the original topic of this ticket. This keeps the forum tidy, and makes it easier for other forum-goers to find the answer if they have a similar question in the future.

    Best regards,
    Karl

  • Hello Vipul,

    I see that Amanda is helping you in the other ticket already.
    Please continue this in the other ticket, so we can avoid duplicating the issue.

    Best regards,
    Karl