← ClaudeAtlas

rs485-modbuslisted

Drive a USB-to-RS485 dongle as a Modbus RTU master via the bundled `modbus.py` helper for firmware bring-up, register dump, and protocol-level debugging. Use this skill ANY time the user mentions RS485, Modbus, Modbus RTU, holding/input registers, function codes (FC=03/04/06/10), CRC errors, "波特率", "从机地址", "寄存器", USB-RS485 adapter (FT232/CH340/CP210x), or wants to ping/read/write a Modbus slave from the Mac. Also use when the user says things like "测试 Modbus 通信", "读一下版本号", "发个起始命令", "the slave isn't responding", or is debugging a STM32/embedded firmware that exposes a Modbus interface. Self-contained — bundles the helper script + venv bootstrap; no external Modbus tooling required. Knows the emst-core preset (port `/dev/cu.usbserial-A50285BI`, slave 1, 115200 8N1, register map for VERSION/CMD/LEVEL/STATE).
HuMoran/tt-skills · ★ 0 · AI & Automation · score 70
Install: claude install-skill HuMoran/tt-skills
# RS485 Modbus RTU — Operation Skill Drives a USB-to-RS485 dongle as a Modbus RTU master via a bundled `modbus.py`. Pure pyserial + hand-rolled CRC — no `pymodbus`, no `mbpoll`. Two layers: **generic** (any port/slave/register) and **emst-core preset** (defaults baked in, version readout pretty-printed). ## When this skill applies - Bringing up Modbus on new hardware - Verifying a slave is alive (read VERSION / known input register) - Inspecting holding/input register values - Sending control commands to a Modbus slave - Diagnosing CRC errors, no-response timeouts, slave-address mismatches - Sanity-checking firmware UART/DMA RX path during emst-core bring-up If the user is sniffing traffic between an existing master/slave pair (passive bus tap), this skill does not yet do that — say so and stop. ## Hardware assumption USB-to-RS485 dongle with **automatic direction control** (most modern FT232/CH340-based "RS485 USB转串口" adapters). No DE/RE pin handling in software. If the user has a manual-DE adapter, this skill won't work — flag it. ## Bootstrap (first run on a new machine) ```bash bash "$HOME/.claude/skills/rs485-modbus/scripts/setup.sh" ``` Creates `$HOME/.claude/skills/rs485-modbus/.venv/` with `pyserial`. Idempotent. Run it again any time you see `ModuleNotFoundError: No module named 'serial'`. ## Tool invocation ```bash SKILL_DIR="$HOME/.claude/skills/rs485-modbus" PY="$SKILL_DIR/.venv/bin/python $SKILL_DIR/scripts/modbus.py" $PY <subcommand> [--preset emst-co