TLDR - I have onlcr
configured in my terminal, but I don't see the \r
getting added
If plug two FTDI serial converters together, and plug them both into my computer, I get two ports called /dev/ttyUSB0
and /dev/ttyUSB1
If I open them both with picocom
in different terminals, I can make sure they are connected, properly, by sending messages back and forth, and if I quit using C-A C-Q
it leaves the ports configured as follows:
$ stty -F /dev/ttyUSB0 -a
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 = 1; 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
$ stty -F /dev/ttyUSB1 -a
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 = 1; 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
Now if I open two terminals for listening to the two serial ports:
$ cat -v /dev/ttyUSB0
$ cat -v /dev/ttyUSB1
(actually I am only going to need one of them for this specific experiment, but it doesn't hurt to have both)
and then in a third terminal, send a single line like this:
$ echo this is a test > /dev/ttyUSB1
and then send one more line to prove that I am printing carriage returns:
$ echo -e 'this is another test\r' > /dev/ttyUSB1
then this is what I see:
$ cat -v /dev/ttyUSB0
this is a test
this is another test^M
Why don't I see ^M
in line #1, and ^M^M
in line #2?
icrnl
is off on both devices, so it shouldn't be converting it back right?
Why is (or isn't) this happening?