Hello,
I have a problem to get telegraf with modbus input get to work.
Modbus Input part of config:
[[inputs.modbus]]
interval = "5s"
name_override = "SDM120"
name = "NOT USED"
tagexclude = ["type", "name", "host"]
timeout = "2s"
controller = "tcp://192.168.20.160:502"
debug_connection = true
configuration_type = "request"
# ---------------------------------------------- slave_id = 1 ----------------------------------------
[[inputs.modbus.request]]
slave_id = 1
byte_order = "ABCD"
register = "input"
fields = [
{ address = 0, name = "Spannung", type="FLOAT32" },
]
[inputs.modbus.request.tags]
sensor = "pv1"
When I start telegraf I get the following:
2022-11-23T19:13:44Z D! [agent] Connecting outputs
2022-11-23T19:13:44Z D! [agent] Attempting connection to [outputs.influxdb_v2]
2022-11-23T19:13:44Z D! [agent] Successfully connected to outputs.influxdb_v2
2022-11-23T19:13:44Z D! [agent] Starting service inputs
2022-11-23T19:13:45Z D! [inputs.modbus] Reading slave 1 for tcp://192.168.20.160:502...
2022-11-23T19:13:45Z D! [inputs.modbus] trying to read input@0[2]...
2022-11-23T19:13:45Z D! [inputs.modbus] modbus: send 00 01 00 00 00 06 01 04 00 00 00 02
2022-11-23T19:13:47Z E! [inputs.modbus] Error in plugin: slave 1: read tcp 192.168.20.216:53436->192.168.20.160:502: i/o timeout
2022-11-23T19:13:47Z D! [inputs.modbus] Reconnecting to tcp://192.168.20.160:502...
2022-11-23T19:13:50Z D! [inputs.modbus] Reading slave 1 for tcp://192.168.20.160:502...
If I test the connection on the same VM it will work:
It is a SDM120 Modbus Meter connected to a USR-DR302 Gateway.
I’ve tested a few configurations, but I could not find the error…
Greets NSC2001