Comments (3)
You can create a virtual serial ports using socat
and run
socat -d -d pty,raw,echo=0 pty,raw,echo=0
You will get two virtual serial ports for unix. (development purpose)
`
2023/11/28 15:10:19 socat[66531] N PTY is /dev/ttys031
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
`
let server_builder = tokio_serial::new("/dev/ttys031", 19200);
let client_builder = tokio_serial::new("/dev/ttys033", 19200);
`
Use these builder for server and client. It will work.
from tokio-modbus.
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.
from tokio-modbus.
Should we use other device path, like "/dev/ttyUSB1"
to create the builder for client_serial instead of using the same builder?
from tokio-modbus.
Related Issues (20)
- Generalize impl around `Service` usage HOT 5
- Tokio module 'runtime' is private HOT 12
- Asyncronous responses / Multiplexing HOT 2
- How to convert tokio_modbus::Request to bytes? HOT 5
- TCP server example - shared data hashmap HOT 5
- TCP Sync Client HOT 6
- write_multiple_registers taking array as a param HOT 3
- Can not disconnect slave, need help HOT 3
- Although disconnect the context, the SerialStream reopen error HOT 1
- Patterns/best practice for reconnect-after-failure? HOT 1
- How to turn 'tokio_serial::SerialStream' into global static to save it for reuse
- is_connected()? HOT 1
- Modbus RTU - Serial Direction Pin HOT 6
- Dev Dependencies: Upgrade rustls-pemfile and tokio-rustls HOT 4
- Return Modbus exception codes for client and server.
- Use `async-trait` in `Service` trait ? HOT 10
- tokio-modbus 0.12 entering unreachable code in any response error HOT 7
- Dev Dependencies: Upgrade rustls
- How to get hexadecimal modbus rtu message data HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tokio-modbus.