Skip to content
pubscout

modbus

0.2.0, released 4 years ago by an unverified publisher

Simple Modbus TCP client library for Dart.

$ flutter pub add modbus
Source repository

What it does

Provides a client to communicate with Modbus devices over TCP. Supports RTU mode and multi‑slave operations. Handles connection, requests and responses in a Dart‑friendly API.

AI-written summary of version 0.2.0, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need to talk to Modbus devices over TCP from a Dart/Flutter app.
  • You require a lightweight, null‑safe client without native code or platform channels.

Skip it when

  • Serial (RTU) Modbus communication is required.
  • You need advanced features like encryption, high‑performance batching, or extensive protocol extensions.

Strengths

  • Easy‑to‑use API with async/await support
  • Supports multi‑slave mode on a single connection
  • Null‑safe and pure Dart implementation

Weaknesses

  • Only TCP transport is implemented; no serial support
  • Limited feature set compared to full‑stack Modbus libraries

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
1
import 'package:modbus/modbus.dart' as modbus;

void main() async {
  var client = modbus.createTcpClient('10.170.1.20', port: 1001, mode: modbus.ModbusMode.rtu);
  await client.connect();
  var id = await client.reportSlaveId();
  print('Slave ID: $id');
  client.close();
}

Alternatives

Packages that do the same job and could replace modbus.

Works with

Packages commonly used together with modbus: ones it builds on, ones built on it, and its own family.