finds.dev← search

// the find

RT-Thread-packages/freemodbus

★ 271 · C · NOASSERTION · updated Apr 2024

A Modbus ASCII/RTU and TCP implementation

A fork of FreeModbus that adds open-source master (host) mode — the original FreeModbus only open-sourced the slave side and charged for master. This port is designed for RT-Thread RTOS but can be adapted to bare metal. It supports RTU, ASCII, and TCP for slave; RTU-only for master.

The master API is blocking and thread-safe with configurable timeouts, which is exactly what you want on an RTOS where you're calling from a task. Slave and master can run simultaneously in the same protocol stack — uncommon and genuinely useful for gateway devices. The separation of `_m.c` suffix files for master mode makes it easy to exclude master code from memory-constrained builds. Sample code and callback interface pattern are clean and cover the common case without requiring you to understand the whole state machine.

Master mode only supports Modbus RTU — no ASCII or TCP for master, which is a real gap if you need to talk to devices over Ethernet. Slave addressing is hardcoded to continuous addresses starting at 1, so any network with non-sequential slave IDs requires hacking the internals. Last meaningful activity is 2024 and the repo is an RT-Thread package fork, not an upstream project — bug fixes depend on RT-Thread community bandwidth, not a dedicated maintainer. The two-dimensional array data model for storing all slave data is naive and will fall apart at any reasonable scale or dynamic node configuration.

View on GitHub →

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →