Modbus RTU with 2 equipment in the same bus

Hello,

I have two equipment with the same register in the same bus rs485 using linux.
I would like to collect data using telegraf.
When I add the configuration with one equipement it is working, with two equipement it is not.
I use different ID, for sure.

This is my conf file:


[[inputs.modbus]]
  name = "Onduleur_01"
  timeout = "2s"
  controller = "file:///dev/ttymxc0"
  baud_rate = 9600
  data_bits = 8
  parity = "N"
  stop_bits = 1
  slave_id = 1
  
  # REGISTER
  holding_registers = [
  { name = "9d99ce95-c0c3-b9e8-ff2b-1ba26b4a2c9b", byte_order="AB", data_type="FLOAT16-IEEE", scale=1.0, address=[32000] },

	]

 [[inputs.modbus]]
  name = "Onduleur_02"
  timeout = "2s"
  controller = "file:///dev/ttymxc0"
  baud_rate = 9600
  data_bits = 8
  parity = "N"
  stop_bits = 1
  slave_id = 2
  
  # REGISTER
  holding_registers = [
  { name = "cdbf5d00-a9ae-c04b-a14c-b59ea58283ff", byte_order="AB", data_type="FLOAT16-IEEE", scale=1.0, address=[32000] },
]

Hello @Loic_Winkelmann,
Can you set debug=true and share your logs?
You might want to try using to avoid collisions?

# pause_between_requests = "0ms"

Also:

You can debug Modbus connection issues by enabling debug_connection. To see those debug messages, Telegraf has to be started with debugging enabled (i.e. with the --debug option). Please be aware that connection tracing will produce a lot of messages and should NOT be used in production environments.
Please use pause_after_connect / pause_between_requests with care. Ensure the total gather time

@srebhan might have some better ideas though

Thank you so much!
I’ll take care of it and keep you updated.
Thanks again for your help!

1 Like

Hello,

I find the correct parameters for my case :
pause_after_connect = “500ms”
close_connection_after_gather = true

Thx a lot for you answerd it help me to have a look on [inputs.modbus.workarounds]

Have a good day