LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-02-2009, 01:58 PM   #1
xw00t
LQ Newbie
 
Registered: Jun 2009
Posts: 4

Rep: Reputation: 0
How to Capture Serial Port IO?


I would like to dump all input / output data from my serial (DB9/RS232) port to a file (>>file.log). What is the easiest way to do this? Can I setup a port to automatically poll like Windows Hyperterminal does?

Also, what is the standard /dev/tty for this port?

Thanks

Last edited by xw00t; 06-02-2009 at 02:25 PM.
 
Old 06-02-2009, 02:38 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,066
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
Hi, welcome to LQ!

Quote:
Originally Posted by xw00t View Post
I would like to dump all input / output data from my serial (DB9/RS232) port to a file (>>file.log). What is the easiest way to do this? Can I setup a port to automatically poll like Windows Hyperterminal does?
I'm not sure what you mean by automatically poll.

[edit]Linux' counterpart to hyperterminal is probably
something like minicom

Quote:
Originally Posted by xw00t View Post
Also, what is the standard /dev/tty for this port?

Thanks
That'll depend on your hardware ... /dev/ttySx with
x being one of 0-3 are quite common.


Cheers,
Tink

Last edited by Tinkster; 06-02-2009 at 02:43 PM. Reason: edit
 
1 members found this post helpful.
Old 06-03-2009, 03:02 AM   #3
xw00t
LQ Newbie
 
Registered: Jun 2009
Posts: 4

Original Poster
Rep: Reputation: 0
I suppose that "Poll" wasn't a good word for it. Is there a way to setup a ttyS0 to automatically dump all data sent to it into a text file?

I have used minicom but I don't want there to have to be any user interaction. Can't I just
Code:
cat /dev/ttyS0 >> /home/user/file.log
or similar?

Thanks again
 
Old 06-08-2009, 04:11 AM   #4
xw00t
LQ Newbie
 
Registered: Jun 2009
Posts: 4

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Tinkster View Post
Hi, welcome to LQ!


I'm not sure what you mean by automatically poll.

[edit]Linux' counterpart to hyperterminal is probably
something like minicom



That'll depend on your hardware ... /dev/ttySx with
x being one of 0-3 are quite common.


Cheers,
Tink
I don't think my /dev/ttyS0 or ttyS1 are working properly. Is there are configuration file that to enable or disable those ports?
 
Old 06-08-2009, 04:33 AM   #5
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,066
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
There's /etc/serial.conf ... also check whether the kernel
knows about the port(s).
Code:
dmesg | egrep -C 3 "ttyS0|serial8250"

Last edited by Tinkster; 06-08-2009 at 04:35 AM.
 
Old 06-09-2009, 12:28 AM   #6
xw00t
LQ Newbie
 
Registered: Jun 2009
Posts: 4

Original Poster
Rep: Reputation: 0
I am running on Debian specifically and I do not have a /etc/serial.conf file. When I run the proposed dmesg command there is nothing found. This is why I think my serial port is not working properly. However if I run a
Code:
dmesg | grep tty
I get the following:
Code:
console [tty0] enabled
What should I do to enable that serial port?

Last edited by xw00t; 06-09-2009 at 12:30 AM.
 
Old 06-09-2009, 02:27 AM   #7
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,066
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
A quick google for "Debian serial.conf" returns several hits,
suggesting that it belongs to the package setserial.


Maybe you want to try an "apt-get install setserial"



Cheers,
Tink
 
Old 06-09-2009, 04:32 AM   #8
Marko Hyvärinen
LQ Newbie
 
Registered: May 2009
Posts: 24

Rep: Reputation: 15
depends how many ports your pc has, also you can "wire up" or steal data to another port or computer just x-wire others send-data to sniffers receive-data and use minicom to capture to log, it has log ability.

I'm not sure can you open same com-port many times on same computer, just test first. older linuxes had /dev/cuaXX - portnames. But seems that you don't have setserial configured so no serial ports configured.

Marko
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
linux serial port to router console port connection? frankie_fix Linux - General 3 02-26-2007 10:32 PM
Parallel Port & Serial Port device identification helpmeforlinux Linux - Hardware 3 01-02-2007 02:15 AM
capture serial input at startup TomFuchs Linux - General 4 11-23-2005 11:00 AM
Using serial port card(PCMCIA) with IPAQ running Linux, can't find ttyS0 port d2army Linux - Laptop and Netbook 0 11-12-2005 09:07 PM
Serial port capture printed data erald Linux - Software 0 04-12-2005 02:12 AM


All times are GMT -5. The time now is 03:55 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration