nRF91x1: Hello DECT
This sample demonstrates how to transmit and receive IPv6 data over DECT NR+ between two devices. It shows the basic usage of the DECT NR+ stack through the DECT NR+ connection manager, with automatic peer discovery using mDNS. You can compile the sample to operate as either a Fixed Terminal (FT) or Portable Terminal (PT).
Requirements
The sample supports the following development kit:
Hardware platforms |
PCA |
Board name |
|
|---|---|---|---|
PCA10171 |
|
For more security, it is recommended to use the */ns variant of the board target.
When built for this variant, the sample is configured to compile and run as a non-secure application using security by separation.
Therefore, it automatically includes Trusted Firmware-M that prepares the required peripherals and secure services to be available for the application.
Overview
This sample shows how to perform the following operations:
Configure DECT NR+ settings using Kconfig options.
Use the connection manager to handle DECT NR+ connectivity.
Respond to network interface up/down events (
NET_EVENT_IF_UPorNET_EVENT_IF_DOWN).Use mDNS for peer device discovery.
Send periodic demo messages over IPv6 UDP to discovered peers.
Receive and log incoming UDP messages on port 12345.
Use system work queue for periodic message transmission.
Demonstrate bidirectional DECT NR+ networking.
Provide visual feedback using LEDs for connection status and transmission activity.
The sample supports two operational modes through Kconfig, with the connection manager handling all network operations:
Fixed Terminal (FT) mode - The connection manager creates networks and clusters, advertises as
dect-nr+-ft-device.Portable Terminal (PT) mode - The connection manager scans for and joins existing networks, advertises as
dect-nr+-pt-device.
Important
This sample uses default DECT NR+ MAC security credentials (integrity and cipher keys) that are stored insecurely in Zephyr settings. The default credentials are intended for development and demonstration purposes only.
User Interface
LEDs
- LED 1 - Connection Status:
Indicates the DECT NR+ network interface connection state:
ON - DECT NR+ interface is up and connected.
OFF - DECT NR+ interface is down and disconnected.
- LED 2 - Transmission Activity:
Indicates UDP message transmission activity:
ON - Actively transmitting a message (briefly turns on during each send).
OFF - Not transmitting (idle state).
The LED turns on before sending each periodic demo message and turns off after the transmission completes.
Configuration
See Configuring and building for information about how to permanently or temporarily change the configuration.
Configuration options
The sample uses the DECT NR+ driver’s Kconfig options for configuration. You can customize the following key options:
- CONFIG_HELLO_DECT_MAC_DEMO_INTERVAL
(int) Demo message interval in seconds
Interval in seconds for sending demo messages when connected.
Additional options
CONFIG_DECT_DEFAULT_NW_ID- The sample overrides the default network ID to0x12345678.CONFIG_DECT_DEFAULT_DEV_TYPE_FT- The sample configures the device as FT only. The device will create a cluster. Sets hostname todect-nr+-ft-deviceand resolvesdect-nr+-pt-device.localas peer.CONFIG_DECT_DEFAULT_DEV_TYPE_PT- The sample configures the device as PT only. The device will join existing cluster. Sets hostname todect-nr+-pt-deviceand resolvesdect-nr+-ft-device.localas peer.CONFIG_NET_HOSTNAME- The sample sets the hostname todect-nr+-ft-devicefor FT mode anddect-nr+-pt-devicefor PT mode. This hostname is advertised using mDNS and used for peer discovery.
Building and running
This sample can be found under samples/dect/hello_dect in the nRF Connect SDK folder structure.
For more security, it is recommended to use the */ns variant of the board target (see the Requirements section above.)
When built for this variant, the sample is configured to compile and run as a non-secure application using security by separation.
Therefore, it automatically includes Trusted Firmware-M that prepares the required peripherals and secure services to be available for the application.
To build the sample, follow the instructions in Building an application for your preferred building environment. See also Programming an application for programming steps and Testing and optimization for general information about testing and debugging in the nRF Connect SDK.
Note
When building repository applications in the SDK repositories, building with sysbuild is enabled by default.
If you work with out-of-tree freestanding applications, you need to manually pass the --sysbuild parameter to every build command or configure west to always use it.
Building for FT mode
To build the sample for FT operation, use the extra configuration file:
west build -p -b nrf9151dk/nrf9151/ns -- -DEXTRA_CONF_FILE=ft.conf
Building for PT mode
To build the sample for PT operation, use the extra configuration file:
west build -p -b nrf9151dk/nrf9151/ns -- -DEXTRA_CONF_FILE=pt.conf
Building with DECT NR+ L2 Shell
To enable the DECT MAC L2 shell for debugging and configuration, use the extra configuration file:
west build -p -b nrf9151dk/nrf9151/ns -- -DEXTRA_CONF_FILE=shell.conf
You can also have multiple extra configuration files. For example, to build an FT device with shell enabled, use the following command:
west build -p -b nrf9151dk/nrf9151/ns -- -DEXTRA_CONF_FILE="ft.conf;shell.conf"
The DECT NR+ L2 shell provides commands for:
Activating/deactivating the DECT stack
Scanning for networks and RSSI
Configuring DECT settings
Managing associations
Viewing status information
Use dect help in the shell to see all available commands.
Note
Certain DECT NR+ settings changed at runtime using the DECT NR+ L2 shell dect sett command must be set before the connection is established to take effect on the modem. This includes changes to identifiers like the network ID or the device type, as well as resetting settings to default values.
Testing
After programming the sample to your development kit, complete the following steps to test it:
Connect the kit to the computer using a USB cable. The kit is assigned a serial port. Serial ports are referred to as COM ports on Windows, /dev/ttyACM devices on Linux, and /dev/tty devices on macOS. To list Nordic Semiconductor devices connected to your computer together with their serial ports, open a terminal and run the
nrfutil device listcommand. Alternatively, check your operating system’s device manager or its equivalent.Connect to the kit with a terminal emulator (for example, the Serial Terminal app). See Testing and optimization for the required settings and steps.
Reset the kit.
Observe the sample output in the terminal.
Testing with two devices
For full mDNS peer discovery and bidirectional communication testing, complete the following steps:
Note
Programming with --erase or --recover (or similar parameters) will erase the device settings area and restore the default settings.
Build and flash one device as FT:
west build -p -b nrf9151dk/nrf9151/ns -- -DEXTRA_CONF_FILE=ft.conf west flash --recover
Build and flash another device as PT:
west build -p -b nrf9151dk/nrf9151/ns -- -DEXTRA_CONF_FILE=pt.conf west flash --recover
The FT device performs the following operations:
Creates a DECT network.
Advertises mDNS hostname as
dect-nr+-ft-device.local.Listens for UDP messages on port 12345.
Attempts to resolve
dect-nr+-pt-device.localusing mDNS.Sends periodic messages to the PT device once resolved.
The PT device performs the following operations:
Join the DECT network created by FT
Advertise mDNS hostname as
dect-nr+-pt-device.localListen for UDP messages on port 12345
Attempt to resolve
dect-nr+-ft-device.localusing mDNSSend periodic messages to the FT device once resolved
Both devices log the received messages showing the sender address and content.
Press Button 1 to manually connect or Button 2 to disconnect either device.
Dependencies
This sample uses the following nRF Connect SDK libraries:
It uses the following sdk-zephyr libraries: