-
Notifications
You must be signed in to change notification settings - Fork 34
Add ASCII/RTU over TCP transports #21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
It would be helpful to enable travis to get immediate feedback on the PR apart from reviews. |
thanks @andig good point. Internally we use buildkite and i will check if this works with external prs. |
@frzifus you can enable it to also build PRs from external contributors, but I'd rather not since it would allow anyone to execute arbitrary code on our nodes. We could instead push the changes to a normal branch after a quick review that the PR doesn't mess with the pipeline |
Will fix the imports tomorrow. For build pipeline you might want to add travis in addition to what you‘re running internally? |
Happy New Year! Any news on this one? |
The buildkite setup we continuously us and maintain the configuration. Hence, I prefer an integration branch here to run our CI system on it. |
Hi guys, I'm already working on providing CI for our public repos. Should be in place by end of next week ;) |
These adapters just repackaging serial frames into TCP payload and vice versa. Unfortunately, a Modbus RTU or ASCII frame as TCP payload does not make Modbus TCP. Therefore, what these adapters speak is outside of the Modbus specification and to my opinion does not fit into a Modbus library. But I can understand that you want your setup to run. What speaks against the solution with the virtual serial device, e.g. via socat? Alternatively, we could make the transport and decoding instances for each combination (serial+RTU/ASCII & TCP+ModbusTCP) accessible to the outside, this way you can create a custom handler. @frzifus what is your opinion on all this? You worked the most with Modbus. |
Thats true.
As we've seen (also from external comments) this is a very popular configuration, even if not standard.
It's an external dependency outside goland that would need to be maintained. Especially for dockerized applications anything that moves beyond "single purpose" containers is a nightmare.
I would be happy to provide and maintain that. However, it feels that the changes required to do so properly are much more invasive than the solution suggested here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
y, i am fine with that. Basically we should redesign a bit more than that in a upcoming version. 💃
@andig could you adopt the commit messages, please? SEE: #22 (review)
Done. This is a bit painful, especially with multiple commits and will break following the history due to the needed force-push. May I suggest using squash&commit which allows to adjust the commit message? |
thanks! Sure, your feedback is always welcome. here are my thoughts: force push should be no problem as long as it is your own branch/pr. Basically you can also rename single commits without losing the history or breaking thinks. It's good stuff imagine you want to edit e.g. an incomprehensible or simply wrong commit message that you added when you started working on a feature. SEE: https://gist.github.com/nepsilon/156387acf9e1e72d48fa35c4fabef0b4#not-pushed--old-commit |
My though was more that commits need to address review findings (like here). Those are typically irrelevant for the merge commit as they show the development process, not the desired result. Renaming won't change that. Force-pushing in the end forces you to rely on me not accidentally sneaking in bad stuff or review again. But anyway, both ways work. Thank you! |
This PR implements ASCII/RTU "on the wire" encoding and transmits it over TCP. This allows to use cheap RS485/Ethernet adapters like USR-TCP232-304 or USR-TCP232-410 without workarounds using external components like pseudo ttys and socat. Apparently those adapters don't speak "Modbus TCP" on the client side, but rather relay "Modbus RTU" verbatim. I cannot tell if this conforms to any modbus standard (see stackoverflow for discussion), but I've verified this is working.
The PR is ported from goburrow/modbus#42 with minor adjustments for logging. It does not use the improved
tcpTransporter.send
logic as that is specific for TCP encoding as far as I could tell.Refs snaptec/openWB#290, fixes #20.