Pages: [1]   Go Down
Author Topic: Making a serial snooper with a linux box?  (Read 562 times)
0 Members and 1 Guest are viewing this topic.
Dallas
Offline Offline
Sr. Member
****
Karma: 3
Posts: 337
nephew as a kittens
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have some industrial equipment I'm trying to reverse-engineer. It communicates from the main CPU to a controller via a serial connection. I want to hook into the serial connection and dump everything doing down that line to log file so that I can stare at the messages and try to figure out the protocol.

I could just plug the serial cable into my computer but I need the messages to continue going to the controller or else the rest of the system will error. So basically I need to tap into it.

My first thought is to use a laptop with two USB-Serial adapters. I could use a perl script to open both serial connections as files and send everything that comes in the one serial connection right back out the other serial connection, but also dump it to a log file. Will this even work? I can see that it will introduce some latency but I don't think that will be critical.
Logged

Austin, TX
Offline Offline
Faraday Member
**
Karma: 71
Posts: 6146
Baldengineer
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

http://lmgtfy.com/?q=rs232+protocol+analyzer

Yielded:
http://www.beyondlogic.org/protocolanalyser/protocolanalyser.htm

Logged

Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog: www.baldengineer.com  || Electronics Tutorials for Beginners:  www.addohms.com

0
Offline Offline
Faraday Member
**
Karma: 16
Posts: 2857
ruggedcircuits.com
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

A hardware solution is possible, but the software solution you describe will work just as well too. I did this very thing on a Linux system using a Python program many moons ago. I suppose Perl might work too, it just won't look as nice  smiley-wink

--
The Quick Shield: breakout all 28 pins to quick-connect terminals
Logged

Rural Arizona
Offline Offline
Edison Member
*
Karma: 7
Posts: 1711
Incorrigible tinkerer
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Here's one that's simple,  solid, and free.  It splits the two directions between two serial ports.  You can build the breakout cable in literally just a few minutes if you don't need handshaking lines.  Takes several minutes if you do.

Captures everything to a text file,  and even does timestamping of status line changes (and,  iirc,  data:  it's been several months since I used it,  and the protocol wasn't time-critical,  so my memory is a  bit fuzzy on the subject).


Logged

Pages: [1]   Go Up
Jump to: