LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
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.

Notices

Reply
 
Search this Thread
Old 08-08-2006, 09:12 PM   #1
skydemon
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?

Cheers

Mick
 
Old 08-10-2006, 08:48 AM   #2
blackhole54
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 08:49 AM.
 
  


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 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 09:53 AM
reading data from a serial port mchitrakar Linux - Networking 3 12-04-2004 01:24 PM
Reading Baud Rate of Serial Port zaheer031 Programming 1 09-27-2004 12:47 PM
Problems with reading back serial binary data esi-eric Linux - Software 14 08-06-2004 01:48 PM
Reading COM Port Data croakofonix Programming 1 06-11-2003 04:17 PM


All times are GMT -5. The time now is 11:31 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