User Tools

Site Tools


system:console:stty

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

system:console:stty [2007/05/17 14:32] – external edit 127.0.0.1system:console:stty [2023/01/24 12:54] (current) phil
Line 12: Line 12:
  
   * ''Signal'' is one of the predefined ones, see ''stty(1)''.   * ''Signal'' is one of the predefined ones, see ''stty(1)''.
-  * ''Sequence'' maybe anything possible, but a good choice is defining an Escape Sequence (beginning with ''^'').+  * ''Sequence'' maybe anything possible, but a good choice is defining an Escape Sequence (starting with ''^'').
  
 Example: Example:
    stty stop ^Y    stty stop ^Y
  
-**NB:** normal Sequences are interpreted case sensitive, but Escape Sequences not!+**NB:** Regular sequences are interpreted case sensitive, escape sequences are not!
  
  
 ===== The ''^S''-Problem ===== ===== The ''^S''-Problem =====
-You typed //C-s//? Terminal hangs? No wonder, you sent a ''stop'' signal to it.+You typed //C-s//? Terminal hangs? In fact, you sent a ''stop'' signal.
  
-Do not even try, typing ''reset'' does not help you.+Do not even try, typing ''reset'' does not help.
  
-To get the solution watch at ''stty -a'':+The output of ''stty -a'' gives some insight:
   % stty -a   % stty -a
   speed 38400 baud; rows 51; columns 89; line = 54;   speed 38400 baud; rows 51; columns 89; line = 54;
Line 36: Line 36:
   opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0   opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
   isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt echoctl echoke    isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt echoctl echoke 
-Interesting are the values for ''stop'' and ''start'':+The values for ''stop'' and ''start'' are relevant here:
   start = ^Q;    start = ^Q; 
   stop = ^S;   stop = ^S;
-So, typing //C-q// should suffice to rescue your terminal session.+Therefore, typing //C-q// should bring things back to normal. 
 + 
 +===== Serial Terminal Baud Rate ===== 
 + 
 +''stty'' can set the terminal's baud rate and it receives feedback whether the 
 +value was acceptedThis may be used to find out what max baud rate a serial 
 +port supports. A simple script could loop over: 
 + 
 +  # stty -F /dev/ttyX <value> 
 + 
 +checking the return value. With regular serial ports, max speed is typically 
 +115200baud. USB-serial-adapters may do more, relevant with some OBD2-adapters 
 +for car diagnostics. 
 + 
 +Standard baud values are found in ///usr/include/asm-generic/termbits.h// and 
 +///usr/include/asm-generic/termbits-common.h// as defines with name ''B<value>'': 
 + 
 +  #define     B0          0x00000000      /* hang up */ 
 +  #define    B50          0x00000001 
 +  #define    B75          0x00000002 
 +  #define   B110          0x00000003 
 +  #define   B134          0x00000004 
 +  #define   B150          0x00000005 
 +  #define   B200          0x00000006 
 +  #define   B300          0x00000007 
 +  #define   B600          0x00000008       
 +  #define  B1200          0x00000009 
 +  #define  B1800          0x0000000a 
 +  #define  B2400          0x0000000b 
 +  #define  B4800          0x0000000c 
 +  #define  B9600          0x0000000d 
 +  #define B19200          0x0000000e 
 +  #define B38400          0x0000000f 
 +   
 +  #define     B57600      0x00001001 
 +  #define    B115200      0x00001002 
 +  #define    B230400      0x00001003 
 +  #define    B460800      0x00001004 
 +  #define    B500000      0x00001005 
 +  #define    B576000      0x00001006 
 +  #define    B921600      0x00001007 
 +  #define   B1000000      0x00001008 
 +  #define   B1152000      0x00001009 
 +  #define   B1500000      0x0000100a 
 +  #define   B2000000      0x0000100b 
 +  #define   B2500000      0x0000100c 
 +  #define   B3000000      0x0000100d 
 +  #define   B3500000      0x0000100e 
 +  #define   B4000000      0x0000100f 
system/console/stty.txt · Last modified: 2023/01/24 12:54 by phil