I have a usb to serial FTDI adaptor connected to my mac. I am able to use the command:
screen /dev/tty.usbserial-A601L9OC
This opens a serial terminal for the port and everything works fine. But when I try to send characters to the serial port via the command:
root# echo 'a' > /dev/tty.usbserial-A601L9OC
the command hangs and nothing is ever sent. A similar thing happens when I try to connect to it in a c program. The program hangs trying to open the serial port:
int fd = open("/dev/tty.usbserial-A601L9OC", O_RDWR | O_NOCTTY | O_SYNC);
When I run stty on the port it prints:
root# stty -f /dev/tty.usbserial-A601L9OC
speed 9600 baud;
lflags: -icanon -isig -iexten -echo
iflags: -icrnl -ixon -ixany -imaxbel -brkint
oflags: -opost -onlcr -oxtabs
cflags: cs8 -parenb
which looks correct. Does anybody have an ideas as to why these commands hang and never send when connecting to the serial port yet screen works just fine? Any help will be appreciated.
Update: The results of getting info from stty
bash-3.2# stty -a -f /dev/tty.usbserial-A601L9OC
speed 9600 baud; 0 rows; 0 columns;
lflags: -icanon -isig -iexten -echo -echoe -echok -echoke -echonl
-echoctl -echoprt -altwerase -noflsh -tostop -flusho -pendin
-nokerninfo -extproc
iflags: -istrip -icrnl -inlcr -igncr -ixon -ixoff -ixany -imaxbel -iutf8
-ignbrk -brkint -inpck -ignpar -parmrk
oflags: -opost -onlcr -oxtabs -onocr -onlret
cflags: cread cs8 -parenb -parodd hupcl -clocal -cstopb -crtscts -dsrflow
-dtrflow -mdmbuf
cchars: discard = ^O; dsusp = ^Y; eof = ^D; eol = <undef>;
eol2 = <undef>; erase = ^?; intr = ^C; kill = ^U; lnext = ^V;
min = 1; quit = ^\; reprint = ^R; start = ^Q; status = ^T;
stop = ^S; susp = ^Z; time = 0; werase = ^W;