Skip to content

Request to add a new entry #222

Description

@Tangerino

mpModbus — Modbus library that runs unchanged on CPython and MicroPython

Just open-sourced this. Same source runs on CPython 3.11+ and MicroPython 1.21+ (incl. ESP32) — no try/import shims in user code.

RTU + TCP, async-only API, declarative JSON drivers (register maps with formats / scaling / masks / word-orderings / enums / virtual computed registers — adding a meter doesn't touch Python), multi-bus Collector with per-bus reconnect + per-device circuit breaker, and a persist pipeline
featuring on_change, wall-clock-aligned 15m/1h windows (every device on a slow RTU bus emits at the same :00 / :15 / :30 / :45 instant — jitter-corrected), PLC-style ton/toff run-time counters, and avg / sum / max / min / delta aggregations.

MicroPython angles

  • ESP32 IDF UART FIFO quirks handled in the RTU transport (frame-length-based termination — long responses don't need setup-specific tuning).
  • machine.UART kwargs ladder, RS-485 DE/RE as a URL param (&de=4), float32-on-MP quantisation handled (timestamps stay int — a 2026 Unix timestamp as float32 rounds into ~50s buckets on ESP32).
  • Single-file bundle: python build_bundle.py → one mpmodbus_bundle.py, deploys with one mpremote cp. OTA-friendly: one file, atomic write, hash-checkable.

298 hermetic tests passing on CPython 3.11/3.12/3.13 + MicroPython 1.22 unix-port (CI on every push). Hardware-validated on real ESP32 against an ION-7650-V2 power meter (RTU + TCP) and a Waveshare 8I-8O digital-I/O module (RTU).

v0.1.0, MIT, Beta. Especially interested in reports from anyone running it on non-ESP32 targets (RP2, STM32, NRF) — that's the bit I can't test from my bench.

https://github.com/Tangerino/mpModbus

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions