Coder Social home page Coder Social logo

nrf52-ble-multi-link-multi-role's Introduction

Bluetooth 5 multi link demo

Overview

This demo is meant to illustrate the multi role and multi phy capabilities of the Nordic SoftDevices.

The demo is based around an aggregator node, running on an nRF52840DK (recommended) or an nRF52DK. The aggregator node is set up to connect to any device in the area that supports either the Thingy:52 services, or the LBS service used by the ble_app_blinky example. By using the 20 link feature of the S132 or S140 SoftDevices the aggregator can connect to up to 20 devices at the same time, where 19 of these devices will be ble_app_blinky or Thingy devices, and 1 device can be a smart phone. The aggregator will collect information on all the connected devices, and relay the information to the UART and to the connected smart phone over BLE. From the phone application the user can control the LED color and state of the connected devices, and get an overview over the following details from the connected devices:

  • Advertising name
  • Connection handle (ID)
  • Button state
  • LED state
  • Phy
  • RSSI

System overview

Requirements

  • 1x nRF52840DK or nRF52DK for the aggregator (nRF52840DK recommended for Bluetooth long range support)
  • Up to 19 total of the following devices
    • Thingy:52 running the standard firmware
    • nRF52DK or nRF52840DK running the ble_app_blinky firmware available in the nRF5 SDK
    • nRF52840DK and an Adafruit Touch Display running the ble_peripheral_long_range demo included in this repo
    • nRF52840DK and a Neopixel Shield running the ble_peripheral_long_range_color demo included in this repo
  • An Android device running the multi link app (optimized for large phones or small tablets). APK included in the android_apk folder.
  • nRF5_SDK_v15.2.0 is required to compile the examples.

Demo usage

Buttons and LED's

Aggregator

LED Button
1 Blinking: Advertising
On: Connected to phone app
1 Disconnect phone app
2 Fast blink: Scanning for BLE devices in normal 1M mode
Slow blink: Scanning for BLE devices in coded phy (long range) mode
Off: Scanning disabled, or busy establishing a connection to a device
2 Enable/disable scanning
3 Shows incoming button presses from connected long range peripherals 3 Toggles LED on/off on all connected peripherals
4 One or more long range devices connected 4 -

ble_long_range_peripheral_color

LED Button
1 On: Advertising 1 Toggle between normal mode and range test mode (see description below)
2 On: Connected 2 Toggle between smooth or fast LED fading when changing LED color
3 Shows LED on/off state when set by aggregator 3 -
4 - 4 Send button status to the aggregator

Operation mode: This demo can be used in two different modes when connected to the aggregator. In normal mode the LED matrix will show a single color, and the color and intensity can be controlled by the aggregator. In long range test mode the color will be set by the link quality. When the link is good the color will be green, and as the link gets poorer the color will fade into yellow and red while the speed of the pulsing will be reduced. This allows the quality of the link to be monitored continuosluy while the kit is moved around.

LED fade mode: In normal mode the LED color is controlled by the aggregator. By default the LED's will fade slowly from one color to another when changing the color on the aggregator side, but this can be changed to make the color change more immediate. This makes it easier to evaluate latency, and makes the LED update similar to how it works on the Thingy:52 devices.

nrf52-ble-multi-link-multi-role's People

Contributors

ovrebekk avatar rallare avatar too1 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nrf52-ble-multi-link-multi-role's Issues

Ft6206 touchscreen driver

how to test Ft6206 using the adafruit touch display library . where to place the folder & which nRF52840 -DK SDK example to be used . i tried using Twi_master using_twi_mngr , even change app_twi to nrf_ twi_mngr using the breakouty boarf of 2.8 Adafruit with ili9341& Ft6206 combination .
please could you guide . thanks in advance

nrf52-ble-multi-link-multi-role support on nRF52832

Hi,

From the SES project of nRF52832(nrf52-ble-multi-link-multi-role support), I done below changes to increase the central link and total link count accordingly to support 20 connections on nRF52832 DK.

But when i flashed to nRF52832 DK board through SES aggregator S132 project, I could not see the device advertising as a aggregator role.

Please provide your inline comments to below queries,

1. When using BLE multi link multi role example to verify 20 connection support on nRF52832, But i could see S132 soft device is not available in the nrf52-ble-multi-link-multi-role example folder.Please help to provide S132 soft device for using nrf52-ble-multi-link-multi-role example.

Note: For nRF52840 there is a S140 seperate softdevice provided in the nrf52-ble-multi-link-multi-role example(nrf52-ble-multi-link-multi-role-master\ble_aggregator\pca10056\s140\s140_nrf52840_6.0.0-6.alpha) - s140_nrf52840_6.0.0-6.alpha_softdevice.hex file

2. Please let me know, what configurations need to be made in the SES project of aggregator example to support 20 connections in nRF52832 ?

And added below changes in app_util.h(increased value 15 to 20):

#define MACRO_MAP_FOR(...) MACRO_MAP_FOR_(VA_ARGS)
#define MACRO_MAP_FOR_N_LIST 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20
#define MACRO_MAP_FOR_(...) MACRO_MAP_FOR_N(NUM_VA_ARGS_LESS_1(VA_ARGS), VA_ARGS)

SDK_config.h file:

// NRF_SDH_BLE_CENTRAL_LINK_COUNT - Maximum number of central links.
#ifndef NRF_SDH_BLE_CENTRAL_LINK_COUNT
//#define NRF_SDH_BLE_CENTRAL_LINK_COUNT 8
#define NRF_SDH_BLE_CENTRAL_LINK_COUNT 19
#endif

// NRF_SDH_BLE_TOTAL_LINK_COUNT - Total link count.
// Maximum number of total concurrent connections using the default configuration.

#ifndef NRF_SDH_BLE_TOTAL_LINK_COUNT
//#define NRF_SDH_BLE_TOTAL_LINK_COUNT 9
#define NRF_SDH_BLE_TOTAL_LINK_COUNT 20
#endif

// NRF_SDH_BLE_GAP_EVENT_LENGTH - GAP event length.
// The time set aside for this connection on every connection interval in 1.25 ms units.

#ifndef NRF_SDH_BLE_GAP_EVENT_LENGTH
//#define NRF_SDH_BLE_GAP_EVENT_LENGTH 6
#define NRF_SDH_BLE_GAP_EVENT_LENGTH 12
#endif

  1. And let me know the RAM configurations to done in SES, to support 20 connection on nRF52832 with the multi link multi role example.

Thanks,
Prasanna

aggregator and peripheral won't discovered or connect using CODED PHY.

test using PCA10056 V0.9.2 x2, one programmed with s140_nrf52_6.1.1_softdevice.hex + ble_peripheral_lr_pca10056_s140.hex and another programmed with s140_nrf52_6.1.1_softdevice.hex + ble_aggregator_pca10056_s140.hex. all hex files come from demo_hex_files/hex directory. when peripheral switched to 1MBPS PHY or 2MBPS PHY both work as expected and link correctly, while peripheral switched to auto or multi mode then start advertising, aggregator could not connect to peripheral, seems like advertising not discovered by aggregator. no ERROR message printed from PCA10056's uart, tried to compile with SES and debug, no error message displayed on the RTT console, only normal message displayed.

compiler problems -ble_aggregator

......\main.c(155): error: #20: identifier "BLE_GAP_SCAN_FP_ACCEPT_ALL" is undefined
.filter_policy = BLE_GAP_SCAN_FP_ACCEPT_ALL,
......\main.c(156): error: #20: identifier "BLE_GAP_SCAN_DUPLICATES_REPORT" is undefined
.filter_duplicates = BLE_GAP_SCAN_DUPLICATES_REPORT,
......\main.c(155): error: #136: struct "" has no field "filter_policy"
.filter_policy = BLE_GAP_SCAN_FP_ACCEPT_ALL,
......\main.c(229): error: #20: identifier "BLE_GAP_TX_POWER_ROLE_SCAN_INIT" is undefined
err_code = sd_ble_gap_tx_power_set(BLE_GAP_TX_POWER_ROLE_SCAN_INIT, BLE_CONN_HANDLE_INVALID, 8);
......\main.c(229): error: #140: too many arguments in function call
err_code = sd_ble_gap_tx_power_set(BLE_GAP_TX_POWER_ROLE_SCAN_INIT,
LE_CONN_HANDLE_INVALID, 8);
......\main.c(508): error: #136: struct "" has no field "scan_phy"
m_device_being_connected_info.phy = m_scan_params.scan_phy;
......\main.c(588): error: #20: identifier "BLE_GAP_TX_POWER_ROLE_CONN" is undefined
err_code = sd_ble_gap_tx_power_set(BLE_GAP_TX_POWER_ROLE_CONN, p_gap_evt->conn_handle, 8);
......\main.c(588): error: #140: too many arguments in function call
err_code = sd_ble_gap_tx_power_set(BLE_GAP_TX_POWER_ROLE_CONN, p_gap_evt->conn_handle, 8);
......\main.c(609): error: #136: struct "" has no field "scan_phy"
if(

LE_CONN_HANDLE_INVALID, 8);
......\main.c(508): error: #136: struct "" has no field "scan_phy"
m_device_being_connected_info.phy = m_scan_params.scan_phy;
......\main.c(588): error: #20: identifier "BLE_GAP_TX_POWER_ROLE_CONN" is undefined
err_code = sd_ble_gap_tx_power_set(BLE_GAP_TX_POWER_ROLE_CONN, p_gap_evt->conn_handle, 8);
......\main.c(588): error: #140: too many arguments in function call
err_code = sd_ble_gap_tx_power_set(BLE_GAP_TX_POWER_ROLE_CONN, p_gap_evt->conn_handle, 8);
......\main.c(609): error: #136: struct "" has no field "scan_phy"
if(
LE_GAP_PHY_CODED == m_scan_params.scan_phy)
......\main.c(911): error: #136: struct "" has no field "properties"
adv_params.properties.connectable = 1;
......\main.c(912): error: #136: struct "" has no field "properties"
adv_params.properties.scannable = 1;
......\main.c(913): error: #136: struct "" has no field "properties"
adv_params.properties.legacy_pdu = 1;
......\main.c(917): error: #136: struct "" has no field "duration"
adv_params.duration = PERIPHERAL_ADV_TIMEOUT_IN_SECONDS * 100;
......\main.c(922): error: #29: expected an expression
.primary_phy = BLE_GAP_PHY_1MBPS,

nrf52-ble-multi-link-multi-role

Hi,

We are trying to validate 20 connections feature on nRF52832 by using this nrf52-ble-multi-link-multi-role example.Falshed the latest nrf52-ble-multi-link-multi-role example on nRF58232(PCA10040_S132), which has coded_phy disabled.

But after aggregator connected to all peripherals, I am not able to see connected devices on the android app provided in the nrf52-ble-multi-link-multi-role example.

Please help to resolve the problem. And also let us know, Why android app unable to show the nRF52832 aggregator connected devices by using latest nrf52-ble-multi-link-multi-role example nRF52832 code?

Note:

  1. On UART (PUTTY), able to see all connected peripheral devices(Blinky example) to aggregator.
  2. This issue(Not able to see connected devices on android app) only after the coded_phy disabled on nRF52832.

Cannot debug.

I am trying to use the firmware with an android app build by me, however, I can't trace what commands the original app is sending- ex to switch on just the led on the 1st connected board. And debugging is also really hard as the code is pretty complex.
Can someone please share what data the app is sending to the Aggregator?

Update to use SDK 15.x

Is there any chance of updating this to use the newer SDK like15.x to use with the 6.x versions of the S140 soft device?

BLE aggregator usecase support on nRF52832

Hi,

I am able to verify the usecase of nrf52-ble-multi-link-multi-role example in SDK 14.2.0(Used SES project) on nRF52840 DK boards.

Now want to verify the usecase of nrf52-ble-multi-link-multi-role example on nRF52832 DK boards, But i do not see softdevice for nRF52832 and nrf52-ble-multi-link-multi-role SES project for nRF52832.
So please provide SES project of nrf52-ble-multi-link-multi-role example for nRF52832 DK boards ASAP to verify the usecase on nRF52832.

Thanks,
Prasanna

where can to fine the Android apk source code

Hello,
would you tell me where can find the "android-multi-link-demo-debug.apk" source code,
I want build an simply BLE application base on the project for something real IoT project

Update Firmaware to NRF52:thingy

Hi,
We want to flash ble_peripheral over nrf52. How can we proceed?
When we try to compile code using Seeger studio we get following errors..


1> cc1: fatal error: opening output file C:/nRFC52840/Thing-Multilink/nRF5_SDK_14.2.0_17b948a/nRF5_SDK_14.2.0_17b948a/examples/training/nrf52-ble-multi-link-multi-role-master/nrf52-ble-multi-link-multi-role-master/ble_peripheral/pca10040/s132/ses/Output/ble_app_blinky_pca10040_s132 Release/Obj/thumb_crt0_PP.s: No such file or directory
1> compilation terminated.
2> cc1: fatal error: C:\nRFC52840\Thing-Multilink\nRF5_SDK_14.2.0_17b948a\nRF5_SDK_14.2.0_17b948a\examples\components\libraries\experimental_log\src\nrf_log_backend_rtt.c: No such file or directory
2> compilation terminated.
3> cc1: fatal error: C:\nRFC52840\Thing-Multilink\nRF5_SDK_14.2.0_17b948a\nRF5_SDK_14.2.0_17b948a\examples\components\libraries\experimental_log\src\nrf_log_backend_serial.c: No such file or directory
3> compilation terminated.
4> cc1: fatal error: C:\nRFC52840\Thing-Multilink\nRF5_SDK_14.2.0_17b948a\nRF5_SDK_14.2.0_17b948a\examples\components\libraries\experimental_log\src\nrf_log_backend_uart.c: No such file or directory
4> compilation terminated.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.