0

I use jpnevulator to sniff an application which reads a serial port:

jpnevulator --tty /dev/ttyS0 --read

Let's assume that the following bytes are sent to the serial port: A B C D E. Sometimes jpnevulator prints only bytes: A C E whereas the application gets bytes B D.

jpnevulator should print bytes: A B C D E and the application also should get all bytes: A B C D E. What is wrong ? Should I run jpnevulator with some option ?

1 Answer 1

1

Not familiar with jpnevulator, but in general: If you have two applications reading from a single tty, then only one application will get the data.

If you want to duplicate the data, you have to create a second (or third) tty, and let the application read from it.

One way to do it is to use something like ttybus. You can then attach jpnevulator to one of the new ttys, and your application to another.

Another way is to use socat with -x or -v, e.g.

socat -x PTY,link=/tmp/ptya /dev/ttyS0

and then point your application to /tmp/ptya, while socat dumps the traffic in hex to stderr.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .