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.3.tar.gz (13.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.3-py3-none-any.whl (12.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mqtty-0.1.3.tar.gz
  • Upload date:
  • Size: 13.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.3.tar.gz
Algorithm Hash digest
SHA256 3c2c5a7e4e956b1fc92e0d8322794955df35730e0b953487323189bf0fc6ce7a
MD5 e4ef89faab0d218492fd982c2f187b23
BLAKE2b-256 b2603ea4bc09a8631744eafd3333945f0f3ef895de7ca579bd9398f54f11dd9b

See more details on using hashes here.

Provenance

The following attestation bundles were made for mqtty-0.1.3.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.3-py3-none-any.whl.

File metadata

  • Download URL: mqtty-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 12.5 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 5b6f02d3d5186a6fbd7b81d75c5bd5d4a2d6462fb72a2b3a20247c13dd6212d1
MD5 b7908af0e906a61ac3eded7ca731e31d
BLAKE2b-256 a573267adf890c9871df53ec2b4479580b002b6ca5ec400734901c7051a7ceea

See more details on using hashes here.

Provenance

The following attestation bundles were made for mqtty-0.1.3-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