Skip to main content

Modular async modbus client and server

Project description

This is an anyio-enabled async frontend for pymodbus.

Usage

Check the example client and server for rudimentary usage.

Documentation patches gladly accepted.

Background

moat-modbus diverges from pymodbus in that it does not expose a “data store” context to the user. Instead, every bus value is a separate object, with arbitrary length and encapsulating its own encoding and decoding rules.

A Modbus server exposing writeable registers only needs to

  • register the value in question

  • wait for it to be written to

The rest happens behind the scenes.

Device Server

As some Modbus devices only allow ine server at a time, MoaT’s Modbus supports a simple bidirectional gateway.

How to get there:

  • Write a generic device description. Put it in the modbus-data repository.

  • Add an interface overlay that describes which topic to send the data to / which topic to read.

  • Run moat modbus dev poll FILE.yaml. You can use a generic systemd service if you copy the file to /etc/moat/modbus.

The values can be modified (factor+offset); the gateway works in both directions (command/state).

TODO

  • configurable codecs

  • get/set attributes

  • pack multiple values into a message

  • read-after-write if no slot

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

moat-modbus-0.6.2.tar.gz (30.6 kB view details)

Uploaded Source

Built Distribution

moat_modbus-0.6.2-py3-none-any.whl (30.6 kB view details)

Uploaded Python 3

File details

Details for the file moat-modbus-0.6.2.tar.gz.

File metadata

  • Download URL: moat-modbus-0.6.2.tar.gz
  • Upload date:
  • Size: 30.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.8.2 requests/2.25.1 setuptools/66.1.1 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.11.2

File hashes

Hashes for moat-modbus-0.6.2.tar.gz
Algorithm Hash digest
SHA256 ef53189fb5a3061c647d33ec7d30144fbb9267fba84aca1a64470d00d69a6cd7
MD5 671680a2e44ace14d94958fa0eed790e
BLAKE2b-256 f20e446e5219ad924b20f96cf5f7b0f56be795f351a822d2222a061ea786dfdb

See more details on using hashes here.

Provenance

File details

Details for the file moat_modbus-0.6.2-py3-none-any.whl.

File metadata

  • Download URL: moat_modbus-0.6.2-py3-none-any.whl
  • Upload date:
  • Size: 30.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.8.2 requests/2.25.1 setuptools/66.1.1 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.11.2

File hashes

Hashes for moat_modbus-0.6.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f8667cb990cd5bf30bbc9e8d2b9926de79fe061f54a50641577ad0fd9ed27a63
MD5 4c159e289c5eb762168ad9e6f3e5d411
BLAKE2b-256 608bb193d9677451125ba81ad42d4b35bac6ca722735d5b2d6ffe52820189923

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page