-
Notifications
You must be signed in to change notification settings - Fork 121
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
"Device or resource busy" in RTU server example #185
Comments
I find out that it's used again in this line. tokio-modbus/examples/rtu-server.rs Line 53 in 5fc09c4
And I still don't know how to make it work. I think the examples and docs should be more easy to understand. Their purpose is to guide library user, not to confuse us. |
Should we use other device path, like |
You can create a virtual serial ports using socat and run 2023/11/28 15:10:19 socat[66531] N PTY is /dev/ttys033 2023/11/28 15:10:19 socat[66531] N starting data transfer loop with FDs [5,5] and [7,7] ` Use one for the server and another for the client
` Use these builder for server and client. It will work. |
I had to run using sudo under Ubuntu to get arround this problem. |
I don't have means to test what @chadwagner1 said as of right now, if it's that simple and someone can confirm we can probably close this issue and open a PR to document it better |
Hello!
I would like to say in advance that this is one of my first times working with the modbus protocol and, mostly, with Rust.
Recently I've been working with a PLC (Xenje XC3-24RT-E) and wanted to build a small interface for it. I managed to make it work almost on the first attempt using the first Node.js module I could find, but since I wanted to experiment with Tauri I thought I might as well try to do the backend Rust.
So, I cloned the repo and ran the rtu-server example, but after building it gave me the following error:
I then tried to check if the port was being used somewhere else, and I confirmed it wasn't by running the command
lsof /dev/ttyUSB0
(lsof).I would also like to note that in my Node.js code I'm using the following port settings, so maybe I'm doing something wrong by not changing the default example.
Thank you to anyone who's willing to help.
The text was updated successfully, but these errors were encountered: