| Crates.io | sergw |
| lib.rs | sergw |
| version | 0.3.0 |
| created_at | 2025-08-08 21:26:33.268251+00 |
| updated_at | 2025-08-11 23:49:08.676976+00 |
| description | Simple Serial to TCP Gateway: bridge a serial port to a TCP server |
| homepage | |
| repository | https://github.com/seofernando25/sergw |
| max_upload_size | |
| id | 1787351 |
| size | 160,575 |
Simple serial ↔ TCP gateway with a built‑in TUI and optional zero‑config mDNS advertisement.
sergw opens a local serial device and serves it over TCP, broadcasting serial output to all connected clients and forwarding client input to the serial device. It emphasizes pragmatic reliability (auto‑reconnect) and visibility (TUI overview and hex/ascii/dec inspector).
_sergw._tcpcargo install sergw
cargo install sergw --no-default-features
Bridge a serial device on port 5656 (defaults shown):
sergw listen --serial /dev/ttyUSB0 --baud 115200 --host 127.0.0.1:5656
Connect a TCP client (e.g. nc 127.0.0.1 5656) to interact.
sergw
ports [--all] [--verbose] [--format text|json]
listen [--serial <PATH>] [--baud <u32>] [--host <addr:port>]
[--data-bits five|six|seven|eight]
[--parity none|odd|even]
[--stop-bits one|two]
[--buffer <usize>]
mock serial [--alias <PATH>] # Linux only
mock listener [--host <addr:port>] # Linux only
ports: list serial ports (USB‑only by default). Use --all to include non‑USB. --format json for machine output.listen: start the bridge. If --serial is omitted and exactly one USB serial is present, it is auto‑selected; otherwise a helpful error is returned.mock serial (Linux): create a PTY that behaves like a serial device and open a TUI to interact.mock listener (Linux): connect to a TCP server with a TUI (handy for testing the bridge from the client side).When built with the mdns feature (default), sergw advertises the service using type _sergw._tcp.
sergw:<ttyname> (e.g. sergw:ttyUSB0)provider=sergwDisable mDNS by building without default features:
cargo build --no-default-features
--serial requiredcargo build --all-featurescargo clippy --all-targets --all-features -- -D warningsGPL‑3.0‑or‑later