Closed Ogy closed 10 months ago
@Ogy plugins are executed in parallel in Telegraf, so your config will never work as you cannot predict the order of execution.
This being said, ModbusTCP with RTU is definitively implemented (I'm using this here right now)! So let's try to fix this the right way... ;-)
How is your device connected? Does it actually speak ModbusTCP or is this a ethernet-to-serial converter that just passes through the data to the serial bus? In this case you would need to specify this with transmission_mode = "RTUoverTCP"
because this is different from ModbusTCP.
An error message and/or your socat config might help to find out what to do... Furthermore, let's start with getting this to run with a single device - single request first (e.g. run telegraf ... --test --debug
) and then narrow down the "multiple devices" path...
Wow, many thanks! I'm blind, I overlooked the option 'transmission_mode=RTUoverTCP.' Now it's much simpler :D. It works as it should. Thanks again, and sorry for bothering you.
Thanks for info!
You are welcome. And no worries, that's what I'm here for. ;-)
Relevant telegraf.conf
Logs from Telegraf
System info
Telegraf 1.29.1 (git: HEAD@9a469977)
Docker
No response
Steps to reproduce
run multiple exec
Expected behavior
working
Actual behavior
doesn't work
Additional info
Hello, I was not able to run Modbus RTU over TCP. I gave it up, as, in my humble opinion, it's not implemented or I'm dumb. I came up with a socat workaround, which works well. Unfortunately, I have more readers, so I must close socat after reading data.
The questions are:
Is RTU over TCP implemented? Can jobs in one configuration be run sequentially, not in parallel? Can jobs be set to run even if one fails? (e.g., Modbus doesn't have a PTY - fails, and the last job (kill socat) is canceled) Are there any pre / post actions?
Many thanks in advance