DMM Wsn Node + BLE Remote Display

Table of Contents

Introduction

The dmm_wsnnode_remote_display project showcases a dynamic multi-protocol example which enables concurrent proprietary Sub-1G and BLE5. This example implements a Sub-1G Wireless Sensor Network Node with a BLE Remote Display, using TI’s DMM (Dynamic Multi-protocol Manager) to enable the multi-protocol and dual band features of the CC1352.

The BLE remote display allows a SmartPhone App to provision the Sub-1G node and to see data on the Sub-1G network.

This project has the following app configurations available:

App Build Configuration Description
FlashROM_Release (default) All TI-RTOS debug features disabled but application-logging to UART remains enabled.
The application uses the config file ble_release.cfg and the defines are in <app name>_FlashROM_Release.opt.
FlashROM_Debug All TI-RTOS debug features enabled.
The application uses the config file ble_debug.cfg and the defines are in <app name>_FlashROM_Debug.opt.

All application configurations use the stack library configuration, FlashROM_Library. This build configuration will yield additional flash footprint optimizations by the linker since the application and stack can share contiguous flash pages. This configuration is further discussed in the Stack Library Configuration section of the BLE5-Stack User’s Guide provided in the SDK.

This document discusses the procedure for using the Wsn Node Remote Display application when the FlashROM_Release configuration is used.

Hardware Prerequisites

The default Simple Peripheral configuration uses the LAUNCHXL-CC1352. This hardware configuration is shown in the below image:

For custom hardware, see the Running the SDK on Custom Boards section of the BLE5-Stack User’s Guide.

Software Prerequisites

For information on what versions of Code Composer Studio and IAR Embedded Workbench to use, see the dependencies section of the Release Notes located in the root folder of the SDK. For information on how to import this project into your IDE workspace and build/run, please refer to the device’s Platform section in the BLE5-Stack User’s Guide.

Service/Profile Table

This project contains 1 service, which has 5 characteristics.

Note that BLE Scanner may report 128 bit UUIDs, but the project is generating 16 bit UUIDs.

Characteristic UUID Format Properties Profile Source
Node Data 1181 1 Byte Integer Read/Notify peripheral.c/remote_display_gatt_profile.c
Node Report Interval 1182 1 Byte Integer Read/Write peripheral.c/remote_display_gatt_profile.c
Conc LED Identify 1183 1 Byte Integer Read/Write peripheral.c/remote_display_gatt_profile.c
Node Address 1184 1 Byte Integer Auth Read/Write peripheral.c/remote_display_gatt_profile.c

Dynamic Multi-protocol Manager

The DMM uses 2 main components to dynamically arbitrate the RF resource.

TI Agama devices are capable of dual band operation, the CC1352 Launchpad (TI Agama development platform) has a dual band antenna which performs well in the 868/916MHz band as well as the 2.4GHz band. Using the DMM on an Agama devices enables not only multi protocol, but also dual band. The below diagram shows how the DMM allows 2 stacks to run on the same device, which was previously only possible on 2 devices. In the diagram the Stack 1 is shown functioning along side Stack 2, this could be a BLE stack and a proprietary Sub1G stack (called Wireless Sensor Network) or a 15.4 Stack. The Stacks used are defined by the developer.

Single mode setup:

DMM Setup:

The DMM makes scheduling decisions based on the current policy, which can be changed by the application based on the stack states. States are specific to the type of stack and are defined by the DMM developer for state that are of interest to the policy. The policy is define in a policy table. A simplified policy table is shown below, it defines the behavior when Stack 1 is advertising or connected and does not take into account the specific state of the stack 2 (i.e. any state). It specifies that when Stack 1 is in advertising state then stack 2 takes higher priority, any RF scheduling conflicts will be resolved in favor of Stack 2. When Stack 1 is in connected state then Stack 1 takes priority, any scheduling conflicts will be resolved in favor of the Stack 1.

Stack 1 State Stack 2 State Priority Description
Advertising Any Stack 1 Stack 1 Radio usage is preempted by stack 2
Connected Any Stack 2 Stack 2 Radio usage is preempted by stack 1

The policy used in this example is more complex than the illustration above. For details of the actual policy used refer to <SDK DIR>\source\ti\common\dmm\dmm_policy_blesp_154sensor.c/h.

The DMM also supports pausing/resuming stacks based on a policy change. This is achieved by an application callback, which is called from the DMM policy manager when a policy change requiring a stack to pause operation is entire. An example of pausing the BLE stack is provided in the 802.15.4g Sensor + BLE DMM example.

See the DMM chapter in your protocol stack user’s guide for more information about DMM.

Usage

This example should be used in conjunction with the EasyLink rfWsnConcentrator. It is advised that you use the CC1352_LAUNCHXL rfWsnConcentrator located at ../easylink/rfWsnConcentrator. Alternatively a different CC13xx concentrator can be used, however some features may not be available.

This application uses the UART peripheral to provide an interface for the application. The UART is only used for display messages.

This document will use Teraterm to serve as the display for the output of the CC1352 LaunchPad. The BLE Scanner smartphone application will act as the BLE Central device that will connect to the Remote Display service in this example. The BLE Scanner smartphone application is available on App Store and Google Play. Note that any other serial terminal and smart phone BLE application can be used. The following default parameters are used for the UART peripheral for display:

UART Param Default Values
Baud Rate 115200
Data length 8 bits
Parity None
Stop bits 1 bit
Flow Control None

Note: If you are using a smartphone as the BLE central device and the same CC1352 LaunchPad was used previously with a different DMM or BLE example then you may need to forget the device in the smartphone BLE settings, then disable and enable BLE. Not doing this could result in the smartphone application displaying incorrect services and characteristics

Once the Wsn Node Remote Display application starts, the output to the terminal will report its address and the fact that it is advertising, as shown below:

The WsnConcentrator should be outputting the Sub-1G sensor as shown below:

The default reporting interval is 1s.

Advertising is enabled by default upon startup, so there is no need to physically press a button to start advertising. Using BLE Scanner to scan for the device, you should see a device with the name of Node Remote Display (note that the navigation might be slightly different depending on your mobile application):

If there is more than 1 device called Node Remote Display, the RSSI value under the strength bars on the left can be used to find which device you are trying to connect to. Press the “connect” button to connect to the device. When prompted enter the pairing code “123456”.

Once connected, the terminal window will show the address of the connected device (smartphone):

In BLE Scanner, you should be able to see various information about the Node Remote Display device:

You should see 1 service, which is labeled as “CUSTOM SERVICE” (this may be slightly different for other smartphone applications). It will also provide its UUID. Clicking on this service will display the 3 characteristics that it contains, with information about each characteristic:

Scrolling down should show all 3 characteristics. The following sections detail the functions and operations of each of the characteristics.

Node Data Characteristic (UUID: 1181)

This characteristic demonstrates read only and notify properties, and it contains a 1-byte-long value indicating the Sub-1G node data. By default the BLE Scanner application enables the notifications (this may be different with other apps or versions of this app), notice that the value is updating every 1s. Click on the “Read, Notify” item to see more information about the characteristic. From here you can disable the notifications and read the characteristic manually.

If you disable notifications then make sure you re-enable them as this will be useful when changing the report interval later.

Node Report Interval Characteristic (UUID: 1182)

This characteristic demonstrates read and write properties, it contains a 1-byte-long value indicating the Sub-1G report interval in seconds. By default this is set to 1s, you will notice that both the Node Data on the Concentrator and the Node Data on the Remote Display is updated every 1s. This 1s update can also be seen on the BLE Scanner app when notifications are enabled. In the BLE Scanner application scroll down to the second characteristic of the “CUSTOM SERVICE”, then Click on the “Read, Write” item of the Node Report Interval characteristic to see more information about the characteristic. From here you can read and write the report interval. When a value is written the rate at which node data is updated changes to reflect the new value.

Concetrator LED Identify (UUID: 1183)

This characteristic demonstrates read and write properties, it contains a 1-byte-long value used to make the Sub1GHz Wireless Sensor Network Concentrator blink its LED. Writing 1 to this characteristic will cause the Node Remote Display device to send a message over the Sub1GHz network to the network Concentrator instructing it to blink its LED. The network concentrator LED will blink 5 time when this message is received. The Characteristics value will reset back to 0 when the Concentrator acknowledges it has received the message. In the BLE Scanner application scroll down to the 3rd characteristic of the CUSTOM SERVICE, then click on the “Read, Write” item of the Concentrator LED Identify characteristic to see more information about the characteristic. From here you can write 01 to send a concentrator identify message.

Node Address Characteristic 3 (UUID: 1184)

This characteristic has read and write properties. Reading the chracteristic shows the node address reported by the concentrator. Writing to the characteristics will cause a new node with that address to appear on the concentrator’s display.

Switching to SLR Mode

The following steps will allow you to use the easylink network on a SLR (Simplelink Long Range) PHY.

Change the PHY for the Node Application: Modify the RADIO_EASYLINK_MODULATION in RadioProtocol.h. Use EasyLink_PHY_5KBPSSLLR instead of EasyLink_PHY_Custom.

Change the PHY for the Concentrator Application: Modify the RADIO_EASYLINK_MODULATION in RadioProtocol.h. Use EasyLink_PHY_5KBPSSLLR instead of EasyLink_PHY_Custom. Modify the NORERADIO_ACK_TIMEOUT_TIME_MS in ConcentratorRadioTask.c. Use ‘500’ instead of ‘160’

Rebuild both the DMM Application and the Concentrator Application with these changes.

Switching Stack Priorities

By default the BLE stack is a higher priority where WSN is a lower priority in every state except for Advertising. This is done to keep the latency associated with the user experience over the BLE connection as little as possible. However, if you cannot justify lowering the Sub-1G stack’s priority when a BLE connection is activated there is an alternative policy you can choose. This alternative policy states that the Sub-1G WSN network will have a high priority at all times except when the BLE stack is in the connecting state. This means that the tight timing requirements from BLE when a connection is being set up can be maintained and once the connection is running WSN can have high priority again. This minimizes the time that WSN has low priority while also providing the best scenario for a connection to be made.

To enable the alternative Sub-1G high priority policy one must exclude the current policy implementation file from the build and include the alternative implementation file. Within CCS, right click on ‘\Dmm\dmm_policy_blesp_wsnnode_ble_high.c’ and select ‘Exclude From Build’. Then right click on ‘\Dmm\dmm_policy_blesp_wsnnode_sub1g_high’ and deselect ‘Exclude From Build’. Perform a rebuild of the project.

DMM Limitations

The following limitations exist in the DMM implementation: