Bluetooth: NUS shell transport¶
The Nordic UART Service (NUS) shell transport sample demonstrates how to use the Nordic UART Service (NUS) shell transport to receive shell commands from a remote device.
When the connection is established, you can connect to the sample through the Nordic UART Service (NUS) by using a host application. You can then send shell commands that are executed on the device that runs the sample, and see the logs. See Sending shell commands for more information about the host tools that are available in nRF Connect SDK for communicating with the sample.
One of the following development boards:
nRF5340 PDK board (PCA10095) - see Working with nRF5340
nRF52840 DK board (PCA10056)
nRF52 DK board (PCA10040)
A second nRF52 Development Kit board (PCA10040) for connecting with bt_nus_shell.py. Alternatively, you can use BLE Console for connecting (Linux only).
Building and running¶
This sample can be found under
samples/bluetooth/shell_bt_nus in the
nRF Connect SDK folder structure.
See Building and programming a sample application for information about how to build and program the application.
After programming the sample to your board, test it by connecting to it and sending some shell commands.
Perform the following steps to use the
Connect a Nordic Development Kit (for example, PCA10040) to your PC.
bt_nus_shell.pyscript with the correct parameters, for example:
bt_nus_shell.py --snr 680834186 --name BT_NUS_shell --com COM115 --family NRF52
Open a terminal, for example PuTTY. Set the Connection Type to
Rawand the Destination Address to
Press Enter in the terminal. A console prompt is displayed.
Enter the commands that you want to execute on the remote shell.
Alternatively, use the BLE Console for testing.
This sample uses the following nRF Connect SDK libraries:
In addition, it uses the following Zephyr libraries: