
modbus-debug
当需要调试 Modbus RTU(串口)或 Modbus TCP(网络)设备通信时使用,支持寄存器读写、从站扫描和持续监控。
- Installs
- 563
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/leokemp223/embed-ai-tool --skill modbus-debug- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads modbus-debug automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
Modbus 调试
适用场景
- 嵌入式设备实现了 Modbus RTU/TCP 从站,需要验证通信是否正常。
- 需要读写保持寄存器、输入寄存器、线圈或离散输入。
- 需要扫描总线上的从站地址,确认设备是否在线。
- 需要持续监控寄存器值的变化。
必要输入
- RTU 模式:串口号(如 COM42)、波特率、从站地址。
- TCP 模式:主机 IP 和端口、从站地址。
- 操作类型:读/写/扫描/监控。
依赖
pymodbus(pip install pymodbus)pyserial(RTU 模式需要)
执行步骤
- 先阅读 references/usage.md,确认操作参数。
- 探测环境:
python scripts/modbus_tool.py --detect - 根据需求执行对应操作:
# 读保持寄存器 python scripts/modbus_tool.py --port COM42 --slave 1 --read --address 0 --count 10 # 写寄存器 python scripts/modbus_tool.py --port COM42 --slave 1 --write --address 0 --values 100,200 # 扫描从站 python scripts/modbus_tool.py --port COM42 --scan --scan-range 1-10 # TCP 读取 python scripts/modbus_tool.py --tcp --host 192.168.1.100 --slave 1 --read --address 0 --count 10
失败分流
connection-failure:串口无法打开、网络不通。slave-no-response:从站地址无响应。illegal-function:设备不支持该功能码。illegal-address:寄存器地址越界。
输出约定
示例输出格式:
结果: ✅ 读取 10 个寄存器
连接: RTU COM42 9600 8N1
从站: 1
地址 | 十进制 | 十六进制 | 二进制
------+---------+----------+--------------------
0 | 100 | 0x0064 | 0000000001100100
1 | 200 | 0x00c8 | 0000000011001000
交接关系
- 从
build-keil/build-platformio烧录固件后,用此 skill 验证 Modbus 通信。 - 与
serial-monitor互补:serial-monitor 查看串口原始输出,modbus-debug 进行协议级调试。
FAQ
What does the modbus-debug skill do?
当需要调试 Modbus RTU(串口)或 Modbus TCP(网络)设备通信时使用,支持寄存器读写、从站扫描和持续监控。
How do I install modbus-debug?
Run npx skills add https://github.com/leokemp223/embed-ai-tool --skill modbus-debug in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/modbus-debug/ (personal) or .claude/skills/modbus-debug/ (project).
Which AI agents can use modbus-debug?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is modbus-debug safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains modbus-debug?
It is published by leokemp223 in leokemp223/embed-ai-tool. It has 563 recorded installs.
More from leokemp223/embed-ai-tool
build-keil
leokemp223/embed-ai-tool
当需要通过 Keil MDK 命令行编译嵌入式工程,调用自带脚本解析工程文件、执行构建并定位固件产物时使用。
build-platformio
leokemp223/embed-ai-tool
当需要通过 PlatformIO 命令行编译嵌入式工程,调用自带脚本解析环境配置、执行构建并定位固件产物时使用。
workflow
leokemp223/embed-ai-tool
当需要串联多个 skill 完成编译+烧录+监控或编译+烧录+调试等流水线任务时使用。
flash-keil
leokemp223/embed-ai-tool
当需要通过 Keil MDK 内置调试器烧录固件到目标板时使用,利用工程中已配置的调试器和 Flash 算法执行下载。
Popular code quality & workflow skills
grill-me
mattpocock/skills
A relentless interview to sharpen a plan or design.
improve-codebase-architecture
mattpocock/skills
Scan a codebase for deepening opportunities, present them as a visual HTML report, then grill through whichever one you pick.
handoff
mattpocock/skills
Compact the current conversation into a handoff document for another agent to pick up.
domain-modeling
mattpocock/skills
Build and sharpen a project's domain model. Use when discussing codebase terminology, writing or editing a GLOSSARY.md, or recording or editing an ADR.
codebase-design
mattpocock/skills
Shared vocabulary for designing deep modules. Use when the user wants to design or improve a module's interface, find deepening opportunities, decide where a seam goes, make code more testable or AI-navigable, or when another skill needs the deep-module vocabulary.
diagnosing-bugs
mattpocock/skills
Diagnosis loop for hard bugs and performance regressions. Use when the user says "diagnose"/"debug this", or reports something broken/throwing/failing/slow.