Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Is there any port monitoring tool to watch the packets written on the port? I especially want to check if my program written in Java works so I need some kind of tool to see if my little application is writing the messages to the port. How do I do this?

share|improve this question
Packets aren't written on the port. Characters are. It's not like Ethernet at all. –  ultrasawblade Apr 30 '11 at 18:33
Wouldn't the serial port show up in /dev? Would you be able to just read that file or is that not possible? –  maxmackie Nov 8 '11 at 17:59
Similar questions from sibling SE sites: stackoverflow.com/q/940374/12892 and serverfault.com/q/112957/4276 –  Cristian Ciupitu Feb 4 at 8:12

5 Answers 5

up vote 8 down vote accepted

I found projects called Linux Serial Sniffer, jpnevulator, and Moni. The first two look like they do exactly what you want. The last one calls itself a monitor, but it actually looks like a standard serial communication program.

share|improve this answer
thanks for that !! i will give it a try. by the way i solved the issue from my java side. i was missing a \r, so that prevented my message from writing on to the port. thanks for that anyways!! –  Deepak Apr 30 '11 at 18:24
The «LInux Serial Sniffer» is buggy, it absolutely takes out incoming data, thus another application which is actually listen to serial see nothing. But, at least, the data that goes outside seems to go without problem. –  Hi-Angel 17 hours ago

I don't think the serial driver has any tracing functionality that would allow you to watch packets. You can use strace to observe all the reads and writes from your application:

strace -s9999 -o myapp.strace -eread,write,ioctl ./myapp
share|improve this answer
can is send packets to the port if nothign is connected ? –  Deepak Apr 30 '11 at 12:53

When I debug interaction of my application with a serial port, I use moserial.

share|improve this answer
What're you talking about, in the docs written it's just a terminal. –  Hi-Angel 17 hours ago

Have a look at ttyUSBSpy. It is on alpha stage, but it works.

share|improve this answer
It doesn't. It is written in python, and the code does import some import pcopy, which is even Google gave up to find. –  Hi-Angel 17 hours ago

Try this:

screen /dev/tty.usbserial-blahblah 9600

works for me.

share|improve this answer
This opens the port and assumes control over it, so nothing else can use it. This does not "monitor" or "sniff" the traffic. –  Ian M Jan 23 at 7:12

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.