LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   How to read serial port (/dev/ttyS0) without end of transmission (https://www.linuxquestions.org/questions/programming-9/how-to-read-serial-port-dev-ttys0-without-end-of-transmission-494452/)

seraph-seph 10-21-2006 05:19 PM

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

Jerre Cope 10-22-2006 01:03 AM

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


All times are GMT -5. The time now is 08:47 AM.