slowtec/tokio-modbus
slowtec/tokio-modbus has 574 GitHub stars and 158 forks. GitHot measured +3 in 7 days. Last checked 2026-11-11 04:18 UTC. Last push 2026-07-22.
A tokio-based modbus library
What you can do
- Pure Rust library
- Modbus TCP or RTU at your choice
- Both async (non-blocking, default) and sync (blocking, optional)
- for out-of-the-box usage or
Measured star growth
- in 24h
- Update delayed
- in 7 days
- +3
- in 15 days
- Collecting history
- in 1 month
- Collecting history
Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.
README.md
Originaltokio-modbus
A pure Rust Modbus library based on tokio.
Modbus is based on a master/slave communication pattern. To avoid confusion with the Tokio terminology the master is called client and the slave is called server in this library.
Features
- Pure Rust library
- Modbus TCP or RTU at your choice
- Both
async(non-blocking, default) andsync(blocking, optional) - Client API
- Server implementations
- for out-of-the-box usage or
- as a starting point for a customized implementation
- Open source (MIT/Apache-2.0)
Installation
Add this to your Cargo.toml:
[dependencies]
tokio-modbus = "*"
Cargo Features
"rtu": Asynchronous RTU client (default)"tcp": Asynchronous TCP client (default)"rtu-sync: Synchronous RTU client"tcp-sync": Synchronous TCP client"rtu-server": (Asynchronous) RTU server"tcp-server": (Asynchronous) TCP server"rtu-over-tcp-server": (Asynchronous) RTU over TCP server
Examples
If you only need an asynchronous TCP client add the following line to your Cargo.toml file:
[dependencies]
tokio-modbus = { version = "*", default-features = false, features = ["tcp"] }
For an asynchronous RTU client:
[dependencies]
tokio-modbus = { version = "*", default-features = false, features = ["rtu"] }
For an RTU server:
[dependencies]
tokio-modbus = { version = "*", default-features = false, features = ["rtu-server"] }
For a TCP server:
[dependencies]
tokio-modbus = { version = "*", default-features = false, features = ["tcp-server"] }
Examples
Various examples for Modbus RTU and TCP using either the asynchronous or synchronous API can be found in the examples folder.
Testing
The workspace contains documentation, tests, and examples for all available features.
cargo test --workspace
cargo test --workspace --all-features
Protocol-Specification
- Modbus Application Protocol Specification v1.1b3 (PDF)
- Modbus over serial line specification and implementation guide v1.02 (PDF)
- Modbus Messaging on TCP/IP Implementation Guide v1.0b (PDF)
License
Copyright (c) 2017-2026 slowtec GmbH
Explore related projects
n8n-io/n8n
Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.
210,057 starslanggenius/dify
Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.
160,773 starsmicrosoft/PowerToys
Microsoft PowerToys is a collection of utilities that supercharge productivity and customization on Windows
140,833 starsstablyai/orca
Orca is the place for working with a fleet of agents (e.g. Grok Bot, Claude Code). Run any coding agent with your own subscription. Available on desktop, mobile and remote runtime.
121,654 stars