Has anyone come across the following error when working with the Modbus plugin?
[inputs.modbus] Error in plugin: write tcp xxx.xx.x.xx:5789->xxx.xx.x.xx:502: wsasend: An existing connection was forcibly closed by the remote host.
It’s giving this error every 2nd request. I’ve configured telegraf to run every 60 sec, so every even minute it returns this error. Any advice would be greatly appreciated, thanks.
Here is the config:
name_override = "Server_Room"
name= "Temp_PLC"
## Slave ID - addresses a MODBUS device on the bus
## Range: 0 - 255 [0 = broadcast; 248 - 255 = reserved]
slave_id = 1
## Timeout for each request
timeout = "1s"
busy_retries = 1
busy_retries_wait = "100ms"
## Maximum number of retries and the time to wait between retries
## when a slave-device is busy.
# busy_retries = 0
# busy_retries_wait = "100ms"
# TCP - connect via Modbus/TCP
controller = "tcp://xxx.xx.xx.xx:502"
## Analog Variables, Input Registers and Holding Registers
## measurement - the (optional) measurement name, defaults to "modbus"
## name - the variable name
## byte_order - the ordering of bytes
## |---AB, ABCD - Big Endian
## |---BA, DCBA - Little Endian
## |---BADC - Mid-Big Endian
## |---CDAB - Mid-Little Endian
## data_type - INT16, UINT16, INT32, UINT32, INT64, UINT64,
## FLOAT32-IEEE, FLOAT64-IEEE (the IEEE 754 binary representation)
## FLOAT32, FIXED, UFIXED (fixed-point representation on input)
## scale - the final numeric variable representation
## address - variable address
holding_registers = [
{ name = "Temp1", byte_order = "ABCD", data_type = "FLOAT32-IEEE", scale=1.0, address = [10,11]},
{ name = "Temp2", byte_order = "ABCD", data_type = "FLOAT32-IEEE", scale=1.0, address = [12,13]},
{ name = "Temp3", byte_order = "ABCD", data_type = "FLOAT32-IEEE", scale=1.0, address = [14,15]},
{ name = "Temp4", byte_order = "ABCD", data_type = "FLOAT32-IEEE", scale=1.0, address = [16,17]},
]
type or paste code here
type or paste code here