ESP-IDF Component ESP-Modbus Library

Hi there,

i got the same problems as in https://github.com/espressif/esp-idf/issues/6134.

Now there is a improved component, released from espressif: ESP-Modbus. It is not (yet) part of the ESP-IDF.

With ESP-IDF you can add the component with idf.py add-dependency espressif/esp-modbus==1.0.1. Is there any similar option within platformIO?

One problem i see is, that this component uses the same header which are used from the standard “freemodbus” component (which is also part of the platformIO installation).

Thank you in advance

Just copy the new component into the components/ folder of the PlatformIO project. See documentation.

Not a problem since the documentation tells you set(EXCLUDE_COMPONENTS freemodbus), so that internal component will be excluded, while you should add the new esp-modbus component to the EXTRA_COMPONENT_DIRS of course. PlatformIO builds the firmware through the ESP-IDF CMake build system, so what works in ESP-IDF, works in PlatformIO.

1 Like

That was easy :slight_smile: It’s working. Thank you!

Actually, I read this document severall times, but i didn’t really understood.