Simple app to simulate sensor sending data over BLE (Nordic UART Service).
- Windows: WinRT GATT peripheral (
ble/nus_winrt.py). - Linux: BlueZ via Bless (
ble/nus_bless.py). Bluetooth adapter must be available; you may need to run from an account that can use the system D-Bus (oftenbluetoothgroup membership on Linux). - macOS: Bless with Core Bluetooth (same code path as Linux).
- Python 3.10+
- Bluetooth enabled on the machine.
Create a virtual environment and install dependencies (markers pick WinRT vs Bless).
Linux / macOS — use python3, not py. The py command on many Linux distros is a different utility and does not support py -3 -m venv.
python3 -m venv .venv
source .venv/bin/activate
pip install --upgrade pip
pip install -r ble/requirements.txtWindows — either of:
python -m venv .venv
.venv\Scripts\activate
pip install --upgrade pip
pip install -r ble\requirements.txtOr, if the Python launcher for Windows (py.exe) is on your PATH:
py -3 -m venv .venv
.venv\Scripts\activate
pip install --upgrade pip
pip install -r ble\requirements.txtWith the venv activated, from the repository root:
python ble/main.pyOn Windows:
python ble\main.pyYou need a graphical session (tkinter). Allow Bluetooth access if the OS prompts you.