You are using staging server - a separate instance of the ESP Component Registry that allows you to try distribution tools and processes without affecting the real registry.

uploaded 1 year ago

ESP-MODBUS is the official Modbus library for Espressif SoCs.


# ESP-Modbus Library

## Overview

An Espressif ESP-Modbus Library (esp-modbus) is a library to support Modbus communication in the networks based on RS485, WiFi, Ethernet interfaces. The Modbus is a data communications protocol originally published by Modicon (now Schneider Electric) in 1979 for use with its programmable logic controllers (PLCs).

* [ESP-Modbus component on GitHub](

This library is to be used with Espressif’s IoT Development Framework, [ESP_IDF]( The packages from this repository are uploaded to Espressif’s component repository.

* [esp-modbus component in component repository](

You can add the component to your project via ` add-dependency`. More information about idf-component-manager can be found in [Espressif API guide]( or [PyPi registry](

The ESP-Modbus library can be used with ESP-IDF v4.1 and later. ESP-IDF v4.x releases include an earlier version of ESP-Modbus library inside freemodbus component. To use ESP-Modbus with these releases, users need to exclude the built-in freemodbus component from the build process, and update application components to depend on esp-modbus component instead. To exclude freemodbus component from compilation, add the following line to the project CMakeLists.txt file:

set(EXCLUDE_COMPONENTS freemodbus)

ESP-IDF v5.x and later releases do not include freemodbus component, so no extra steps are necessary when adding esp-modbus component.

## Documentation

The documentation can be found on the link below:

* [ESP-Modbus documentation (English)](

## Application Examples

The examples below demonstrate the ESP-Modbus library of serial, TCP ports for slave and master implementations accordingly.

- [Modbus serial slave example](

- [Modbus serial master example](

- [Modbus TCP master example](

- [Modbus TCP slave example](

Please refer to the specific example for details.

## Protocol References

- [Modbus Organization with protocol specifications](

## Contributing

We welcome contributions to this project in the form of bug reports, feature requests and pull requests.

Issue reports and feature requests can be submitted using Github Issues: Please check if the issue has already been reported before opening a new one.

Contributions in the form of pull requests should follow ESP-IDF project's [contribution guidelines]( We kindly ask developers to start a discussion on an issue before proposing large changes to the project.

## Licence

ESP-Modbus project is based on [FreeMODBUS library](, Copyright (c) 2006 Christian Walter and licensed under the BSD 3-clause license.

Modbus Master related code is Copyright (c) 2013 Armink and licensed under BSD 3-clause license.

All original code in this repository is Copyright (c) 2016-2022 Espressif Systems (Shanghai) Co. Ltd.

The project is distributed under Apache 2.0 license. See the accompanying [LICENSE file]( for a copy.


Supports all targets

License: Apache-2.0

To add this component to your project, run: add-dependency "espressif/esp-modbus^1.0.2"

or download archive


  • ESP-IDF >=4.1
  • Stats

    • Downloaded in total
      Downloaded in total 40 times
    • Downloaded this version
      This version: 34 times


    espressif/esp-modbus version: 1.0.2 |