Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Discuss libmodbus on FreeRTOS / esp-idf #767

Open
franzhoepfinger opened this issue Aug 18, 2024 · 1 comment
Open

Discuss libmodbus on FreeRTOS / esp-idf #767

franzhoepfinger opened this issue Aug 18, 2024 · 1 comment

Comments

@franzhoepfinger
Copy link

franzhoepfinger commented Aug 18, 2024

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

@diplfranzhoepfinger
Copy link
Contributor

i overlooked:

#745

he did almost the same work, and solved some of the Questions above already.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants