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
add comment

5 Answers

up vote 5 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
add comment

Try this:

screen /dev/tty.usbserial-blahblah 9600

works for me.

share|improve this answer
add comment

Have a look at http://sourceforge.net/projects/ttyusbspy/?source=navbar It is on alpha stage but it works

share|improve this answer
add comment

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

share|improve this answer
add comment

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
add comment

Your Answer

 
discard

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.