LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-21-2007, 05:50 AM   #1
Ashrael
LQ Newbie
 
Registered: Aug 2007
Posts: 7

Rep: Reputation: 0
Com port data to file


HELP! I need a program (or a way) to read the com-port output of a meter, normaly it conncts to a small printer and takes ages to print out the data, which i need to copy to a spreadsheet again, this is labourious to say the least.. I am urgently looking for a way to do this directly.. Any suggestions, tips etc are welcome..



THANX!
 
Old 08-21-2007, 09:13 AM   #2
blackhole54
Senior Member
 
Registered: Mar 2006
Posts: 1,896

Rep: Reputation: 61
You are talking about a serial port such as /dev/ttyS0 (COM1 in Microsoft speak)?

It really depends on what your needs are. If you just want to log incoming data to a file, for example, your solution might be as simple as the shell command (which can be in a script):

Code:
cat /dev/ttyS0 > filename
or to just spit the data out to the screen interactively:

Code:
cat /dev/ttyS0
I can think of two issues with this. This first is the issue of permissions. To do a quick-n-dirty check to see if this will work for you, you can run the command as root. If it turns out this accomplishes what you want, you will probably want to change permissions so you can run as it as a regular user. (It's bad security to run things as root that you don't have to.)

The other thing to think about is configuring the port. Check the man page of stty for about a kazillion settings for the port. You, of course, need to get baud rate right. You should also be careful on your echo settings or you might get an infinite loop going with each device echoing to the other.

If you want to interact with the device you might find minicom useful.

If neither of these suggestions does what you want, perhaps you can flesh out your problem a little more.
 
Old 08-26-2007, 01:35 PM   #3
Ashrael
LQ Newbie
 
Registered: Aug 2007
Posts: 7

Original Poster
Rep: Reputation: 0
Thx!

Thanx for the tip, i'll try that this week and give you an update!....
 
  


Reply



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
gnuplot, pull X data from file, specify Y data at cmd line? hedpe Programming 5 03-15-2007 11:32 PM
How to know when the data is available on the port? wallwaters Linux - Software 1 05-11-2005 04:03 PM
port the data suchi_s Programming 0 07-26-2004 06:05 AM
Forwarding data from port to another Mikessu Linux - Networking 0 02-05-2004 03:10 PM
Reading COM Port Data croakofonix Programming 1 06-11-2003 04:17 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:59 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
Open Source Consulting | Domain Registration