Telegraf modbus plugin serial port connection problem

Hello.

I’m test telegraf with modbus rtu in windows.
but there is error code in windows command.
usb port number is com7.

error message
2021-10-21T06:04:20Z E! [inputs.modbus] Error in plugin: The system cannot find the path specified.

This is modbus.conf

[[inputs.modbus]]
name = “witmotion”
slave_id = 80
timeout = “1s”
controller = “file:///dev/ttyUSB07”
baud_rate = 9600
data_bits = 8
parity = “N”
stop_bits = 1
transmission_mode = “RTU”
holding_registers = [
{ name = “angle_x”, byte_order = “AB”, data_type = “UINT16”, scale=0.1, address = [61]},
{ name = “angle_y”, byte_order = “AB”, data_type = “UINT16”, scale=0.1, address = [62]},
{ name = “angle_z”, byte_order = “AB”, data_type = “UINT16”, scale=0.1, address = [63]},
{ name = “temperature”, byte_order = “AB”, data_type = “UINT16”, scale=0.01, address = [64]},
]

In windows the COM-Ports are named differently. In your example you do have a Unix/Linux path. Maybe try controller = “file:///com7"?

1 Like

It was solved thanks to you.

@ahsjdkfl what was the path you used in Windows to solve this problem?
thanks

Hi,
I have a same problem with windows 10

image

## Serial (RS485; RS232)
  controller = "file:///COM12"
  baud_rate = 9600
  data_bits = 8
  parity = "N"
  stop_bits = 1
2022-10-19T16:23:55Z I! Starting Telegraf 1.24.2
2022-10-19T16:23:55Z I! Available plugins: 205 inputs, 9 aggregators, 26 processors, 20 parsers, 57 outputs
2022-10-19T16:23:55Z I! Loaded inputs: modbus
2022-10-19T16:23:55Z I! Loaded aggregators:
2022-10-19T16:23:55Z I! Loaded processors:
2022-10-19T16:23:55Z W! ←[31mOutputs are not used in testing mode!←[0m
2022-10-19T16:23:55Z I! Tags enabled: host=DESKTOP-AAN2EQ7
2022-10-19T16:23:55Z E! [inputs.modbus] Error in plugin: Le fichier spécifié est introuvable.
2022-10-19T16:23:55Z E! [telegraf] Error running agent: input plugins recorded 1 errors

I think the problem must come from the path to COM12 but I don’t know what to write ?

Thank you