Results 1 to 10 of 13
I am new to Linux so please bare with me.
I need to log all communications between an application and the serial port on the same system.
I did a ...
- 11-20-2011 #1Just Joined!
- Join Date
- Apr 2011
- Posts
- 13
Help with Linux application command
I am new to Linux so please bare with me.
I need to log all communications between an application and the serial port on the same system.
I did a little research and found an application called Interceptty that looks like it will do the trick. However, I'm having issues determining the proper sytax.
Here is a link to the Interceptty webpage...hxxp://suspectclass.com/sgifford/interceptty/interceptty.html
Here is the command that I thought would work...
"Interceptty /dev/ttyS0 -o test.txt". It does execute, holds on the command line and creates the output file, but nothing gets logged to the file. I've tried several command line variations to no avail. I also sent an email to the author, but got a bounceback.
Like I said, I'm new to Linux so I'm sure this will probably be easy one for you guys.
Thanks!
- 11-21-2011 #2Just Joined!
- Join Date
- Nov 2011
- Location
- Bandung
- Posts
- 6
Try with setserial (for more option you can use setserial -h) or using minicom for simple to do
- 11-21-2011 #3Just Joined!
- Join Date
- Apr 2011
- Posts
- 13
Thanks, but I don't think Setserial will do what I'm looking for. This looks to be more for setting/reading the serial port values. Minicom looks to be more of a communications program.
I need to capture all communications sent to and received from the serial port from an application.
Like I said, I think Interceptty will work, but I can't figure out the proper syntax since Linux is pretty much Greek to me at this point.
The command line I have used is "Interceptty /dev/ttyS0 -o test.txt". The serial port I need to monitor is COM1.
I'm really under the gun to get this figured out so any help is much appreciated.
Here is the usage parameters listed on the Interceptty webpage:
Usage: ./interceptty [-V] [-qvl] [-s back-set] [-o output-file]
[-p pty-dev] [-t tty-dev]
[-m [pty-owner,[pty-group,]]pty-mode]
[-u uid] [-g gid] [-/ chroot-dir]
back-device front-device
back-device Use back-device as the device to intercept
path TTY dev is at /path
@/path Socket is at /path
@host
ort Inet socket is at host
ort
!prog Run prog for backend
=rfd[,wfd] Use file descriptors
front-device Use front-device as the device applications connect to
path Create symlink at /path
@/path Socket at /path
@host
ort Inet socket at host
ort
=rfd[,wfd] Use file descriptors
'-' to prevent creating a front-device.
Doesn't currently do anything.
-l Line-buffer output
-o output-file Write intercepted data to output-file
-s back-stty Use given settings to set up back-device
These settings are passed directly to stty(1).
-m pty-mode Specify permissions for the new pty.
Format is [pty-owner,[pty-group,]]pty-mode]
-u uid Switch to given uid after setting up (must be root)
-g gid Switch to given gid after setting up (must be root)
-/ chroot-dir chroot(2) to given dir after setting up (must be root)
-q Activate quiet mode
-v Activate verbose mode
-V Print version number then exit
-p pty-dev Full path to pty device for front-end (used internally)
-t tty-dev Full path to tty device for front-end (used externally)
- 11-21-2011 #4Linux Guru
- Join Date
- May 2011
- Posts
- 1,843
Your syntax looks all right to my non-interceptty-trained eye. Have you tried the line-buffering output (-l) and verbose (-v) flags? Are you root, in case it is a permissions thing? Anything in dmesg or /var/log/messages about the hardware? Does your command/serial device work as normal, w/o interceptty in between?
- 11-22-2011 #5Just Joined!
- Join Date
- Apr 2011
- Posts
- 13
I have tried both the line buffering & verbose commands. No output is displayed on the screen with the -l switch. The -v switch lists "PID xxxxx Monitoring child process" where xxxxx is the PID of the Interceptty program.
There is nothing reported in messages or dmesg files and the serial device is functioning properly when running Interceptty.
Yes, I am logged in as root when running this.
One of the examples lists the following command for monitoring what a program running under VMWare was sending to the serial port
"Interceptty -s 'ispeed 19200 ospeed 19200' -l /dev/ttyS0 |interceptty-nicedump".
I'm not running VMWare, but I would think the command should still work under Linux.
Any ideas?
- 11-22-2011 #6Linux Guru
- Join Date
- May 2011
- Posts
- 1,843
Have you tried contacting the author for help? If anybody knows, he should.
- 11-22-2011 #7Just Joined!
- Join Date
- Apr 2011
- Posts
- 13
Yes, I sent an email to him last week, but I got a bounceback. Evidently, he no longer has that email address.
- 11-22-2011 #8Linux Guru
- Join Date
- May 2011
- Posts
- 1,843
- 11-22-2011 #9Just Joined!
- Join Date
- Apr 2011
- Posts
- 13
No problem. Like I said, I'm new to Linux so I'm struggling with the simple things.
Do you know of another application that will allow me to capture the commincations sent to a serial port that is user friendly? Or at least one where I can get some support?
Thanks
- 11-22-2011 #10Linux Guru
- Join Date
- May 2011
- Posts
- 1,843
Last edited by atreyu; 11-22-2011 at 01:33 PM. Reason: serlook


Reply With Quote
