NodeRed <-> MQTT <-> Arduino <-> RS485 ModBus RTU <-> Schneider ATV930

I'm looking for a solution to remotely control an electrical motor via ModBus RTU. For this arrangement, there is a Raspberry Pi that runs NodeRed, connected via LAN with a Controllino MEGA (Arduino Mega 2560), a Schneider ATV930 connected to the Controllino MEGA via RS485 and, of course, the electrical motor.

Up to now, at my understanding level of Arduino programming, I've been able to connect some sensors, display their info in NodeRed and send some commands to Controllino via MQTT, but I can not fully understand how to make the MQTT transition to ModBus RTU to control the electrical motor.

Googling for similar projects, I have found this project where the author managed to control an electrical motor with Arduino MEGA and a Schneider VSD via ModBus. Also there is a ModBus RTU example for Controllino at this adress.

Thanks in advance for opinions, suggestions and solutions

Although I think the Arduino acting just as a conduit for the data is not really necessary but I guess you have some reason for the hardware choice. The Raspberry Pi is also able to talk ModBus RTU (libmodbus, pymodbus, etc.) so you may eliminate the Arduino if that's the only task for it.

What's the reason for using MQTT? From my point of view it just adds complexity. Is it because NodeRed has a MQTT module available? It has a serial module also which might be used. Is NodeRed already predefined?

There are several reasons why this arrangement was chosen: 1. The setup it will work in an remote place (monitoring data and logs are sended to remote server) 2. A local database it will be needed (NodeRed/Raspberry Pi) 3. Controllino it will have many tasks (almost all I/O ports will be used and RS485 is allready onboard), I did not find a HAT for Raspberry Pi with so many I/O ports 4. In addition to sensor-based functioning, there will be a scheduler which can be changed daily (remotely)

Using MQTT seems to me to be the best way to communicate between the computer and the controller, and NodeRed it is easy to use for sending data in a remote server and receiving tasks for the controller

I use NodeRed with user contributed plug-ins for non-MQTT protocols. There are about 2200 plug-ins.

Have you tried this one? I have never used modbus so I have no idea how well it works.