Indeed, if you set period to 1 second, there will be too many Modbus requests on the serial link, especially when you have 10 slave devices.
First of all, try increasing the period to say, 30 seconds or above for testing purposes.
Secondly, configure only one instance and check if you are able to read Modbus data from the device. You may also increase timeout to 2-3 seconds for testing. If you can the Modbus data from a single slave, you can proceed adding more slave devices to configuration.
Thirdly, verify your Serial Device configurations and make sure that settings like baud rate, data bits, and so on, are consistent between both the RUT955 and the slave devices.
The following article here may also be helpful if you would like to do some testing.
ModBus is a polling protocol, simplex. Thus, you should not start a new transmission from master (either poll or select), until response OR timeout. Be advised, that 1s timeout is far too long, unless your RS485 link is configured for 300bit/sec, or even slower. You should become familar with org ModBus protocol specs, from Modicon (now Schneider).
There are very detailed protocol specs regarding correct timing. I.e. timeout after poll (or select) is heavily dependent upon speed of link, of course. FYI, there is also a character timeout specified, speed dependent, of course. However, in software usually it is approximated by using a timeout for (expected) telegram length.
I’m aware of that you wrote, in fact, I’m reading the same information from a PLC working as MODBUS master with no problem, I’m trying to replace the PLC with a RUT955.
The problem is that I can’t infere how the MODBUS driver works on a RUT955 according to the provided parameters.
I’d like to know how to adjust these parameters for 10 devices and 2 requests per device, a complete example. My network begins to fail when the number of slaves increases, even increasing timeout to 5 (insane) and period to 150 seconds, this doesn’t happen when I use a PLC as MODBUS master.
Sorry, I do not really understand this. You want to use 10 slaves, OK, but what does … 2 requests per device … mean ?
I have a large fleet of RUT955 in the field, NOT running Teltonikas OS, but “official” openwrt. Thus, I programmed the ModBus stuff myself, using a very well established library called libmodbus. Org written in C, I am using its LUA bindings. I very strongly suspect, that Teltonika uses this library, too. There you can specify a ‘response-timeout’, and a ‘byte-timeout’. Running my RS485 with 115kbit/s, I am using a byte-tmo of 0, and a response tmo of 150,000 microsec, which is more or less according to ModBus specs. However, I only have one slave.
To read the slaves data, I programmed a standard polling cycle of 1/sec; however, after issuing a special write to the slave, starting some mechanical equipment via slave, I am using a shorter poll of 0.5 sec to catch the equipments feedback. This works perfectly.
So, I suggest you to search on github for ‘libmodbus’ , for further details.
Assuming, you can do C or LUA
It seems that the issue manifests when additional slave devices are added. Along with checking the timings, please make sure to use termination resistors. Note that the RUT955 does not come with a pre-soldered RS485 termination resistors. When you have many slave devices, it is strongly advised to use termination resistors on the RS485 serial link. For more information, including a diagram, please refer to the wiki page here.