serial-terminal

Safely interact with serial ports (send/receive data). Use when the user needs to communicate with serial devices like Arduino, ESP32, or other microcontrollers. CRITICAL - Never read /dev/tty* devices directly.

16 stars

Best use case

serial-terminal is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Safely interact with serial ports (send/receive data). Use when the user needs to communicate with serial devices like Arduino, ESP32, or other microcontrollers. CRITICAL - Never read /dev/tty* devices directly.

Teams using serial-terminal should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/serial-terminal/SKILL.md --create-dirs "https://raw.githubusercontent.com/diegosouzapw/awesome-omni-skill/main/skills/tools/serial-terminal/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/serial-terminal/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How serial-terminal Compares

Feature / Agentserial-terminalStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Safely interact with serial ports (send/receive data). Use when the user needs to communicate with serial devices like Arduino, ESP32, or other microcontrollers. CRITICAL - Never read /dev/tty* devices directly.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Serial Terminal Skill

Safely interact with serial ports without directly reading /dev/tty* devices (which would crash Claude Code).

## CRITICAL SAFETY RULES

1. **NEVER** read from `/dev/tty*` devices directly using `cat`, `head`, `tail`, or any other command
2. **NEVER** use the Read tool on `/dev/tty*` files
3. **ALWAYS** use the Python wrapper script for ALL serial operations

## Device Identification

**IMPORTANT: Always use `/dev/serial/by-id/` paths when available!**

When multiple devices are connected, raw paths like `/dev/ttyACM0` can change between reboots or when devices are reconnected. The `/dev/serial/by-id/` directory provides stable, descriptive paths that include the device serial number.

Example `/dev/serial/by-id/` entries:
```
/dev/serial/by-id/usb-SEGGER_J-Link_001057754341-if00 -> ../../ttyACM2
/dev/serial/by-id/usb-SEGGER_J-Link_001057754341-if02 -> ../../ttyACM3
```

**When the user asks to connect to a device:**
1. First run `list` to show available devices with their serial numbers
2. Ask the user which device/serial number they want to use if multiple are present
3. Use the `/dev/serial/by-id/` path for the connection

## Available Commands

The script is located at `~/.claude/skills/serial-terminal/scripts/serial_terminal.py`

### List Available Ports

```bash
python3 ~/.claude/skills/serial-terminal/scripts/serial_terminal.py list
```

This will show devices from `/dev/serial/by-id/` with their serial numbers, making it easy to identify which device is which.

### Send Data

```bash
python3 ~/.claude/skills/serial-terminal/scripts/serial_terminal.py send <port> "<message>" [options]
```

Options:
- `--baud <rate>`: Baud rate (default: 115200)
- `--newline`: Append newline to message (useful for command-line interfaces)

Example:
```bash
python3 ~/.claude/skills/serial-terminal/scripts/serial_terminal.py send "/dev/serial/by-id/usb-SEGGER_J-Link_001057754341-if02" "AT" --newline --baud 9600
```

### Receive Data

```bash
python3 ~/.claude/skills/serial-terminal/scripts/serial_terminal.py receive <port> [options]
```

Options:
- `--baud <rate>`: Baud rate (default: 115200)
- `--timeout <secs>`: How long to wait for data (default: 2.0)
- `--bytes <n>`: Max bytes to read (default: 4096)
- `--hex`: Display data as hex dump

Example:
```bash
python3 ~/.claude/skills/serial-terminal/scripts/serial_terminal.py receive "/dev/serial/by-id/usb-SEGGER_J-Link_001057754341-if02" --timeout 5 --baud 115200
```

### Send and Receive (most common)

Send a command and wait for response in one operation:

```bash
python3 ~/.claude/skills/serial-terminal/scripts/serial_terminal.py sendrecv <port> "<message>" [options]
```

Example:
```bash
python3 ~/.claude/skills/serial-terminal/scripts/serial_terminal.py sendrecv "/dev/serial/by-id/usb-SEGGER_J-Link_001057754341-if02" "help" --newline --timeout 3
```

## Troubleshooting

### Permission denied
The user may need to add themselves to the `dialout` group:
```bash
sudo usermod -a -G dialout $USER
# Then logout and login again
```

Or use sudo for a quick test:
```bash
sudo python3 ~/.claude/skills/serial-terminal/scripts/serial_terminal.py list
```

### No response received
- Check baud rate matches the device
- Increase timeout with `--timeout`
- Verify the device is connected with `list`
- Try adding `--newline` if the device expects CR/LF

### Device busy
Another program may have the port open. Close any serial monitors or other tools.

## Script Details

The Python script uses only standard library modules:
- `os` - Low-level file operations
- `termios` - Serial port configuration
- `select` - Non-blocking I/O (safe timeout handling)
- `fcntl` - File descriptor control

It safely handles serial I/O by:
1. Using `select()` to wait for data with timeout (never blocks indefinitely)
2. Setting non-blocking mode to prevent hangs
3. Properly restoring terminal settings on exit

Related Skills

open-eth-terminal-action-generator

16
from diegosouzapw/awesome-omni-skill

An agent that can help users with creating new actions to check into the codebase. It should generate action code and link it to the application after querying the user for information about the goal of the action.

serialization

16
from diegosouzapw/awesome-omni-skill

Choose the right serialization format for .NET applications. Prefer schema-based formats (Protobuf, MessagePack) over reflection-based (Newtonsoft.Json). Use System.Text.Json with AOT source generators for JSON scenarios.

arxivterminal

16
from diegosouzapw/awesome-omni-skill

CLI tool (arxivterminal) for fetching, searching, and managing arXiv papers locally. Use when working with arXiv papers using the arxivterminal command - fetching new papers by category, searching the local database, viewing papers from specific dates, or managing the local paper database.

symfony:api-platform-serialization

16
from diegosouzapw/awesome-omni-skill

Use when symfony api platform serialization

bgo

16
from diegosouzapw/awesome-omni-skill

Automated Blender build-go workflow. Automatically builds, removes old version, installs, enables, and launches Blender with your extension/add-on. Use when you want to quickly test changes, execute complete build-to-launch cycle, or run custom packaging scripts with automatic Blender launch.

Coding & Development

maintenance

16
from diegosouzapw/awesome-omni-skill

Cleans up and organizes project files. Use when user mentions '整理', 'cleanup', 'アーカイブ', 'archive', '肥大化', 'Plans.md', 'session-log', or asks to clean up old tasks, archive completed items, or organize files. Do NOT load for: 実装作業, レビュー, 新機能開発, デプロイ.

hello-skill

16
from diegosouzapw/awesome-omni-skill

每次对话开始时,声明"[Skills✏️已加载]"

zylvie-automation

16
from diegosouzapw/awesome-omni-skill

Automate Zylvie tasks via Rube MCP (Composio). Always search tools first for current schemas.

zoominfo-automation

16
from diegosouzapw/awesome-omni-skill

Automate Zoominfo tasks via Rube MCP (Composio). Always search tools first for current schemas.

zoho-invoice-automation

16
from diegosouzapw/awesome-omni-skill

Automate Zoho Invoice tasks via Rube MCP (Composio): invoices, estimates, expenses, clients, and payment tracking. Always search tools first for current schemas.

zoho-inventory-automation

16
from diegosouzapw/awesome-omni-skill

Automate Zoho Inventory tasks via Rube MCP (Composio): items, orders, warehouses, shipments, and stock management. Always search tools first for current schemas.

zoho-bigin-automation

16
from diegosouzapw/awesome-omni-skill

Automate Zoho Bigin tasks via Rube MCP (Composio): pipelines, contacts, companies, products, and small business CRM. Always search tools first for current schemas.