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

How to get data from multi peripherals to one central via NUS

Dear all, now I am making a data sampling system with multi peripherals and one central. The peripherals sample data from sensor via SPI port and transmit data to the central, and the central board transmit data to the laptop via UART. Now I have made the peripherals with nRF52840s and sensors, and DK52832 as central. 

In firmware development, I copy the project "ble_app_uart__saadc_timer_driven__scan_mode" from NordicPlayground at Github and add some code for my sensor. I modified the "saadc_callback" function for SPI data sampling. This firmware is for the peripherals. Then I copy the project "nrf52-ble-app-uart-c-multilink-master" from NordicPlayground and make it for central firmware. 

The system works well for 1 peripheral and 1 central. But the data is mess up for 2 peripherals and 1 central. After reviewing the record, the data from two peripherals seems mixed together. I have changed the "Device name" in the code and make it different with different peripherals. What should I do for multi peripherals transfer data to the central via UART service? Any help will be appreciated. Thanks.

Parents Reply
  • Hi Matt, appreciate your kind reply. Yes, I have viewed your post before and studies it today again. Your solution looks great. I have some questions for your project. I am new to Nordic product and what I did is download the DK from Nordic website and modified the code based on my project. I also downloaded the code from NordicPlayground at Github and copy the files to the ..\NORDIC\nRF5_SDK_17.0.2_d674dde\examples\ble_peripheral on my desk. I notice that your code on Github is a fork of Zephyr Project. I am not familiar with that but I am studying on the Zephyr project. The method in your project such as "static void gatt_discover(struct bt_conn *conn)" is different with the function in softdevice such as "nRF5_SDK_17.0.2_d674dde" from Nordic. Do you have any suggestion for SDK from Nordic? Thanks.

Children
No Data
Related