nus-client
BLE Nordic UART Service (NUS) client for interactive terminals and PTY bridging.
Connect to any BLE peripheral that exposes the standard Nordic UART Service and interact with it from your terminal — or expose the connection as a pseudo-terminal (PTY) device so third-party tools (minicom, screen, picocom, or any serial library) can talk to it like a local serial port.
Installation
pip install nus-client
From source
git clone https://github.com/will-tm/nus-client.git
cd nus-client
pip install -e ".[dev]"
Quick start
Scan for nearby BLE devices
nus-client --scan
Devices exposing NUS are marked with *.
Interactive terminal
# Auto-connect to the first NUS peripheral found
nus-client
# Connect by name
nus-client --name "My Device"
# Connect by Bluetooth address
nus-client --addr E8:C1:C7:11:22:33
# Filter by name prefix
nus-client --prefix "Sensor"
Each keystroke is sent as a BLE write; the remote device's responses print to stdout. Press Ctrl-] to disconnect.
PTY bridge
nus-client --pty
This creates a pseudo-terminal and prints its path (e.g. /dev/ttys005). Any tool that speaks serial can open that path:
# In another terminal
screen /dev/ttys005
# or
minicom -D /dev/ttys005
# or from Python
import serial
ser = serial.Serial("/dev/ttys005")
The PTY path is also printed to stdout (status messages go to stderr), so scripts can capture it:
PTY=$(nus-client --pty 2>/dev/null)
CLI reference
usage: nus-client [-h] [--version] [--name NAME] [--addr ADDR]
[--prefix PREFIX] [--scan] [--pty] [--timeout TIMEOUT]
options:
--name NAME match peripheral by exact advertised name
--addr ADDR match peripheral by Bluetooth address
--prefix PREFIX match peripherals whose name starts with PREFIX
--scan list visible peripherals and exit
--pty expose the connection as a PTY instead of interactive mode
--timeout TIMEOUT scan timeout in seconds (default: 12)
How it works
nus-client uses SimplePyBLE to communicate over Bluetooth Low Energy. The Nordic UART Service is a de-facto standard (UUID 6e400001-b5a3-f393-e0a9-e50e24dcca9e) implemented by Nordic nRF SDKs, Zephyr, and many custom firmware stacks.
- RX characteristic (
6e400002-...): host writes data here (sent to the peripheral) - TX characteristic (
6e400003-...): peripheral sends notifications here (received by the host)
In interactive mode, the terminal is set to raw mode and keystrokes are forwarded over BLE. In PTY mode, a pseudo-terminal pair is created — the master side is bridged to BLE, and the slave path is exposed for external tools.
Platform support
| Platform | Interactive | PTY |
|---|---|---|
| macOS | Yes | Yes |
| Linux | Yes | Yes |
| Windows | Yes | No |
PTY mode is not available on Windows because it relies on POSIX pseudo-terminals (openpty). Interactive mode works on Windows using msvcrt.
Development
pip install -e ".[dev]"
# Lint
ruff check src/ tests/
# Type check
mypy src/
# Test
pytest
License
MIT
Metadata
Release files for nus-client 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| nus_client-0.1.1.tar.gz | 8.2 kB | Without provenance | Details for nus_client-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| nus_client-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for nus_client-0.1.1-py3-none-any.whl |
Total release size: 17.6 kB
Release files / nus_client-0.1.1.tar.gz
| Download URL | nus_client-0.1.1.tar.gz |
|---|---|
| Size | 8.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0f1c71ad8a5b2544487ef911d387f8fc0c26952b3b514ce6a4177d1bfd2d1a35
|
|
BLAKE2b-256 checksum How to use checksums |
70d674b4646ca408b60a37210cbde910a08012190ca16f406ea0b1a1e67a883c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.4
|
Release files / nus_client-0.1.1-py3-none-any.whl
| Download URL | nus_client-0.1.1-py3-none-any.whl |
|---|---|
| Size | 9.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9f2b078a82400ada61fc30a9e2b6816125b0176b30c778454eff8719c9233ed3
|
|
BLAKE2b-256 checksum How to use checksums |
d423f5d01f990a0bd56163486f6a13be9b07452752745df05433f616c02bcd10
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.4
|
Security for nus-client 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.