LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
LinkBack Search this Thread
Old 10-21-2006, 05:19 PM   #1
seraph-seph
Member
 
Registered: Jul 2005
Location: /dev/ATX3
Distribution: Slackware 11(kernel 2.6.17.13), SuSE 10, Caldera, CentOS 4.3
Posts: 38

Rep: Reputation: 15
How to read serial port (/dev/ttyS0) without end of transmission


Hi, as a similar post I figure out that I couldn't read the buffer from the serial port since as end of transmission I'm receiving char 20 instead of char 13

Does any body knows how to read the serial port from bash shell without waiting for the carriage return?

I hope someone can help me with this.

Mario
 
Old 10-22-2006, 01:03 AM   #2
Jerre Cope
Member
 
Registered: Oct 2003
Location: Texas (central)
Distribution: ubuntu,Slackware,knoppix
Posts: 313

Rep: Reputation: 35
reading serial port from bash

Use the stty command to set the parameters of your serial port first. Something like:

stty 1200 cs7 parenb sane -echo -echok -icrnl -ixon -icanon -opost -onlcr time 3 min 0 </dev/ttyxx # hardware handshake */

or

stty 9600 cs8 -parenb -echo -echok -icrnl ixon -icanon -opost -onlcr time 3 min 0 </dev/ttyxx # software handshake


The key parameters you're looking for are time 3 and min 0
 
  


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
writing to serial port, /dev/ttyS0 togunter Programming 2 06-08-2008 09:27 AM
Serial Port HowTo (Cannot open /dev/ttyS0) chun-mee Linux - Hardware 2 07-14-2006 05:35 PM
Using serial port card(PCMCIA) with IPAQ running Linux, can't find ttyS0 port d2army Linux - Laptop and Netbook 0 11-12-2005 08:07 PM
Unable to communicate using serial port (COM1) /dev/ttys0 vinaybms Linux - Networking 1 03-11-2005 08:08 AM
Telnet into Cisco router via /dev/ttyS0 (aka COM1 serial port) naesyllek Linux - Networking 2 06-25-2003 05:33 PM


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