mirror of
https://gitee.com/pnoker/iot-dc3.git
synced 2026-10-31 10:11:49 +08:00
a live-stack sweep of all 36 drivers surfaced five sdk-level defects that left reads dead or the whole fleet unbootable: - drop the empty spring.main stub in the shared driver profile; the boot 4.1 binder rejects null-valued keys and every driver died at startup with a bind exception - rename the schedule enable flag to enable to match what every driver application.yml actually spells; with the old enabled key the read and custom quartz jobs were silently never scheduled - treat proto3 zero-versions as unset when reconciling registration so a driver restart re-registers instead of failing the optimistic lock with 'driver version conflict' - ignore the driver's own registration event that can be consumed before applymetadata finishes instead of logging an error - initialize jdbc/serial connection maps eagerly: the registration event handler invalidates pools and nped on a lazy-null map - ble: exclude the guava 18 pin dragged in by bluetooth-manager - kafka: use the starter (boot 4 split autoconfigurations out of the bare jar) and read the compose-provided bootstrap variable - lwm2m: pin californium to the 3.x api leshan m14 needs and configure an explicit coap endpoint - mqtt: replace the orphaned spring-integration gateway with a paho publisher so the send path exists again - boot sweep result: 36/36 drivers start, 0 errors
DC3 Driver Modbus RTU
Overview
dc3-driver-modbus-rtu is the Modbus RTU protocol driver of the IoT DC3 platform. It connects to Modbus slave devices
over a serial port (via modbus4j and jSerialComm), reads coil/register values using function codes 1-4, and writes
values to coils and holding registers.
Module Information
- Group ID: io.github.pnoker
- Artifact ID: dc3-driver-modbus-rtu
- Driver Name: Modbus RTU Driver
Driver Attributes (Device-level)
| Attribute | Description |
|---|---|
| Port | Serial port name (e.g. /dev/ttyUSB0, COM3) |
| Baud Rate | Serial baud rate (e.g. 9600, 19200, 115200) |
| Data Bits | Data bits (7 or 8) |
| Stop Bits | Stop bits (1 or 2) |
| Parity | Parity (0=None, 1=Odd, 2=Even, 3=Mark, 4=Space) |
Point Attributes
| Attribute | Description |
|---|---|
| Slave ID | Modbus slave unit ID |
| Function Code | Modbus function code [1, 2, 3, 4] |
| Offset | Register or coil address offset |
Command Attributes (write)
| Attribute | Description |
|---|---|
| Slave ID | Modbus slave unit ID |
| Function Code | Modbus write function code [5, 6, 15, 16] |
| Offset | Register or coil address offset |
| Value Template | Value template rendered with command params |
The module application.yml is authoritative for attribute codes, types, default values, scheduling, health, and local
buffering. Keep this README aligned when those user-facing settings change.
Prerequisites
A Modbus RTU slave device connected to an accessible serial port (e.g. /dev/ttyUSB0, COM3) on the host running the
driver.
Running Locally
1. Start Infrastructure and Center Services
make up-db
make up-dev GROUP=core
2. Build and Run
mvn -s .mvn/settings.xml -pl dc3-driver/dc3-driver-modbus-rtu -am package
java -jar dc3-driver/dc3-driver-modbus-rtu/target/dc3-driver-modbus-rtu.jar
Testing
Run the module tests from the repository root:
mvn -s .mvn/settings.xml -pl dc3-driver/dc3-driver-modbus-rtu -am test
Related Modules
dc3-common-driver— Driver SDK for registration, scheduling, and RabbitMQ integration