Skip to content

Discuss libmodbus on FreeRTOS / esp-idf #767

Open
@franzhoepfinger

Description

@franzhoepfinger

libmodbus version

3.1.10 plus Modifications

OS and/or distribution

ESP-IDF Release v5.3 https://github.com/espressif/esp-idf/releases/tag/v5.3

OS is a FreeRTOS https://www.freertos.org/

Environment

Planned to run on all ESP32 Derivates,
so Architecture is RISC-V as well as the Xtensa

Description

PR:
#766

and

#765

Example for modbus-tcp: https://github.com/Fliegl-Agrartechnik-GmbH/libmodbus-examples-esp-idf/tree/main/modbus-tcp

(this was tested against diagslave-3.5 from https://www.modbusdriver.com/diagslave.html)

Example for modbus-rtu: https://github.com/Fliegl-Agrartechnik-GmbH/libmodbus-examples-esp-idf/tree/main/modbus-rtu

(this lets blink a LED on a Waveshare Output Module: https://www.waveshare.com/wiki/Modbus_RTU_IO_8CH)

the TCP Sample is nothing to discuss,
with the PR #765 everything runs out of the Box.

the RTU Sample runs as given,
PR #766
BUT there is some un-nice duplication in the code:
see:

L46 and L76 for the Baud Rate,

L47 and L76 for the Data Bits, and so on.

so frankly speaking,

L40-L65 could also be part of the Driver, but it works also this way, however it is not sooooo nice.

happy to discuss this.

https://groups.google.com/g/libmodbus/c/9DJpfgxUowA

https://www.esp32.com/viewtopic.php?f=13&t=3302

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