Skip to main content

Moncube Modbus TCP Facade - Expose Moncube cubicle data via Modbus

Project description

Moncube Modbus Facade

Expose Moncube MQTT sensor data via Modbus TCP for integration with SCADA systems and industrial monitoring tools.

Installation

pip install moncube-modbus

Or from source:

git clone https://github.com/moncube/moncube-modbus.git
cd moncube-modbus
pip install -e .

Quick Start

1. Create Configuration File

Generate a sample configuration:

moncube-modbus init -o config.yaml

Or run without subcommand (backward compatible):

python -m moncube_modbus init -o config.yaml

Then edit config.yaml to add your cubicle UUIDs:

mqtt:
  url: "broker.emqx.io"
  qos: 1
  username: ""
  password: ""

modbus:
  host: "0.0.0.0"
  port: 5020 # Use 502 for standard (requires root)

cubicles:
  "2cf51a55-a4bc-4ec2-b22c-a0054963677b": 0
  "6e9f7bf2-2f9b-4a6f-8b83-9b9c10f2a0a1": 1

staleness:
  warnSec: 30
  badSec: 120

2. Run the Server

moncube-modbus run -c config.yaml --log INFO

Or use the shorter form:

moncube-modbus -c config.yaml --log INFO

Usage as a Library

from moncube_modbus import ModbusFacade, FacadeConfig
import yaml

# Load configuration
with open("config.yaml") as f:
    config_data = yaml.safe_load(f)
config = FacadeConfig.from_dict(config_data)

# Create and run facade
facade = ModbusFacade(config)
facade.run()  # Blocks until stopped

Register Layout

📖 For detailed register documentation, see REGISTERS.md

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

moncube_modbus-1.1.0.tar.gz (12.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

moncube_modbus-1.1.0-py3-none-any.whl (15.5 kB view details)

Uploaded Python 3

File details

Details for the file moncube_modbus-1.1.0.tar.gz.

File metadata

  • Download URL: moncube_modbus-1.1.0.tar.gz
  • Upload date:
  • Size: 12.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.18

File hashes

Hashes for moncube_modbus-1.1.0.tar.gz
Algorithm Hash digest
SHA256 ce459228623bb4af866baa21ecd30e9152d71428ca9f66d4c32a995491803577
MD5 18d9fec05551fefe13786797f4c6cf0b
BLAKE2b-256 fca855beb04b42399ad6671788a9ed87206a9e73f8bf64f3ef7f2687f51b695d

See more details on using hashes here.

File details

Details for the file moncube_modbus-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: moncube_modbus-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 15.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.18

File hashes

Hashes for moncube_modbus-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 137d62309a4488d0609db21448f5ac2fe69e1121546990af778f778b8ac7a282
MD5 7023754d5fc1179b217ac990e4de6e48
BLAKE2b-256 cd04e443965c16b2f161315834deb2ab55494099021af24868d60cc764394cb6

See more details on using hashes here.

Supported by

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