[inputs.modbus] Error in plugin: EOF

Hello!

I just installed telegraf and wanted to collect some modbus data.

With each additional modbus-server i got an additional error message:

[inputs.modbus] Error in plugin: EOF

Any suggestions how to configure this?

here is my attempt:

[agent]
[[outputs.influxdb]]

[[inputs.modbus]]
name = "s1"
slave_id = 1
controller = "tcp://10.0.0.113:502"
holding_registers = [
{ name = "tempA"  , byte_order = "AB",   data_type = "FLOAT32", scale=0.1,  address = [51]},
]

[[inputs.modbus]]
name = "s2"
slave_id = 200
controller = "tcp://10.0.0.222:502"
holding_registers = [
{ name = "tempB"  , byte_order = "AB",   data_type = "FLOAT32", scale=0.1,  address = [13]},
]

[[inputs.modbus]]
name = "s3"
slave_id = 1
controller = "tcp://10.0.0.177:502"
holding_registers = [
{ name = "tempC"  , byte_order = "AB",   data_type = "FLOAT32", scale=0.1,  address = [7]},
]

Hello @rwalli,
What version of InfluxDB are you using? Can you please share the agent and output section of your config?
Can you also please send your data to stdout?
or use ./telegraf -config telegraf.conf -input-filter modbus -test
To see if you get the expected line protocol?
Finally, have you tried setting debug=True in the agent portion of your config? Do the detailed logs help more?

Hello Anaisdg!

Thank you for your answer.
Unfortunately I’m a complete newbie and even don’t understand your questions.

X-Influxdb-Version: 1.8.3

Do you mean the influxdb-config?
I cant find “agent and output” section here.
I already postet my whole telegraf-config.

2020-12-15T22:40:32Z I! Starting Telegraf 1.16.3
2020-12-15T22:40:32Z D! [agent] Initializing plugins
2020-12-15T22:40:32Z D! [agent] Starting service inputs
modbus,host=hz,name=s1,type=holding_register tempA=72.3 1608072033000000000
modbus,host=hz,name=s3,type=holding_register tempC=1.5 1608072033000000000
modbus,host=hz,name=s2,type=holding_register tempB=42.7 1608072033000000000
2020-12-15T22:40:32Z D! [agent] Stopping service inputs
2020-12-15T22:40:32Z D! [agent] Input channel closed
2020-12-15T22:40:32Z D! [agent] Stopped Successfully

“debug=True” give me: Error parsing data: line 2: invalid TOML syntax
the above output is with “debug=true” in telegraf.conf

to summarize once again:

  • if i use only one of the three modbus servers no error occurred.
  • if i use 2 of the three modbus servers one error occurred:

[inputs.modbus] Error in plugin: EOF

  • if i use three modbus servers 2 errors occurred:

[inputs.modbus] Error in plugin: EOF
[inputs.modbus] Error in plugin: EOF

Hello @rwalli,
Thanks for all the info (sorry about the debug=true uppercase typo). That’s odd. Your line protocol looks correct. I would expect multiple inputs to work. Can you try using a jitter in your telegraf config?

 ## Collection jitter is used to jitter the collection by a random amount.
  ## Each plugin will sleep for a random time within jitter before collecting.
  ## This can be used to avoid many plugins querying things like sysfs at the
  ## same time, which can have a measurable effect on the system.
  collection_jitter = "5s"

I’ll send this to the telegraf team as well. I’m probably missing something.

sorry,
collection_jitter = "5s"
produces the same error.

Boo :frowning: Sorry to hear that. I asked the telegeraf team and they said that they believe your issue seems to be related to the specific hardware that you’re using.
Have you tried each input configuration separately?
Is it that just one input configuration works? Or all three work individually?

Hello!
I double checked configuration and I’m very sorry to say that I’ve obviously made a mistake in my testing-setup.
I apologize for the confusion.

I’t seems now that the the log-messages (Error in plugin: EOF) are limited to devices with mbusd (GitHub - 3cky/mbusd: Open-source Modbus TCP to Modbus RTU (RS-232/485) gateway.).

I’m running mbusd for years and it’s very stable and I have no issues with other application than telegraf.

When I increase the TCP-timeout of mbusd over the “interval” of telegraf I got no error anymore.
But setting a TCP-timeout of 15min would be strange.

Does telegraf close the TCP-connection after the “interval”?