0

Let's assume that I run a program which reads/writes to a serial port (/dev/ttyS0). I known that the program uses baud rate 19200 and dynamically sets parity bit (mark parity or space parity).

Is it possible to check those parameters from terminal ?

I have tried setserial -g /dev/ttyS0. Here is output (nothing about parity bit and baud rate):

/dev/ttyS0, UART: 16550A, Port: 0x03f8, IRQ: 4
2

Use stty instead:

stty -F /dev/ttyS0 -a

Example output:

speed 9600 baud; rows 0; columns 0; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>; eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V; discard = ^O; min = 0; time = 0;
-parenb -parodd -cmspar cs8 -hupcl -cstopb cread clocal -crtscts
-ignbrk -brkint -ignpar -parmrk inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8
-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 -flusho -extproc
0

I personally use screen when dealing with serial console

screen /dev/ttyS0 19200

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.