modbus_client
1.4.5, released 7 months ago by cabella.net
Base Modbus client package for sending requests via Serial and TCP/IP.
What it does
Provides the core implementation for Modbus clients communicating with remote Modbus servers over TCP, UDP, or Serial (ASCII/RTU) connections. Supports a wide range of element types, endianness configurations, and file records.
AI-written summary of version 1.4.5, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to communicate with Modbus servers/devices over TCP, UDP, or Serial in Dart or Flutter.
- You require granular element definitions like registers, coils, and bit masks with custom scaling and multipliers.
Skip it when
- You are building web or mobile apps that do not require industrial hardware communication protocols.
Strengths
- Supports multiple transport protocols via companion packages (TCP, UDP, Serial).
- Comprehensive support for various Modbus element types and custom requests.
Weaknesses
- Requires platform-specific serial libraries (like flutter_libserialport) for serial communication in Flutter/Dart.
- Protocol and library limits apply for byte sizes and frame lengths.
Setup
- Kind
- Pure Dart
- Effort
- Medium
- Code generation
- No
- Direct dependencies
- 3
For serial implementations in Flutter projects, you need to add the flutter_libserialport package to your own project.
import 'package:modbus_client/modbus_client.dart';
import 'package:modbus_client_tcp/modbus_client_tcp.dart';
void main() async {
var batteryTemperature = ModbusInt16Register(
name: "BatteryTemperature",
type: ModbusElementType.inputRegister,
address: 22);
var modbusClient = ModbusClientTcp("192.168.0.1", unitId: 1);
await modbusClient.send(batteryTemperature.getReadRequest());
modbusClient.disconnect();
}Alternatives
Packages that do the same job and could replace modbus_client.
- dart_mcp
A Dart library for building Model Context Protocol (MCP) servers and clients.
87Compare - serverpod_client
Base classes for communicating with a Serverpod backend via HTTP and WebSocket
87Compare - http_multi_server
A dart:io HttpServer wrapper that handles requests from multiple servers.
90Compare - talker_http_logger
Lightweight and customizable HTTP client logger based on Talker for Dart and Flutter.
81Compare
Works with
Packages commonly used together with modbus_client: ones it builds on, ones built on it, and its own family.
- loggingmodbus_client depends on itProvides configurable logging with levels and stream listeners for Dart apps.
- synchronizedmodbus_client depends on itLock mechanism to prevent concurrent access to asynchronous code.
- modbus_client_tcpBuilt on modbus_clientSends Modbus requests to remote devices via TCP/IP connections.