I have been using influxdb for a while, and have decided to give telegraf a try now that it supports modbus.
I have a RS-485 serial bus with 5 modbus slaves with different slave_ids. My test setup uses nodejs/node-red and requests data with intervals of 10s to 60s, with only a few registers per modbus slave.
By stopping my test setup and switching to telegraf I have to configure the [[inputs.modbus]] 5 times in order to request from 5 different slave_ids.
To me it seems like they are running in parallel and trying to access controller = “file:///dev/ttyUSB0” at the same time, giving: [inputs.modbus] Error in plugin: serial: timeout
With collection_jitter set, there is also correct readings, but randomly ~40% timeouts
[[inputs.modbus]]
name = “Dummy1”
slave_id = 6
timeout = “1s”
controller = “file:///dev/ttyUSB0”
baud_rate = 19200
data_bits = 8
parity = “E”
stop_bits = 1
transmission_mode = “RTU”
input_registers = [
{ name = “Dummy1”, byte_order = “AB”, data_type = “UINT16”, scale=1.0, address = [4]},
]
[[inputs.modbus]]
name = “Dummy2”
slave_id = 7
timeout = “1s”
controller = “file:///dev/ttyUSB0”
baud_rate = 19200
data_bits = 8
parity = “E”
stop_bits = 1
transmission_mode = “RTU”
input_registers = [
{ name = “Dummy2”, byte_order = “AB”, data_type = “UINT16”, scale=1.0, address = [2]},
]
… a total of 5
Is there a better way of requesting from 5 slaves?
Is there a way to sequence the requests?