Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 08-08-2006, 10:12 PM   #1
LQ Newbie
Registered: Jun 2006
Posts: 6

Rep: Reputation: 0
help reading data from a serial port

Hi all, I am a bit of a newbie to this but I'm trying to write a shell script that will get a modem to dial out via a serial port and then wait for a CONNECT string to be returned. I can get it to dial out ok using:

echo -e "ATDTXXXXXXX\r" > /dev/ser1

however I am not sure how I can read data from the serial port to make sure the modem is connected. I cant use a chat script to do this for me unfortunately as I am using a cut down version of *nix and it does not have this installed. Can anyone help out?


Old 08-10-2006, 09:48 AM   #2
Senior Member
Registered: Mar 2006
Posts: 1,896

Rep: Reputation: 61
I don't know what /dev/ser1 is (unless it's a symlink), but if you know what you are talking about, OK.

You can see what comes back (if you have privilege to read /dev/ser1) with

cat /dev/ser1 ,

which can be subjected to the usual tricks such as redirecting, piping, etc.

Before doing any echos or cats, you probably want to set the I/O options with

stty [options] -F /dev/ser1

Consult the stty man page for details.

Good luck.

Last edited by blackhole54; 08-10-2006 at 09:49 AM.


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 On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
[REQUEST] C prog || SERIAL PORT reading nawin_g Programming 4 05-03-2006 10:53 AM
reading data from a serial port mchitrakar Linux - Networking 3 12-04-2004 02:24 PM
Reading Baud Rate of Serial Port zaheer031 Programming 1 09-27-2004 01:47 PM
Problems with reading back serial binary data esi-eric Linux - Software 14 08-06-2004 02:48 PM
Reading COM Port Data croakofonix Programming 1 06-11-2003 05:17 PM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 02:52 PM.

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