2 hours ago
It seems to be a physical communication issue if you're saying that the script also produces errors from time to time. How long is the bus and what topology is used? Do you have 0V/GND connected between gateway and all Modbus devices?