Library for Modbus TCP/IP and RTU

Hello everyone,

I’m working on a project using the Arduino R4 Wifi board along with an Ethernet Shield Rev 2 (W5500 chip).

I’ve tried to use the official ArduinoModbus library for implementing a Modbus TCP server, but unfortunately, it is not compatible with the R4. The compilation fails with errors related to missing timeval and other POSIX types.

Since ArduinoModbus seems designed mainly for SAMD and other cores, I’m now looking for an alternative Modbus TCP library that Works smoothly on ArduinoR4 with Ethernet Shield Rev 2
Could anyone please recommend a good Modbus TCP library compatible with the Arduin R4 Wifi and Ethernet Shield Rev 2? Also, if you have any tips or example sketches, that would be greatly appreciated!

Thanks in advance for your help!