Serial port debug tool for humans and AI agents
Project description
ttypal
Serial port debug tool designed for both humans and AI agents.
Features
- Interactive terminal (like minicom, but better)
- Auto-logging with timestamps and rotation
- External command injection via Unix socket (for AI/scripts)
- ZMODEM file transfer over serial
- Record/replay serial sessions
- Macro recording and playback (F1-F12 hotkeys)
- Board config management
- AI agent skill for serial debugging
Install
pip install ttypal-ai
Platform-specific setup:
- Linux - Native support; serial port permissions required
- macOS - Native plug-and-play support (untested)
- Windows - Run through WSL2 + usbipd-win (untested)
Quick Start
# Interactive mode
ttypal
# Headless daemon (for AI automation)
ttypal-daemon start -b myboard
# Send commands from another process
ttypal-send --wait "# " "uname -a"
# Read recent serial output
ttypal-tail -n 50
Python API
Use TtypalClient from Python tests and automation code to talk to a running
ttypal-daemon without spawning ttypal-send for every operation.
from ttypal.client import TtypalClient, TtypalTimeoutError
serial = TtypalClient(session="myboard")
try:
output = serial.send_wait("uname -a", prompt="# ", timeout=30)
except TtypalTimeoutError as exc:
print(f"timed out via {exc.socket_path}: {exc.output}")
else:
print(output)
Stable first-version methods:
| Method | Purpose |
|---|---|
send(command) |
Send a command without waiting for output |
send_wait(command, prompt="# ", timeout=None) |
Send a command and return output collected until prompt |
expect_send(expect, command, timeout=None) |
Wait for text, then send a command |
expect_send_wait(expect, command, prompt="# ", timeout=None) |
Wait for text, send a command, then wait for prompt |
probe(timeout=2.0) |
Send Enter and return the current console response |
request(payload, operation_timeout=None, io_timeout=None) |
Send a raw daemon protocol request |
Macros
Bind command sequences to F1-F12 keys in your board config:
[macro]
F1 = ["echo hello", "sleep 0.5", "ls -la"]
F2 = ["reboot"]
Or record interactively: Ctrl-T r to start, Ctrl-T s to stop and save.
AI Agent Integration
Clone this repo and point your agent runtime at the reusable skill in
.agents/skills/ttypal/.
cd /path/to/ttypal-ai
# Then ask your AI agent to operate the serial port with ttypal
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ttypal_ai-0.9.0.tar.gz.
File metadata
- Download URL: ttypal_ai-0.9.0.tar.gz
- Upload date:
- Size: 41.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4698828715a84322e2183c8bf09ca1d4ac7e590534dcaa5bca65773bbc61f837
|
|
| MD5 |
cded9c7204338ff3d7e78c155d1623d4
|
|
| BLAKE2b-256 |
60eb6fbec20ec5ef06f1729b3125a26e78ea6a7eae82e3892e5133fde31aa168
|
File details
Details for the file ttypal_ai-0.9.0-py3-none-any.whl.
File metadata
- Download URL: ttypal_ai-0.9.0-py3-none-any.whl
- Upload date:
- Size: 33.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
36e12c2b1141ca73e4aa14bc699c038d2816cee35b2012fe18e1f03f9d538f8e
|
|
| MD5 |
acd916c05c6555df23beee4162ec7ecb
|
|
| BLAKE2b-256 |
532f66c066e4d1f5f9ef02013872c72107418f56fcbe64abc14777dc5c1bb108
|