Skip to content

vli11/device-modbus-go

 
 

Repository files navigation

Device Modbus Go

Build Status Code Coverage Go Report Card GitHub Latest Dev Tag) GitHub Latest Stable Tag) GitHub License GitHub go.mod Go version GitHub Pull Requests GitHub Contributors GitHub Committers GitHub Commit Activity

Overview

Modbus Micro Service - device service for connecting Modbus devices to EdgeX.

Build with NATS Messaging

Currently, the NATS Messaging capability (NATS MessageBus) is opt-in at build time. This means that the published Docker image and Snaps do not include the NATS messaging capability.

The following make commands will build the local binary or local Docker image with NATS messaging capability included.

make build-nats
make docker-nats

The locally built Docker image can then be used in place of the published Docker image in your compose file. See Compose Builder nat-bus option to generate compose file for NATS and local dev images.

Usage

Users can refer to the document to learn how to use this device service.

Example Profile and Device

The ProfilesDir and DevicesDir in the configuration.toml are empty string by default. To use the example Profile and Device in this repository, please fill './res/profiles' and './res/devices' to ProfilesDir and DevicesDir respectively. modbus.test.device.profile.toml and modbus.test.devices.toml will be loaded and created when the Device Service starts up. Users can modify those files or add additional Profile YAML or Device TOML to meet their needs.

Modbus Simulator

Build and run the Modbus simulator

$ cd simulator
$ go build
$ ./simulator 
Modbus TCP address: 0.0.0.0:1502 
Start up a Modbus TCP simulator.

Packaging

This component is packaged as docker image and snap.

For docker, please refer to the Dockerfile and Docker Compose Builder scripts.

For the snap, refer to the snap directory.

Modbus RTU Usage

Users can refer to the document to set up the Modbus RTU device.

Community

License

Apache-2.0

Packages

No packages published

Languages

  • Go 94.3%
  • Makefile 2.1%
  • Shell 2.0%
  • Dockerfile 1.6%