I sniffed the communication and it seems the communication works correct. I don not uderstand why the Modbus node cannot show aswer from device. Can You help me with this issue ?
@Steve-Mcl l extensively looked for a solution but did not find.
However in order to help others I managed to find the solution. Inside a Docker container the $USER environment variable is an empty string. If you use whoami inside a terminal of your Node-RED Docker container the user is "node-red". This user only exists inside the container, is not member of a group and has no access to devices. This is causing trouble if you want to access serial ports. The simple solution is to add a user directive in the docker-compose.yml configuration file as follows:
I use docker-compose and I assume the problem is the same in docker. It resolves docker problems with Modbus, Serialport and SmartMeter. I tested in a 64-bit Raspberry Pi environment.
That really should have been in your OP & in the title - it changes many things. In fact after a few more questions, you would likely have been pointed to this: Docker NR & ttyUSB0 Permission denied - #17 by janvda
In short, please mention things like "docker" or "containerised" in your OP because it changes a lot of things.