awesome-repositories.com
Blog
awesome-repositories.com

Discover the best open-source repositories with AI-powered search.

ExploreCurated searchesOpen-source alternativesSelf-hosted softwareBlogSitemap
ProjectAboutHow we rankPressMCP server
LegalPrivacyTerms
© 2026 Bringes Technology SRL·VAT RO45896025·hello@awesome-repositories.com
·
stephane avatar

stephane/libmodbus

0
View on GitHub↗
4,180 stars·1,930 forks·C·LGPL-2.1·3 viewslibmodbus.org↗

Libmodbus

libmodbus is a portable C library that implements the Modbus protocol stack for industrial hardware communication. It provides a set of tools for reading and writing coils and registers on industrial controllers and sensors, functioning as both a client and a protocol server.

The library supports multiple transport layers, including a Modbus TCP stack for IPv4 and IPv6 network communication and a Modbus RTU driver for serial communication. It distinguishes itself through specialized data conversion utilities that handle byte-swapping and endianness for floating-point numbers and bit-field mapping to ensure compatibility across different hardware memory layouts.

The project covers a broad range of industrial communication capabilities, including atomic register operations, device identification, and the management of protocol constraints or device quirks. It provides comprehensive connectivity management for serial ports—including Request to Send signaling—and network sockets, alongside memory-mapped server buffers for simulating device memory.

This cross-platform implementation is compatible with Linux, Windows, macOS, and FreeBSD.

Features

  • Industrial Protocol Stacks - Provides a complete C implementation of the Modbus industrial communication protocol stack.
  • Modbus Server Implementations - Provides a full software implementation of the Modbus server role, managing memory-mapped registers for industrial device simulation.
  • Serial Port Interfaces - Initializes communication by configuring serial port parameters including baud rate, parity, and data bits.
  • Industrial Data Acquisition - Implements processes for reading and writing binary registers and bits from industrial hardware to monitor and control processes.
  • Client Connectivity Management - Manages the assignment of sockets and file descriptors within a communication context to handle multiple client requests.
  • Cyclic Redundancy Checks - Calculates and verifies CRC checksums to ensure data integrity for binary serial frames.
  • Industrial Coil Writing - Sets the status of multiple remote binary output coils using an array of boolean values.
  • Industrial Input Bit Retrieval - Retrieves the status of discrete input bits from remote industrial devices as boolean values.
  • Industrial Server Implementations - Implements industrial server endpoints that host memory-mapped registers and provide standardized access to device data.
  • Modbus Data Retrieval - Retrieves the boolean state of multiple remote binary coils from industrial devices.
  • Bidirectional Data Exchange - Enables bidirectional data exchange with industrial devices over serial or Ethernet to synchronize hardware states.
  • Industrial Register Writing - Sends a sequence of data values to specific holding register addresses on a remote device.
  • Modbus Protocol Libraries - Provides a portable C implementation for reading and writing coils and registers on industrial controllers.
  • Modbus RTU Networking - Implements binary serial communication using the Modbus RTU protocol, including CRC and baud rate management.
  • Modbus TCP Implementations - Provides network stacks enabling client and server data exchange using the Modbus protocol over TCP/IP.
  • Modbus TCP Networking - Implements the Modbus protocol over TCP/IP networking, supporting IPv4 and IPv6 sockets.
  • Remote Device Connectivity - Establishes bidirectional communication links with remote hardware over both TCP/IP and serial interfaces.
  • Device Identifier Assignment - Assigns the specific target Slave ID to a communication context to identify the remote industrial device.
  • Target Device Address Retrieval - Reads the target device identifier from the communication context to determine which slave is being addressed.
  • Modbus RTU Drivers - Ships a low-level serial driver handling binary framing and CRC checks for Modbus RTU communication.
  • Network Socket I/O - Uses standard BSD sockets for bidirectional data transmission over Ethernet.
  • Industrial Coil Setters - Sets a specific coil address on a remote device to a true or false state.
  • Industrial Register Writing - Sends a 16-bit value to a specific holding register address on a remote device.
  • Device Response Timeouts - Configures the interval to wait for a response from a remote industrial device before reporting a timeout error.
  • Cross-Platform Hardware Communication - Enables portable C applications to communicate with industrial equipment across Linux, Windows, macOS, and FreeBSD.
  • Connection Termination - Gracefully terminates active communication sessions to release network and serial hardware resources.
  • Serial Parameter Configurations - Configures baud rates, parity, and stop bits to match the electrical standards of connected hardware.
  • Automatic Connection Recovery - Automatically attempts to re-establish lost network links and flush buffers to maintain industrial communication stability.
  • Industrial Device Responses - Implements logic for analyzing incoming industrial protocol requests and transmitting corresponding responses based on memory mapping.
  • Protocol Validation Bypasses - Overrides standard protocol rules to support non-compliant devices by enabling extended addresses.
  • Connection Context Management - Uses state structures to encapsulate connection handles and configurations across API calls.
  • C Network Protocol Implementations - Implements a low-level network protocol stack written in C for maximum efficiency and portability.
  • Connection Timeout Management - Manages byte and response timeout intervals to prevent application hangs during data transmission.
  • Cross-Platform C Libraries - Provides a portable C library for low-level system integration across multiple operating systems.
  • Floating-Point Register Serialization - Serializes floating-point values into byte sequences tailored for industrial register layouts.
  • Modbus Memory Mapping - Implements the allocation and initialization of contiguous memory arrays to simulate Modbus coils and registers.
  • Data Type Conversions - Provides utilities for transforming raw bytes into integers and floating-point numbers to match device memory layouts.
  • Endian-Aware Float Formatting - Formats floating-point numbers into byte sequences with swapped orders for industrial hardware compatibility.
  • Register-Based Float Formatting - Formats floats into byte sequences distributed across multiple hardware registers.
  • Byte-Swapped Float Parsing - Provides utilities for converting byte sequences into floating-point numbers while accounting for non-standard hardware byte orders.
  • Float-to-Byte Packing - Converts floating-point values into raw 4-byte formats for transmission to industrial devices.
  • Register-to-Float Unpacking - Reconstructs floating-point numbers from multiple 16-bit Modbus registers using specific byte orders.
  • Device Memory Simulation - Emulates industrial device memory using contiguous memory blocks for coils and registers.
  • Protocol Error Code Mapping - Maps internal failures to Modbus protocol-defined exception codes for transmission back to the client.
  • Protocol - Toggles protocol-level behavioral deviations to support non-compliant industrial hardware.
  • Transport-Agnostic Interfaces - Provides a uniform API that abstracts the underlying transport medium, whether TCP, IPv6, or serial.
  • Server - Defines the specific duration a Modbus server waits for a client request before triggering a timeout.
  • Communication Protocols - C library for Modbus communication across multiple operating systems.

Star history

Star history chart for stephane/libmodbusStar history chart for stephane/libmodbus

AI search

Explore more awesome repositories

Describe what you need in plain English — the AI ranks thousands of curated open-source projects by relevance.

Start searching with AI

Frequently asked questions

What does stephane/libmodbus do?

libmodbus is a portable C library that implements the Modbus protocol stack for industrial hardware communication. It provides a set of tools for reading and writing coils and registers on industrial controllers and sensors, functioning as both a client and a protocol server.

What are the main features of stephane/libmodbus?

The main features of stephane/libmodbus are: Industrial Protocol Stacks, Modbus Server Implementations, Serial Port Interfaces, Industrial Data Acquisition, Client Connectivity Management, Cyclic Redundancy Checks, Industrial Coil Writing, Industrial Input Bit Retrieval.

What are some open-source alternatives to stephane/libmodbus?

Open-source alternatives to stephane/libmodbus include: nghttp2/nghttp2 — nghttp2 is a suite of low-level C libraries and tools designed for implementing the HTTP/2 protocol. It provides a… zgsm-ai/costrict — Costrict is an AI software engineering agent and coding assistant designed for enterprise-grade development. It… eugeny/terminus — Terminus is a multifunctional terminal emulator and connection manager designed for managing remote server shells and… open62541/open62541 — open62541 is an open-source implementation of the OPC Unified Architecture standard, providing a complete stack for… pyserial/pyserial — pyserial is a cross-platform Python library for reading and writing binary data to serial ports and hardware devices.… asterinas/asterinas — Asterinas is a memory-safe operating system kernel designed to prevent data races and memory corruption. It functions…

Open-source alternatives to Libmodbus

Similar open-source projects, ranked by how many features they share with Libmodbus.
  • nghttp2/nghttp2nghttp2 avatar

    nghttp2/nghttp2

    5,009View on GitHub↗

    nghttp2 is a suite of low-level C libraries and tools designed for implementing the HTTP/2 protocol. It provides a memory-efficient implementation of the protocol's core logic, including framing, stream multiplexing, and flow control. The project includes a dedicated library for HPACK header compression and decompression to reduce network bandwidth. It also provides a toolset for analyzing network traffic and benchmarking server performance, including throughput and latency measurements. Its broader capabilities cover protocol implementation and traffic management, including ALPN connection

    C++
    View on GitHub↗5,009
  • open62541/open62541open62541 avatar

    open62541/open62541

    3,033View on GitHub↗

    open62541 is an open-source implementation of the OPC Unified Architecture standard, providing a complete stack for industrial automation and data exchange. It functions as both an OPC UA server and client, enabling the creation of an object-oriented address space to model physical industrial assets and their relationships. The project is designed for versatility across diverse hardware, offering a C99 library that can be deployed to both cloud servers and resource-constrained embedded environments. It distinguishes itself through a pluggable network layer and interface-based security backend

    Ccclientiec-62541
    View on GitHub↗3,033
  • eugeny/terminusEugeny avatar

    Eugeny/terminus

    72,175View on GitHub↗

    Terminus is a multifunctional terminal emulator and connection manager designed for managing remote server shells and local hardware device connections. It functions as a customizable shell interface and a cross-platform serial client, supporting communication via SSH, Telnet, and serial ports. The application features an extensible system that allows the integration of third-party plugins, such as AI assistants and additional connectivity tools. It includes a dedicated SSH connection manager with support for jump hosts, port forwarding, and the storage of sensitive credentials within encrypt

    TypeScript
    View on GitHub↗72,175
  • pyserial/pyserialpyserial avatar

    pyserial/pyserial

    3,507View on GitHub↗

    pyserial is a cross-platform Python library for reading and writing binary data to serial ports and hardware devices. It provides a serial port enumeration tool for identifying available hardware and retrieving device path metadata. The project includes a network implementation for controlling remote serial port functions and signal lines over TCP/IP via the RFC 2217 standard. It also features a serial-to-TCP bridge for forwarding raw data between local ports and network sockets, as well as a specialized interface for managing half-duplex RS485 communication and RTS toggling. The library cov

    Pythonpythonserial
    View on GitHub↗3,507
See all 30 alternatives to Libmodbus→