I'm quite a newbie on RPi so I'm sorry if I'm not being specific enough. I need to run 5 rtkrcv (RTKLIB application program) with different setting on each one, so I take it I need 5 virtual ports for each instance. My physical serial (GPS device) is connected as ttyAMA0 with baud rate of 115200. Is there a utility that has the functionally similar to this program on Raspbian? or any other way to achieve the task?
Asked
Active
Viewed 1,446 times
1 Answers
4
There is a tool called ttybus created exactly for this purpose. Here's an example from their readme page:
step 1: create a new tty bus called /tmp/ttyS0mux:
tty_bus -s /tmp/ttyS0mux
step 2: connect the real device to the bus using tty_attach:
tty_attach -s /tmp/ttyS0mux /dev/ttyS0
step 3: create 2 fake ttyS0 devices, attached to the bus:
tty_fake -s /tmp/ttyS0mux /dev/ttyS0fake0
tty_fake -s /tmp/ttyS0mux /dev/ttyS0fake1
step 4: start your application and force it to use the new serial device for input or output
/bin/foo /dev/ttyS0fake0 &
/bin/bar /dev/ttyS0fake1 &
You can achieve a similar result using socat which is a standard Linux command to stream data between files, file descriptors, pipes, and UNIX/TCP sockets. There are many options here, I would use named pipes as fake serial ports. It may be challenging to make the pipes work both ways, but it's pretty straightforward to set up if you need reception only.
Dmitry Grigoryev
- 28,277
- 6
- 54
- 147