nRF91x1: DECT NR+ Shell

The DECT NR+ Shell (DeSh) sample application demonstrates how to set up a DECT NR+ application on top of the DECT NR+ networking stack and enables you to test various stack and modem features.

Requirements

The sample supports the following development kit and requires at least two kits:

Hardware platforms

PCA

Board name

Board target

nRF9151 DK

PCA10171

nrf9151dk

nrf9151dk/nrf9151/ns

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

DeSh enables testing of the DECT NR+ networking stack in the nRF Connect SDK with DECT NR+ modem firmware v2.x.

The subsections list the DeSh features, show shell command examples, and describe their usage.

The following abbreviations from the DECT NR+ MAC specification (ETSI TS 103 636-4) are used in the examples:

  • FT: Fixed Termination point

  • PT: Portable Termination point

  • BR: Border Router that connects the DECT NR network to the Internet

Main command structure:

at
  at_cmd_mode
auto_connect
  enable
  disable
  sett_read
cloud
  connect
  disconnect
  raw_data_tx (with CoAP)
dect
  activate
  deactivate
  sett
  rssi_scan
  status
  scan
  associate
  dissociate
  cluster_start
  cluster_info
  neighbor_list
  neighbor_info
  nw_beacon_start
  nw_beacon_stop
  nw_create
  nw_remove
  nw_join
  nw_unjoin
  connect
  disconnect
  rx
  tx
  discover (mdns-discover.conf)
hostname
  read
  write
ping
print
  timestamps
  cloud (with MQTT)
version

Quick start tutorial

Step 1: Basic Two-Device Setup

Device 1 (FT - Network Creator):

dect sett --dev_type FT
dect activate
dect connect
# Wait for "Network status: created" message

Device 2 (PT - Network Joiner):

dect sett --dev_type PT
dect activate
dect connect
# Wait for "Network status: joined" message

Step 2: Verify Connection

Both devices:

dect status                          # Shows associations with addressing information
ping -d <neighbor_ipv6_address>      # Test connectivity

Write and read hostname

DeSh command hostname.

To set and read the hostname of the DECT NR+ device, use the following commands:

desh:~$ hostname write dect-ft-device
desh:~$ hostname read

Discover DECT NR+ peers (mDNS)

DeSh command dect discover.

Lists peers that advertise the DNS-SD service _dect-nr._udp on the DECT NR+ network. Requires mdns-discover.conf in the west build command (see mDNS discover).

  • Usage example:

    desh:~$ dect discover
    
    dect discover: browse _dect-nr._udp (PTR), then AAAA for IPv6 addresses
      this device: dect-nr+-device.local
      local _dect-nr._udp advertise: advertising
      (Browse may take up to ~8 s.)
      browse _dect-nr._udp.local (1/2)
      Browse done, 1 peer(s) — AAAA for IPv6 addresses
      IPv6 addresses (1 peer(s)):
     # | host                     | kind | ipv6 (mDNS)                             | long_rd_id
     ----------------------------------------------------------------------------------------------------
     1 | pt-device.local          | LL   | fe80::e64c:7945:1c99:a829               | 479832105 (0x1c99a829)
     1 | pt-device.local          | GUA  | 2001:14bb:ac:3e22:aca7:d08a:ecd9:2e32   | 3973656114 (0xecd92e32)
     1 | pt-device.local          | ULA  | fdde:ad00::aca7:d08a:ecd9:2e32          | 3973656114 (0xecd92e32)
    
    dect discover: finished (1 peer(s))
    

Application settings

DeSh command dect sett.

You can store some of the main DeSh command parameters into settings that are persistent between sessions. The settings are stored in the persistent storage and loaded when the application starts.

Examples

  • See the usage and read the current settings:

    desh:~$ dect sett -h
    desh:~$ dect sett -r
    
  • Reset the settings to their default values:

    desh:~$ dect sett --reset
    
  • Change the default TX power for the cluster beacon:

    desh:~$ dect sett --cluster_max_beacon_tx_pwr 4
    
  • Change the default band to 2:

    desh:~$ dect sett -b 2
    

Activate DECT NR+ stack

DeSh command dect activate.

  • Activate DECT NR+ stack:

    desh:~$ dect activate
    

RSSI measurement

DeSh command dect rssi_scan.

Execute RSSI measurement/scan.

  • Execute shorter (100 frames on each channel) RSSI measurements on all channels on band #1:

    desh:~$ dect rssi_scan -b 1 --frames 100
    

FT: Start a cluster manually

DeSh command dect cluster_start.

The dect cluster_start command starts a DECT NR+ cluster based on settings. The command is available only for FT devices.

Examples

  • Set device as an FT device and set the transmission ID:

    desh:~$ dect sett --dev_type FT -t 1
    
  • Activate DECT NR+ stack (if not already activated by auto_activate setting):

    desh:~$ dect activate
    
  • Start a DECT NR+ cluster as set in settings:

    desh:~$ dect cluster_start
    Cluster start initiated.
    NET_EVENT_DECT_RSSI_SCAN_RESULT
    RSSI scan result:
    Channel:                             1657
    All subslots free:                   yes
    Busy percentage:                     0%
    NET_EVENT_DECT_RSSI_SCAN_DONE: scan done
    NET_EVENT_DECT_CLUSTER_CREATED_RESULT
    Cluster started/reconfigured at channel 1657.
    

FT: Start advertising the created cluster by starting a periodic network beacon

DeSh command dect nw_beacon_start.

The dect nw_beacon_start command starts sending of a DECT NR+ network beacon. The command is available only for FT devices.

  • Start a DECT NR+ network beacon at channel 1659 with additional channels:

    desh:~$ dect nw_beacon_start -c 1659 --add_channels 1661,1663,1665
    ..
    NW beacon started.
    

FT: Creating a DECT NR+ network

DeSh command dect nw_create.

The dect nw_create command creates a DECT NR+ network in a set band. This higher level command combines the rssi_scan and cluster_start commands and creates a DECT NR+ network. Optionally, it also starts a network beacon on a set channel (preset in settings using dect sett --nw_beacon_channel <channel>), which means it includes functionalities of dect nw_beacon_start. The command is available only for FT devices.

  • Create a DECT NR+ network in a set band (FT device is activated but no cluster running):

    desh:~$ dect sett --nw_beacon_channel 1659
    Settings updated.
    desh:~$ dect nw_create
    Network creation initiated.
    NET_EVENT_DECT_RSSI_SCAN_RESULT
    RSSI scan result:
    Channel:                             1657
    All subslots free:                   yes
    Busy percentage:                     0%
    NET_EVENT_DECT_RSSI_SCAN_DONE: scan done
    NET_EVENT_DECT_CLUSTER_CREATED_RESULT
    Cluster started/reconfigured at channel 1657.
    NET_EVENT_DECT_NW_BEACON_START_RESULT
    NW beacon started.
    FT: network created
    NET_EVENT_DECT_NETWORK_STATUS:
    Network status: created
    

PT: Manually scan for a DECT NR+ cluster

DeSh command dect scan.

The dect scan command scans for DECT NR+ clusters and network beacons.

  • Start a DECT NR+ scan on band #1 (PT device is activated but not associated with any cluster):

    desh:~$ dect scan -b 1
    Scan initiated.
    NET_EVENT_DECT_SCAN_RESULT
    Scan result:
     Beacon type:             Cluster
     Reception channel:       1657
     Long RD ID:              1 (0x00000001)
     NW ID:                   2271560481 (0x87654321)
     RX RSSI-2:               -32dBm
     RX SNR:                  26dB
     RX MCS index:            4
     RX Transmit power:       10 (10 dBm)
    NET_EVENT_DECT_SCAN_RESULT
    ...
    NET_EVENT_DECT_SCAN_RESULT
     Scan result:
     Beacon type:             NW
     Reception channel:       1659
     Long RD ID:              1 (0x00000001)
     NW ID:                   2271560481 (0x87654321)
     RX RSSI-2:               -31dBm
     RX SNR:                  26dB
     RX MCS index:            4
     RX Transmit power:       10 (10 dBm)
     Current cluster channel: not available
     Next cluster channel:    1657
     NET_EVENT_DECT_SCAN_RESULT
     Scan result:
     Beacon type:             NW
     Reception channel:       1659
     Long RD ID:              1 (0x00000001)
     NW ID:                   2271560481 (0x87654321)
     RX RSSI-2:               -31dBm
     RX SNR:                  26dB
     RX MCS index:            4
     RX Transmit power:       10 (10 dBm)
     Current cluster channel: not available
     Next cluster channel:    1657
    NET_EVENT_DECT_SCAN_DONE
    Scan request done
    

PT: Associate with an FT device

DeSh command dect associate.

The dect associate command associates a PT device with an FT device.

  • Associate with a scanned FT device:

    desh:~$ dect associate -t 1
    NET_EVENT_DECT_ASSOCIATION_CHANGED
     DECT_ASSOCIATION_CREATED:
      Association created with long RD ID:                 1
      Neighbor role:                                       Parent
    PT: Joined a network
    NET_EVENT_DECT_NETWORK_STATUS:
     Network status: joined
    
  • See the DECT NR+ status:

    desh:~$ dect status
    DECT NR+ status:
     Modem FW version:             mfw-nr+_nrf91x1_2.0.0
     Modem activated:              yes
     Cluster running:              no
     Network beacon running:       no
     Associations:
        Parent long RD ID:              1 (0x00000001)
           Local IPv6 address:           fe80::1:0:1
    
  • See the networking status of the DECT NR+ interface:

    desh:~$ net iface
    

PT: Joining a DECT NR+ network

DeSh command dect nw_join.

This higher level command combines the scan and associate commands and joins the found network in a set band.

  • Join a DECT NR+ network (PT device is activated but not associated with any network):

    desh:~$ dect nw_join
    ...
    NET_EVENT_DECT_NETWORK_STATUS:
    Network status: joined
    

PT: ICMPv6 ping an FT device

DeSh command ping.

The ping command sends ICMPv6 (IPv6 only) echo requests over the DECT interface using Zephyr’s net_icmp API (the same low-level mechanism as the built-in net ping command). DeSh ping adds the following features beyond net ping:

  • Hostname resolution (including mDNS names, such as dect-ft-device.local)

  • Configurable count, interval, timeout, and payload length

  • Per-reply RTT and payload reporting

  • End-of-run loss and min/max/average statistics

  • Default binding to the DECT NR+ interface

  • Abort over the DeSh kill signal

  • PT device: Using global IPv6 address of the FT device (the global address is only available if the FT device is connected to the Internet):

    desh:~$ ping -d 2001:14bb:119:35b5:0:1:0:1
    Initiating ping to: 2001:14bb:119:35b5:0:1:0:1
    Source IP addr: 2001:14bb:119:35b5:0:1:0:29a
    Destination IP addr: 2001:14bb:119:35b5:0:1:0:1
    Pinging 2001:14bb:119:35b5:0:1:0:1 results: time=1.218secs, payload sent: 0, payload received 0
    ...
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss)
    Approximate round trip times in milli-seconds:
      Minimum = 992ms, Maximum = 1218ms, Average = 1048ms
    Pinging DONE
    
  • PT device: Using local ipv6 address by first using mDNS to query the address by name:

    desh:~$ net dns dect-ft-device.local AAAA
    Query for 'dect-ft-device.local' sent.
    dns: fe80::1:0:1
    dns: All results received
    
    desh:~$ ping -d fe80::1:0:1
    
  • PT device: Using a hostname of the FT device directly:

    desh:~$ ping -d dect-ft-device.local
    Initiating ping to: dect-ft-device.local
    Source IP addr: fe80::1:0:29a
    Destination IP addr: fe80::1:0:1
    Pinging dect-ft-device.local results: time=1.995secs, payload sent: 0, payload received 0
    ...
    Ping statistics for dect-ft-device.local:
       Packets: Sent = 4, Received = 4, Lost = 0 (0% loss)
    Approximate round trip times in milli-seconds:
       Minimum = 991ms, Maximum = 1995ms, Average = 1242ms
    Pinging DONE
    
  • PT device: The built-in Zephyr net ping command is also available for a minimal ping to a literal IPv6 address (no hostname resolution or DeSh statistics/abort):

    desh:~$ net ping fe80::1:0:1
    

FT: Start RX for receiving raw data

  • Start RX:

    desh:~$ dect rx start
    

PT: Send raw data to FT device

  • Send data to a FT device:

    desh:~$ dect tx -t 1 -d "Hello FT device"
    

FT: Observe that data is received

  • Observe received data:

    desh:~$
    Received data (len 16, src long RD ID 4257231875):
      Hello FT device
    

PT: Release association

DeSh command dect dissociate.

The dect dissociate command releases the association between a PT device and an FT device. You can also use the dect nw_unjoin command to release the association and leave the DECT NR+ network. This does not need the long RD ID of the FT device to be added as a parameter.

  • Release the association with an FT device:

    desh:~$ dect dissociate -t 1
    

Using DECT NR+ Connection Manager

DeSh command dect connect.

The dect connect command connects a DECT NR+ device to the DECT NR+ network. This higher level command uses the DECT NR+ Connection Manager. Depending on the configured device type, it can connect to a DECT NR+ cluster (PT device) or create a DECT NR+ network (FT device).

  • FT device with Internet connection:

    desh:~$ dect sett -t 1 --dev_type FT
    desh:~$ dect connect
    connect initiated.
    NET_EVENT_DECT_RSSI_SCAN_RESULT
     RSSI scan result:
     Channel:                             1657
     All subslots free:                   yes
     Busy percentage:                     0%
    NET_EVENT_DECT_RSSI_SCAN_DONE: scan done
    NET_EVENT_DECT_CLUSTER_CREATED_RESULT
     Cluster started/reconfigured at channel 1657.
    NET_EVENT_DECT_NW_BEACON_START_RESULT
     NW beacon started.
    FT: network created
    NET_EVENT_DECT_NETWORK_STATUS:
    Network status: created
    
  • PT device:

    desh:~$ dect sett -t 2 --dev_type PT
    desh:~$ dect connect
    NET_EVENT_DECT_ASSOCIATION_REQ_RESULT
    Association created with a parent with long RD ID 1
    PT: Joined a network
    NET_EVENT_DECT_NETWORK_STATUS:
    Network status: joined
    NET_EVENT_L4_CONNECTED: Network connectivity established and global IPv6 address assigned, iface 0x20010840
    NET_EVENT_L4_IPV6_CONNECTED: IPv6 connectivity established, iface 0x20010840
    

    Note

    This example output shows that the device is getting an Internet connection over the DECT NR+ network.

MQTT: Remote control using nRF Cloud

Once you have established an MQTT connection to nRF Cloud using the cloud command, you can use the Terminal window in the nRF Cloud portal to execute DeSh commands to the device. This feature enables remote control of the DeSh application running on a device that is connected to cloud. DeSh output, such as responses to commands and other notifications can be echoed to the messages endpoint and the Terminal window of the nRF Cloud portal. Use the print cloud enable command to enable this behavior. The data format of the input data in the Terminal window must be JSON.

Examples

  • PT device: Enabling printing also to cloud and establish the connection to nRF Cloud:

    desh:~$ print cloud enable
    
    desh:~$ cloud connect
    
  • nRF Cloud: To request the DECT NR+ neighbor list for the PT device, enter the following command in the Terminal window of the nRF Cloud portal:

    {"appId":"DECT_SHELL", "data":"dect neighbor_list"}
    

    The response appears in the d2c terminal.

  • nRF Cloud: To request icmpv6 ping towards Internet from a PT device, enter the following command in the Terminal window of the nRF Cloud portal:

    {"appId":"DECT_SHELL", "data":"ping -d nordicsemi.com"}
    

    The response appears in the d2c terminal.

Iperf3

DeSh command iperf.

The iperf3 command starts the iperf3 tool that is used for measuring data transfer performance both in uplink and downlink direction.

Note

Run the iperf3 server on the FT device and the iperf3 client on the PT device (direct connection between the devices). Some features, for example, file operations and TCP option tuning, are not supported.

Examples

  • FT device: Create a network and see local IPv6 address for the DECT NR+ networking interface:

    desh:~$ dect sett -t 1 --dev_type FT
    
    desh:~$ dect connect
    ...
    NET_EVENT_DECT_CLUSTER_CREATED_RESULT
    Cluster started/reconfigured at channel 1659.
    FT: network created
    NET_EVENT_DECT_NETWORK_STATUS:
    Network status: created
    ...
    NET_EVENT_DECT_ASSOCIATION_CHANGED
    DECT_ASSOCIATION_CREATED:
     Association created with long RD ID:                 3872119375
     Neighbor role:                                       Child
    ...
    desh:~$ net iface 1
    Hostname: dect-ft-device
    Default interface: 1
    
    Interface dect0 (0x20017070) (<unknown type>) [1]
    =========================================
    Interface is down.
    Link addr : 00:00:00:01:00:00:00:01
    MTU       : 1280
    Flags     : AUTO_START,IPv6,NO_ND
    Device    : dect0 (0x57b2c)
    Status    : oper=DORMANT, admin=UP, carrier=ON
    IPv6 unicast addresses (max 2):
          fe80::1:0:1 autoconf preferred infinite
    IPv6 multicast addresses (max 3):
          ff02::fb  <not joined>
    IPv6 prefixes (max 2):
          <none>
    IPv6 hop limit           : 64
    IPv6 base reachable time : 30000
    IPv6 reachable time      : 23839
    IPv6 retransmit timer    : 0
    
  • FT device: Start iperf3 server on the DECT NR+ networking interface on port 5555:

    desh:~$ iperf3 -s -B fe80::1:0:1 -p 5555 -1 -V -6
    
  • PT device: Connect iperf3 client to the FT device iperf3 server on port 5555, using UDP protocol, with a payload size of 1220 bytes, for 50 seconds, and with a bandwidth of 2 Mbps:

    desh:~$ iperf3 -c fe80::1:0:1 -p 5555 -V -6 -u -l 1220 -t 50 -O 6 -b 1500k
    

User interface

The buttons have the following functions:

Button 1:

Raises a kill or abort signal. A long press of the button kills or aborts all supported running commands. You can abort commands iperf3 and ping.

Configuration

See Configuring and building for information about how to permanently or temporarily change the configuration.

Configuration options

Check and configure the following Kconfig options:

CONFIG_SAMPLE_DESH_PRINT_BUFFER_SIZE

(int) Buffer size used when printing shell output

If the printed string exceeds this buffer, an error message is printed first, and then the requested string is cut into the length of this buffer.

CONFIG_SAMPLE_DESH_COMMON_WORKQ_STACK_SIZE

(int) Common workqueue stack size

CONFIG_SAMPLE_DESH_DECT_ICMP_PING

(bool) ICMP ping support

ICMPv6 ping through the Zephyr net_icmp API. DeSh ping extends net ping with hostname resolution, configurable count/interval/timeout/payload, per-reply and summary RTT statistics, default DECT interface binding, and abort through the DeSh kill signal.

CONFIG_SAMPLE_DESH_IPERF3

(bool) iPerf3

CONFIG_SAMPLE_DESH_CLOUD_MQTT

(bool) MQTT connection to nRF Cloud

MQTT connection to nRF Cloud.

CONFIG_SAMPLE_DESH_CLOUD_COAP

(bool) CoAP connection to nRF Cloud

CoAP connection to nRF Cloud.

CONFIG_SAMPLE_DESH_MDNS_DNS_SD_ADVERTISE

(bool) Advertise _dect-nr._udp using DNS-SD on dect0

Register a DNS-SD service record for _dect-nr._udp so that peers browsing through mDNS see this device. Zephyr’s mdns_responder answers PTR/SRV/TXT/AAAA queries using the record; this sample does not run an application-level service on the advertised SRV port, and the TXT record carries “status=not-implemented” to signal that.

CONFIG_SAMPLE_DESH_MDNS_DNS_SD_PORT

(int) DNS-SD service port on dect0

UDP port placed in the SRV record advertised for _dect-nr._udp. Reserved for a future application service (info/telemetry/CoAP/…); the sample binds a placeholder UDP socket on this port so DNS-SD SRV records are advertised, but no application-level service is implemented.

CONFIG_SAMPLE_DESH_MDNS_DISCOVER

(bool) dect discover shell command

Discover nearby DECT NR+ devices through mDNS: browses _dect-nr._udp (PTR) to find peer instances and resolves their .local hostnames (AAAA) to list IPv6 addresses.

CONFIG_SAMPLE_DESH_L2_SHELL

(bool) DECT NR+ Shell for nRF91 Modem MAC

Enable support for DECT NR+ Net Management interface. This selects the DECT MAC L2 shell library.

CONFIG_SAMPLE_DESH_AUTO_CONNECT

(bool) Auto-connect command

Build the “auto_connect” shell command and its event-driven worker that joins (PT) or creates (FT) the DECT NR+ network automatically once the configured trigger conditions are met. The runtime state is persisted through the Zephyr settings subsystem. Auto-connect is disabled at runtime by default; enable it using the shell or SAMPLE_DESH_AUTO_CONNECT_DEFAULT_ENABLED.

Disable to drop both auto_connect.c and auto_connect_shell.c from the build when the sample only needs manual network bring-up.

CONFIG_SAMPLE_DESH_AUTO_CONNECT_DEFAULT_ENABLED

(bool) Enable auto-connect by default

Initial value of the auto-connect setting at first boot, used until the user overrides it using the “auto_connect enable|disable” shell commands. The override is persisted through the Zephyr settings subsystem and wins over this default on subsequent boots.

When enabled, the sample joins (PT) or creates (FT) the DECT NR+ network automatically once the trigger conditions are met (see SAMPLE_DESH_AUTO_CONNECT_DEFAULT_DELAY_SECS).

CONFIG_SAMPLE_DESH_AUTO_CONNECT_DEFAULT_DELAY_SECS

(int) Auto-connect delay (seconds)

Initial auto-connect delay used at first boot, until the user overrides it using “auto_connect delay <seconds>”. The override is persisted through the Zephyr settings subsystem and wins over this default on subsequent boots.

0 selects the default trigger: when CONFIG_NET_CONNECTION_MANAGER is enabled, auto_connect waits for both NET_EVENT_DECT_ACTIVATE_DONE and NET_EVENT_L4_CONNECTED before firing; otherwise it fires as soon as NET_EVENT_DECT_ACTIVATE_DONE arrives.

A non-zero value overrides the default trigger and schedules the auto-connect work that many seconds after NET_EVENT_DECT_ACTIVATE_DONE, independent of L4 connectivity.

CONFIG_SAMPLE_DESH_NATIVE_TLS

(bool) Custom AT%CMNG command to store credentials for native TLS

Enable the custom AT%CMNG command to store TLS credentials for native TLS usage. When enabled, you can use the AT%CMNG command to store TLS credentials (CA certificate, client certificate, private key) in the secure storage or in settings with MQTT/TLS, from where native TLS (Mbed TLS) can load them when establishing a TLS connection.

CONFIG_SAMPLE_DESH_NATIVE_TLS_CREDENTIAL_BUFFER_SIZE

(int) Buffer space reserved for loading credentials

Buffer space available for a single sec_tag when loading credentials for Mbed TLS.

CONFIG_SAMPLE_DESH_NATIVE_TLS_CREDENTIAL_BUFFER_COUNT

(int) Number of buffers for loading credentials

Number of buffers available for loading sec_tag credentials for Mbed TLS. The TLS client needs the buffer only when connecting, whereas the TLS server needs the buffer as long as it is running. Increase the value if you need TLS client and server running simultaneously with different sec_tags.

Building

This sample can be found under samples/dect/dect_shell 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.

See Providing CMake options for instructions on how to provide CMake options, for example to use a configuration overlay.

FT/Sink: Border Router

This section describes how to build the DeSh sample for Internet access through a Border Router (BR) sink:

  • LTE - Cellular backhaul using Serial Modem on an external nRF9151 DK (FT/Sink build with FILE_SUFFIX=sm).

  • Ethernet - Wired backhaul using a Zephyr W5500 shield on the same nRF9151 DK that runs the DECT NR+ sink (ARCELI W5500 ETH or Seeed W5500 Ethernet Shield (seeed studio v1.1)).

Both paths enable CONFIG_NET_L2_DECT_BR style border router behavior. Choose one backhaul for each build (see notes under each variant).

LTE with Serial Modem running on external nRF9151 DK

  • Serial Modem :

    Note

    Change the current speed of uart2 to 1000000 (in the overlay-external-mcu.overlay file) to reflect the DECT side speed where current speed of uart1 is 1000000.

    west build -p -b nrf9151dk/nrf9151/ns -- -DEXTRA_CONF_FILE="overlay-ppp.conf;overlay-cmux.conf" -DEXTRA_DTC_OVERLAY_FILE=overlay-external-mcu.overlay -Dapp_SNIPPET=nrf91-modem-trace-uart
    
  • DeSh with FT/Sink configuration using Zephyr’s cellular modem feature:

    nrf/samples/dect/dect_shell:
    west build -p -b nrf9151dk/nrf9151/ns -- -DFILE_SUFFIX=sm
    
  • Wiring as in the DeSh board overlay and Serial Modem ncs-serial-modem/app/overlay-external-mcu.overlay files:

    Wire the DKs together as shown.

    Serial Modem

    DECT NR+ Sink

    nRF9151 DK

    nRF9151 DK

    P0.10 (TX)

    P0.10 (RX)

    P0.11 (RX)

    P0.11 (TX)

    P0.12 (RTS)

    P0.12 (CTS)

    P0.13 (CTS)

    P0.13 (RTS)

    P0.30 (RI)

    P0.30 (RING)

    P0.31 (DTR)

    P0.31 (DTR)

    GND

    GND

Note

Change VDD (nPM VOUT1) from 1.8V to 3.3V using the Board Configurator app in both DKs.

Modem shared memory (eth-rx.overlay)

Ethernet sink builds forward the DECT uplink (PT TX → FT RX) to eth0 and need a larger shared-memory RX region in the modem than the default partition. The eth_common.conf file sets CONFIG_NRF_MODEM_LIB_SHMEM_TX_SIZE and CONFIG_NRF_MODEM_LIB_SHMEM_RX_SIZE Kconfig option values. Keep these Kconfig values aligned with the region sizes defined in the eth-rx.overlay file.

Pass -DEXTRA_DTC_OVERLAY_FILE="eth-rx.overlay;<shield-mac.overlay>" on every Ethernet build (semicolon-separated list; eth-rx.overlay first). Use EXTRA_DTC_OVERLAY_FILE instead of DTC_OVERLAY_FILE. Setting DTC_OVERLAY_FILE replaces the auto-applied boards/nrf9151dk_nrf9151_ns.overlay file, on top of which both overlays layer.

Ethernet with W5500 shield (Arceli)

Use this when the DECT sink (FT with BR) needs to reach the Internet over Ethernet. The sample adds the following configuration files:

  • eth_common.conf

  • eth_w5500.conf

  • eth-rx.overlay (modem shared memory)

  • default w5500-static-mac.overlay for Arceli tuning (fixed locally administered Ethernet MAC)

  • w5500.overlay for zephyr,random-mac-address (new MAC each boot)

For mDNS advertisement (PT discovers the sink), append the mdns-common.conf and mdns-discover.conf files. To also run dect discover on the sink, add eth_sink_mdns-discover.conf after mdns-discover.conf. The pinout and SPI node come from the Zephyr shield devicetree in zephyr/boards/shields/arceli_eth_w5500/arceli_eth_w5500.overlay.

Note

Arduino D8 (reset) and D9 (interrupt) are shared with BUTTON1 and BUTTON2 on the nRF9151 DK. Thus, the DK library is disabled in the Ethernet overlays files to avoid conflicts with the Arceli shield.

  • Build the DeSh sample as DECT BR sink over Ethernet (from the nRF Connect SDK workspace, without mDNS by default) using the following command:

    nrf/samples/dect/dect_shell:
    west build -p -b nrf9151dk/nrf9151/ns -- -DSHIELD=arceli_eth_w5500 -DEXTRA_CONF_FILE="eth_common.conf;eth_w5500.conf" -DEXTRA_DTC_OVERLAY_FILE="eth-rx.overlay;w5500-static-mac.overlay"
    
  • With mDNS advertisement (PT discovers the sink):

    west build -p -b nrf9151dk/nrf9151/ns -- -DSHIELD=arceli_eth_w5500 -DEXTRA_CONF_FILE="eth_common.conf;eth_w5500.conf;mdns-common.conf;mdns-discover.conf" -DEXTRA_DTC_OVERLAY_FILE="eth-rx.overlay;w5500-static-mac.overlay"
    

    Edit local-mac-address in the w5500-static-mac.overlay file so that each board on the same LAN has a unique MAC.

  • For each random Ethernet MAC boot (zephyr,random-mac-address), use the w5500.overlay file instead:

    west build -p -b nrf9151dk/nrf9151/ns -- -DSHIELD=arceli_eth_w5500 -DEXTRA_CONF_FILE="eth_common.conf;eth_w5500.conf" -DEXTRA_DTC_OVERLAY_FILE="eth-rx.overlay;w5500.overlay"
    
  • With mDNS advertisement:

    west build -p -b nrf9151dk/nrf9151/ns -- -DSHIELD=arceli_eth_w5500 -DEXTRA_CONF_FILE="eth_common.conf;eth_w5500.conf;mdns-common.conf;mdns-discover.conf" -DEXTRA_DTC_OVERLAY_FILE="eth-rx.overlay;w5500.overlay"
    
  • To also obtain an IPv6 address through DHCPv6 (in addition to SLAAC), append the eth_dhcpv6_client.conf file to the configuration file list. The DHCPv6 client starts automatically when the Ethernet interface comes up, but only if SLAAC has not already provided a prefix:

    west build -p -b nrf9151dk/nrf9151/ns -- -DSHIELD=arceli_eth_w5500 -DEXTRA_CONF_FILE="eth_common.conf;eth_w5500.conf;eth_dhcpv6_client.conf" -DEXTRA_DTC_OVERLAY_FILE="eth-rx.overlay;w5500-static-mac.overlay"
    
  • Wiring as in the Arceli ETH W5500 shield overlay. Connect the RJ45 port to your LAN (router or switch).

    nRF9151 DK + Arceli ETH W5500 (Arduino header).

    W5500/shield signal

    nRF9151 DK (Arduino/GPIO)

    SCS

    D10 (P0.10)

    MOSI

    D11 (P0.11)

    MISO

    D12 (P0.12)

    SCK/CLK

    D13 (P0.13)

    INT

    D9 (P0.09)

    RESET

    D8 (P0.08)

    3.3V

    Arduino 3.3V or DK VDD (3.3 V)

    GND

    GND

Ethernet with W5500 shield (Seeed Studio board)

Use this when the DECT NR+ sink (FT with BR) needs to reach the Internet over Ethernet over the Zephyr Seeed W5500 Ethernet Shield (seed studio v1.1 shield was used) on the nRF9151 DK.

Merge the eth_common.conf, eth_w5500.conf and eth_w5500_seeed.conf files for Ethernet sink without mDNS (plus eth-rx.overlay for modem shared memory). For mDNS advertisement (PT discovers the sink), append the mdns-common.conf and mdns-discover.conf files.

To also run dect discover on the sink, add eth_sink_mdns-discover.conf after mdns-discover.conf.

The Seeed shield (Rev 1.01) leaves the W5500 INTn disconnected, so the w5500-seeed*.overlay files remove int-gpios for devicetree polling mode and eth_w5500_seeed.conf sets a faster speed (CONFIG_ETH_W5500_POLL_PERIOD).

Devicetree comes from the zephyr/boards/shields/seeed_w5500/seeed_w5500.overlay file plus a sample overlay. The default file is w5500-seeed-static-mac.overlay (fixed locally administered Ethernet MAC), or w5500-seeed.overlay for zephyr,random-mac-address (new MAC each boot).

Note

The sample w5500.overlay file is Arceli-specific (targets &eth_w5500_arceli_eth_w5500). For seeed_w5500, use w5500-seeed-static-mac.overlay or w5500-seeed.overlay (targets &eth_w5500).

  • From the sample directory (default without mDNS):

    cd nrf/samples/dect/dect_shell
    west build -p -b nrf9151dk/nrf9151/ns -- -DSHIELD=seeed_w5500 -DEXTRA_CONF_FILE="eth_common.conf;eth_w5500.conf;eth_w5500_seeed.conf" -DEXTRA_DTC_OVERLAY_FILE="eth-rx.overlay;w5500-seeed-static-mac.overlay"
    
  • With mDNS advertisement (PT discovers the sink):

    west build -p -b nrf9151dk/nrf9151/ns -- -DSHIELD=seeed_w5500 -DEXTRA_CONF_FILE="eth_common.conf;eth_w5500.conf;eth_w5500_seeed.conf;mdns-common.conf;mdns-discover.conf" -DEXTRA_DTC_OVERLAY_FILE="eth-rx.overlay;w5500-seeed-static-mac.overlay"
    
  • Edit local-mac-address in w5500-seeed-static-mac.overlay so each board on the same LAN has a unique MAC.

  • For a random Ethernet MAC each boot, use w5500-seeed.overlay instead:

    west build -p -b nrf9151dk/nrf9151/ns -- -DSHIELD=seeed_w5500 -DEXTRA_CONF_FILE="eth_common.conf;eth_w5500.conf;eth_w5500_seeed.conf" -DEXTRA_DTC_OVERLAY_FILE="eth-rx.overlay;w5500-seeed.overlay"
    
  • With mDNS advertisement:

west build -p -b nrf9151dk/nrf9151/ns -- -DSHIELD=seeed_w5500 -DEXTRA_CONF_FILE="eth_common.conf;eth_w5500.conf;eth_w5500_seeed.conf;mdns-common.conf;mdns-discover.conf" -DEXTRA_DTC_OVERLAY_FILE="eth-rx.overlay;w5500-seeed.overlay"

mDNS discover

To build the DeSh sample with DNS-SD advertisement and the dect discover command:

$ west build -p -b nrf9151dk/nrf9151/ns -- -DEXTRA_CONF_FILE="mdns-common.conf;mdns-discover.conf"

On an Ethernet sink that itself needs to run dect discover (as opposed to just being discovered by a PT), also merge eth_sink_mdns-discover.conf after mdns-discover.conf (see the Ethernet W5500 sections for full examples).

iperf3 support

To build the DeSh sample with iperf3 support, for example:

PT (or FT without the sink) device: DeSh with Zephyr’s network management-based shell commands:

nrf9151dk:

$ west build -p -b nrf9151dk/nrf9151/ns

With iperf3 support with TX optimized (usually acts as iperf3 client in PT device):

$ west build -p -b nrf9151dk/nrf9151/ns -- -DEXTRA_CONF_FILE="iperf3-common.conf;iperf3-tx.conf" -DEXTRA_DTC_OVERLAY_FILE="iperf3-tx.overlay"

With iperf3 support with RX optimized (usually acts as iperf3 server in FT device):

$ west build -p -b nrf9151dk/nrf9151/ns -- -DEXTRA_CONF_FILE="iperf3-common.conf;iperf3-rx.conf" -DEXTRA_DTC_OVERLAY_FILE="iperf3-rx.overlay"

nRF Cloud

nRF Cloud offers location services and allows devices to report data to the cloud for collection and analysis. This section describes how to build the DeSh sample with nRF Cloud support using MQTT and CoAP protocols.

Certificates

You can store certificates on the device using a custom AT%CMNG command (implemented by DeSh custom AT command) in the following two ways:

  • Directly with the AT command (desh:~$ at at%cmng=******) or the at_cmd_mode command (desh:~$ at_cmd_mode start), or by a script.

  • Using the Cellular Monitor app to store the certificates to the modem (default nRF Cloud security tag).

    desh:~$ dect deactivate
    desh:~$ at at_cmd_mode start
    

Note

As a result of the custom %CMNG command in DeSh, the MQTT credentials are stored insecurely in settings, but with CoAP, they are stored more securely in the Protected Storage.

MQTT

nrf9151dk:

$ west build -p -b nrf9151dk/nrf9151/ns -- -DEXTRA_CONF_FILE="nrf_cloud_mqtt.conf"

CoAP

nrf9151dk:

$ west build -p -b nrf9151dk/nrf9151/ns -- -DEXTRA_CONF_FILE="nrf_cloud_coap.conf" -DDTC_OVERLAY_FILE="nrf_cloud_coap.overlay"

Note

System time is retrieved by using NTP. For the CA certificate, only the nRF Cloud CoAP CA certificate needs to be stored on the device with CoAP. Do not store the Amazon root CA certificate on the device with CoAP due to crypto limitations for handling RSA certificates. For border router over Ethernet instead, use the Ethernet with W5500 shield build (see FT/Sink: Border Router, do not mix with FILE_SUFFIX=sm).

Dependencies

This sample uses the following nRF Connect SDK libraries:

In addition, it uses the following secure firmware component: