(BTW, "virtual serial port" is a Windows term, on Unix these things are called "(pseudo) tty".) Or is there another, better way to do all that with docker? Would there be a way to achieve the exact same behavior (virtual serial ports) by using named pipes instead of pty? Then I could share the file (say "/home/user/folder/my_pipe") between the containers (actually I would mount "/home/user/folder" on both, and both would then access my_pipe). The problem is that I can't seem to find a way to share the devpts between two containers, and somehow it feels like it is not something good to do. The goal being that when in production, I can remove the virtual device container and just use the real sensor. Now, I want to go one step further, and have two docker containers representing the system: one container pretending to be the serial device, and the other container being the code using that device. The socat command would look like: socat -d -d pty,raw,echo=1 pty,raw,echo=0Īnd it creates two ports on the system, e.g. I can create two linked virtual serial ports on a Linux system with socat, and pretend one end is a serial device, and the other one is some code that uses the device.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |