Description
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
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.