bluetty is a production-oriented bridge between Bluetooth SPP connections and PTY-backed Linux sessions on BlueZ.
BlueTTY is a modern implementation direction for RFCOMM serial workflows, with built-in session orchestration, PTY lifecycle management, and release automation for current Linux environments.
Legacy BlueZ RFCOMM-era tooling patterns are increasingly outdated for production operations:
rfcommstyle ad-hoc bindings are fragile in service-managed systems.sdptoolstyle manual SDP workflows are deprecated in modern BlueZ deployments.- Pairing and trust policy are better handled by native BlueZ tooling (
bluetoothctl) and policy stack integration.
BlueTTY focuses on stable PTY session delivery, while Bluetooth pairing/authorization is delegated back to the native BlueZ stack.
- BlueTTY registers an SPP profile on BlueZ over system D-Bus.
- BlueZ delivers RFCOMM file descriptors through
Profile1.NewConnection. - BlueTTY creates a PTY pair and runs
session.SubcommandTemplate. - BlueTTY forwards bytes bidirectionally between Bluetooth socket and PTY master.
- Stable 1.0 release line with amd64 and arm64 release assets.
- Tag-driven GitHub Release automation.
- Reworked CI/CD on GitHub Actions (PR checks, build, package, release).
- Release-ready documentation set for build, packaging, deployment, and troubleshooting.
- Registers SPP profile through BlueZ ProfileManager1.RegisterProfile.
- Accepts RFCOMM file descriptors from Profile1.NewConnection.
- Creates one PTY per connection and starts one session process per PTY.
- Forwards data bidirectionally between Bluetooth socket and PTY master.
- Supports per-device disconnect and concurrent sessions.
- Uses BlueZ profile registration options for authentication and authorization.
- Supports session modes none, getty, and exec with template-rendered subcommands.
cargo check --locked
cargo build --release --locked
RUST_LOG=info ./target/release/bluettyRecommended first-run flow:
- Start from
bluetty.conf.minimal. - Keep
bluez.RequireAuthenticationandbluez.RequireAuthorizationaligned with your BlueZ trust policy. - Choose
session.Mode:
gettyfor login shell on PTYexecfor managed custom programnonefor notify-only integration hook
- Validate with
journalctl -u bluetty.service -fwhile connecting from a known device.
Configuration lookup order:
- BLUETTY_CONFIG environment variable path
- ./bluetty.conf
- /etc/bluetty/bluetty.conf
- Built-in defaults
Example configs:
- bluetty.conf.example
- bluetty.conf.minimal
chmod +x scripts/build-artifacts.sh
scripts/build-artifacts.sh x86_64-unknown-linux-gnu
scripts/build-artifacts.sh aarch64-unknown-linux-gnu arm64
chmod +x scripts/package-artifacts.sh
scripts/package-artifacts.shStandard output names in dist:
- bluetty--linux-amd64
- bluetty--linux-amd64.deb
- bluetty--linux-amd64.rpm
- bluetty--linux-arm64
- bluetty--linux-arm64.deb
- bluetty--linux-arm64.rpm
Installed paths:
- Binary: /usr/local/bin/bluetty
- Config: /etc/bluetty/bluetty.conf
- Unit file: systemd/bluetty.service
Service management:
sudo systemctl daemon-reload
sudo systemctl enable --now bluetty.service
sudo journalctl -u bluetty.service -f- BlueZ and system D-Bus
- agetty and login binaries for getty mode
- aarch64-linux-gnu-gcc for local arm64 cross builds
- Pairing, trust, and authorization are enforced by BlueZ.
- Use
bluez.RequireAuthentication=trueand/orbluez.RequireAuthorization=truewhen deployment policy requires device-level control.
- Index: docs/INDEX.md
- Build: docs/BUILD.md
- CI/CD: docs/CI.md
- Release: docs/RELEASE.md
- Docker: docs/DOCKER.md
- Packaging: docs/PACKAGING.md
- Configuration reference: docs/CONFIGURATION.md
- Troubleshooting: docs/TROUBLESHOOTING.md
- src: application source code
- scripts: build and packaging scripts
- docs: operational and release docs
- packaging: nfpm manifest and lifecycle hooks
- systemd: systemd unit
- .github/workflows: CI/CD automation
This project is licensed under the MIT License. See LICENSE.