简体   繁体   中英

Analyzing Serial data over USB on Linux

I have a USB to RS232 adapter which I'm currently using to communicate with a legacy device. I want to analyze the data going to and from the legacy device from my Ubuntu machine over USB. The adapter is getting detected automatically without installing any driver as shown in lsusb output below:

Bus 006 Device 002: ID 0403:6001 Future Technology Devices International, Ltd FT232 USB-Serial (UART) IC

I tried using the USB packet capture in Wireshark, but it shows a bunch of URB_CONTROL, URB_BULK packets which is not showing anything meaningful. So if there are any better utilities available which can capture the USB2Serial data for a Linux system, please let me know.
TIA!

After trying various methods, I finally got what I needed using strace . The following command helped me capture all the termios settings for the serial port and also all the IOCTL calls after doing some greps on the file handle of the serial port:

sudo strace -p <pid> -t -v -o dump.txt

This will dump all the system calls that your application makes on Linux into the file dump.txt.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM