Del, I just did a simple test, that might help you to a solution
1. Used mkfifo to create 3 pipes "mkfifo /tmp/r1;mkfifo /tmp/r2;mkfifo /tmp/r3;" 2. Used "tee -a" to write a copy of data to each of these - "(while [ 1 ]; do date; sleep 1; done ) | tee -a /tmp/r1 | tee -a /tmp/r2 | tee -a /tmp/r3" 3. In 3 separate terminals did a "cat /tmp/r1" (and r2 and r3). This *mostly* works, but killing one listening process seems to cause the others to abort. I am guessing there is some foo I am not aware of. Regards, Martin martinvisse...@gmail.com On Tue, Dec 29, 2009 at 10:03 PM, Del <d...@babel.com.au> wrote: > > Hi, > > Does anyone have a solution to this problem? > > I have a serial port (connected to a GPS at 4800 baud). I have multiple > processes that need to read from that serial port. I need all of the > processes to read the same data, essentially creating a one way chat from > the serial port to all processes listening in. > > I've tried using socat but if I create a socket connection, using, e.g. > > socat TCP4-LISTEN:25555,reuseaddr,fork /dev/ttyUSB0,b4800,raw,echo=0 > > ... then have multiple connections in to TCP socket 25555, then each socket > connection gets part of the data stream from the serial port. > > I've tried setting up a multicast, but because multicast is UDP based I'm > seeing occasional packet-out-of-order and packet-dropped issues. Ideally I'd > like it to be TCP based -- I have one process that can connect to a TCP > socket for its data rather than read from the port, and I can use socat to > create PTYs for the other processes that expect a serial port provided the > data comes in in the right order. > > Yes, I know about gpsd, and one of the processes that needs to read the > serial data is gpsd, but I have some processes that need to read the raw > data provided by the GPS and not gpsd's output. > > Thanx, > > -- > Del > Babel Com Australia > http://www.babel.com.au/ > ph: 02 9966 9476 > fax: 02 9906 2864 > -- > SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ > Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html > -- SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html