modbus_client_serial
1.3.1, released 2 years ago by cabella.net
Modbus client for ASCII/RTU over serial ports
What it does
Provides a Modbus client implementation that can send ASCII and RTU requests via a serial port. It supports auto‑connection, unit ID, timeouts, endianness, and a wide range of Modbus element types.
AI-written summary of version 1.3.1, based on the package's README and metadata. Report an inaccuracy
Use it when
- Communicating with industrial devices over serial Modbus (ASCII/RTU).
- Building embedded or IoT applications that need Modbus serial access.
- When you need a lightweight client with minimal dependencies for serial communication.
Skip it when
- You only need TCP/UDP Modbus communication.
- You are targeting a pure web environment without native serial support.
Strengths
- Minimal dependencies – only logging, libserialport, synchronized, and modbus_client.
- Auto‑connection mode simplifies request handling.
- Full endianness support and a rich set of Modbus element types.
- Cross‑platform support (Android, iOS, Windows, macOS, Linux).
Weaknesses
- Requires native libserialport build or flutter_libserialport package.
- No support for web or pure Dart VM without native binaries.
- Documentation is limited to README and changelog; no extensive examples.
Setup
- Kind
- Pure Dart
- Effort
- Medium
- Code generation
- No
- Direct dependencies
- 4
Add flutter_libserialport to your Flutter project or build libserialport manually for Dart projects. No build_runner needed.
import 'package:modbus_client/modbus_client.dart';
import 'package:modbus_client_serial/modbus_client_serial.dart';
void main() async {
var temp = ModbusInt16Register(
name: "BatteryTemperature",
type: ModbusElementType.inputRegister,
address: 22,
uom: "°C",
multiplier: 0.1,
onUpdate: (self) => print(self));
var client = ModbusClientSerialRtu(portName: "COM1", unitId: 1);
await client.send(temp.getReadRequest());
client.disconnect();
}Alternatives
Packages that do the same job and could replace modbus_client_serial.
- socket_io_client
Dartlang port of socket.io-client for web, flutter, and dartvm
72Compare - vmodal_sdk_flutter
Typed VModal API client for Flutter to upload videos and search moments by meaning.
67Compare - fetch_client
HTTP client using Fetch API with WASM support, cancelable and streamable requests
63Compare - sync_http
Synchronous HTTP client for Dart using RawSynchronousSockets.
50Compare
Works with
Packages commonly used together with modbus_client_serial: ones it builds on, ones built on it, and its own family.
- loggingmodbus_client_serial depends on itProvides configurable logging with levels and stream listeners for Dart apps.
- synchronizedmodbus_client_serial depends on itLock mechanism to prevent concurrent access to asynchronous code.
- modbus_clientmodbus_client_serial depends on itBase Modbus client package for sending requests via Serial and TCP/IP.
- libserialportmodbus_client_serial depends on itDart FFI bindings to libserialport for accessing serial ports.
- modbus_client_tcpSame familySends Modbus requests to remote devices via TCP/IP connections.