LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
Search this Thread
Old 12-04-2004, 11:08 AM   #1
mchitrakar
Member
 
Registered: Mar 2004
Posts: 93
Blog Entries: 1

Rep: Reputation: 15
reading data from a serial port


hello guys,

I have got a pecuiliar problem in hand. There, I have to read data via serial port from a communication device and am given option to use any OS and my choice is Linux of course. I dont know what protocols that device uses except that it simply sends data @ 9600 bps with 1 stop and no parity. But I have to read its data somehow. I want to know if there is any command to read data from a serial port (though writing to it is as simple as "echo a.vi > /dev/tty--"). Moreover, its not fixed when the device will send the data (i guess i'd need to use the for loop...). pls do reply.
 
Old 12-04-2004, 11:27 AM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 12,058

Rep: Reputation: 759Reputation: 759Reputation: 759Reputation: 759Reputation: 759Reputation: 759Reputation: 759
You can use minicom which is a terminal program to see what the device transmits. As long as the device transmits regular ASCII characters (A-Z 1-9) minicom will work. For anything else your probably going to have to write your on application.
 
Old 12-04-2004, 12:59 PM   #3
mchitrakar
Member
 
Registered: Mar 2004
Posts: 93
Blog Entries: 1

Original Poster
Rep: Reputation: 15
well...thanks...i was really looking for a command like echo or something else or like read....anyway...i have to develop the program..but is there any inbuilt unix command to read the data from serial ports...
 
Old 12-04-2004, 02:24 PM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 12,058

Rep: Reputation: 759Reputation: 759Reputation: 759Reputation: 759Reputation: 759Reputation: 759Reputation: 759
You can try
/dev/ttyS0/ > logfile
or
tail -f /dev/ttyS0 >logfile

I've never been able to get to work for me.
 
  


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
Reading Baud Rate of Serial Port zaheer031 Programming 1 09-27-2004 01:47 PM
accessing data from serial port PrerakParikh Linux - Hardware 2 08-24-2004 11:17 PM
Problems with reading back serial binary data esi-eric Linux - Software 14 08-06-2004 02:48 PM
Log incomming data from a serial port shoekstr Linux - Hardware 6 05-28-2004 11:53 AM
Reading COM Port Data croakofonix Programming 1 06-11-2003 05:17 PM


All times are GMT -5. The time now is 06:39 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration