Skip to main content

Bridges MQTT topics to a pseudo-terminal device

Project description

mqtty

mqtty bridges MQTT topics to either your local terminal or a pseudoterminal (PTY), and now also ships log capture and replay helpers for the same serial stream format.

This is useful for debugging, automation, or tunneling serial communication through a networked MQTT broker.

Commands

mqtty mqtt://<host>/<topic> [--pts-only]

mqtty runs in bidirectional terminal mode by default:

  • bytes from stdin are published to .../device_serial_input
  • bytes from .../device_serial_output are written to stdout
  • if stdin is a TTY, it is placed into raw mode while mqtty is running
  • type Ctrl-A Ctrl-X to exit, matching picocom's default exit sequence
  • type Ctrl-A Ctrl-A to send a literal Ctrl-A

Use --pts-only if you only want a PTY device:

  • --pts-only, -p: Print the path to the PTS device and keep it open without attaching local stdin/stdout. Useful for tools or scripts that want to use the virtual serial port.

mqtty-log records .../device_serial_output into replay files:

mqtty-log device mqtt://<host>/<serial-server>/<device> capture.jsonl.zst
mqtty-log prefix mqtt://<host>/<topic-prefix> logs/
  • device records one full device URL into a single compressed replay file and adds .zst if omitted
  • prefix subscribes to <topic-prefix>/#, keeps topics ending in device_serial_output, and rotates per-device logs under <outdir>/<topic-path-below-prefix>/YYYY-MM-DD_replay.jsonl.zst

mqtty-log-replay replays either plain or compressed replay logs:

mqtty-log-replay path/to/replay.jsonl.zst [--raw] [--follow] [--info]

Raw .jsonl logs are still accepted for replay and inspection.

The <topic> segment of the URI is used as the base path for MQTT messages across both live commands:

  • .../device_serial_input receives bytes from local input and sends them to the device
  • .../device_serial_output carries device output back to your terminal or PTY

Example

mqtty mqtt://broker.local/mydevice

This connects your terminal directly to mydevice/device_serial_input and mydevice/device_serial_output.

To expose a PTY instead:

mqtty mqtt://broker.local/mydevice --pts-only

This prints the local PTY path and keeps it bridged to the same MQTT topics until interrupted.

To capture a replay log while a device is running:

mqtty-log device mqtt://broker.local/mydevice mydevice.jsonl.zst

To capture every device under one serial-server or a broader base prefix:

mqtty-log prefix mqtt://broker.local/testbench/mark-pantry logs/
mqtty-log prefix mqtt://broker.local/testbench logs/

To inspect or replay that log later:

mqtty-log-replay mydevice.jsonl.zst --info
mqtty-log-replay mydevice.jsonl.zst

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mqtty-0.1.5.tar.gz (15.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mqtty-0.1.5-py3-none-any.whl (13.6 kB view details)

Uploaded Python 3

File details

Details for the file mqtty-0.1.5.tar.gz.

File metadata

  • Download URL: mqtty-0.1.5.tar.gz
  • Upload date:
  • Size: 15.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for mqtty-0.1.5.tar.gz
Algorithm Hash digest
SHA256 b8d1b0743c0a6bd49c4bd6e9d023fc52ce3b1263ee729dc2724db744954446e6
MD5 4dbf5e8b0732ab8fe876e51f8436b656
BLAKE2b-256 5f8e73610d9d06e3cc01a32499052c4f9b7b3fdebb2121cf01689566d5629e2f

See more details on using hashes here.

Provenance

The following attestation bundles were made for mqtty-0.1.5.tar.gz:

Publisher: release.yml on embeddedTS/mqtty

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mqtty-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: mqtty-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 13.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for mqtty-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 6469b214e42ce79fd86901fcdbd1d87210da07c53954765cdb7631aa3ed5bc52
MD5 b2fe307e22e05521b29e251484867586
BLAKE2b-256 b6b5c674be7c5c5c89d126e93b7d1184d6c39307d328a8d8ac8a8104d39287d5

See more details on using hashes here.

Provenance

The following attestation bundles were made for mqtty-0.1.5-py3-none-any.whl:

Publisher: release.yml on embeddedTS/mqtty

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page