modbus-simulator

Automates Modbus TCP/RTU simulator lifecycle for integration tests via HTTP API.

4|Updated May 13, 2026
One-click install
npx skills add https://github.com/RuixeWolf/modbus-simulator --skill modbus-simulator-ruixewolf
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: modbus-simulator
Source: https://github.com/RuixeWolf/modbus-simulator/tree/main/skills/modbus-simulator
Command: npx skills add https://github.com/RuixeWolf/modbus-simulator --skill modbus-simulator-ruixewolf

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @ruixe/modbus-simulator, and includes scripts (resource) and references (resource) components.

What problem does it solve? Integration tests for Modbus clients need a disposable, controllable Modbus device without real hardware. This Skill starts an isolated Modbus TCP/RTU simulator, waits for readiness, seeds register fixtures, reads state for assertions, and cleans up the process safely. ## Core Features & Use Cases - Owned-process lifecycle: Launch the simulator on replaceable high ports, wait for the MODBUS_SIMULATOR_READY signal, and terminate only the process you started. - Fixture and assertion control: Write coils and registers (including typed encodings like FloatBE or raw hex bytes), read ranges for assertions, reset state, and page through cursor-based communication logs. - Use Case: While testing a PLC integration client, start the simulator on ports 15000/15020, write holding-register fixtures with the control helper, run the client test, then collect logs and shut the simulator down. ## Quick Start Start the Modbus simulator on ports 15000 and 15020, wait for readiness, then write test fixture values to the holding registers before running my client tests.

Frequently Asked Questions about modbus-simulator

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run a Modbus simulator for integration tests?▼

Launch @ruixe/modbus-simulator via npx on high ports such as HTTP 15000 and TCP 15020 with --ready-output json and --strict-ready. Wait for the MODBUS_SIMULATOR_READY record, then drive fixtures and assertions through the control.mjs helper.

How do I write Modbus register fixtures over an HTTP API?▼

Use the control helper's write command for raw boolean or 16-bit values, or write-encoded for typed data like FloatBE, Int32LE, or raw hex bytes. All addresses are zero-based across coils, discrete inputs, holding registers, and input registers.

Does the Modbus simulator support RTU serial connections?▼

Yes, it runs a Modbus RTU serial server alongside TCP with configurable baud rate, parity, data bits, and stop bits. Use real serial paths like COM3 on Windows or /dev/ttyUSB0 on Linux, and enumerate ports via the API.

Why does the Modbus simulator fail readiness checks?▼

Readiness failures usually come from occupied ports, missing serial permissions, or transport errors visible in the health endpoint. A strict-ready launch cleans up its own child process; pick a different high-port pair rather than killing unknown listeners.

How is authentication handled for the simulator API?▼

Set MODBUS_API_TOKEN in the helper environment to send an Authorization Bearer header without exposing the token in URLs or command arguments. Any non-loopback HTTP listener requires a token or an API token file.